Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e643b68ac | |||
| 539f33d25e | |||
| 4d3cb9f486 | |||
| a55c82483a | |||
| 9e9bb82025 |
@@ -2,10 +2,10 @@
|
|||||||
LinuxPA is a try to bring a [PortableApps.com](http://portableapps.com) type launcher to Linux.
|
LinuxPA is a try to bring a [PortableApps.com](http://portableapps.com) type launcher to Linux.
|
||||||
|
|
||||||
# How to use
|
# How to use
|
||||||
Just double click on an app to launch it! If there are multiple executables, you can either select the specific executable, or if you just double click the app it'll launch the first linux executable (.sh script files have priority), but if one isn't found it launches the first executable in general.
|
Just double click on an app to launch it! If there are multiple executables, you can either select the specific executable, or if you just double click the app it'll launch the first linux executable it finds. .sh script files have priority over other executable files.
|
||||||
|
|
||||||
# Apps:
|
# Apps:
|
||||||
Both of the below places provide linux executables that don't need libs installed on the host system:
|
The below place provides linux executables that don't need libs installed on the host system:
|
||||||
[AppImage](https://bintray.com/probono/AppImages)
|
[AppImage](https://bintray.com/probono/AppImages)
|
||||||
|
|
||||||
# PortableApps.com Compatibility
|
# PortableApps.com Compatibility
|
||||||
@@ -13,23 +13,23 @@ LinuxPA works will with the PortableApps.com launcher, as it looks for apps in t
|
|||||||
My forum at PortableApps.com can be found [here](http://portableapps.com/node/54998).
|
My forum at PortableApps.com can be found [here](http://portableapps.com/node/54998).
|
||||||
|
|
||||||
# common.sh
|
# common.sh
|
||||||
common.sh is found in the PortableApps/LinuxPACom folder and is executed before the app. I mainly use it to set environment variables (such as HOME).
|
common.sh is found in the PortableApps/LinuxPACom folder and is executed before the app. I mainly use it to set environment variables (such as HOME). You can create and edit the common.sh from settings
|
||||||
|
|
||||||
# Simple App Setup
|
# Simple App Setup
|
||||||
Because apps aren't natively formated in the PortableApps.com format, if LinuxPA doesn't find the AppInfo.ini or appicon_\*.png in the App/AppInfo folder of the app it looks for them in the root directory of the app (except it looks, nor for appicon_\*.png, but appicon.png). If an AppInfo.ini file isn't found then the name of the app is grabbed from the folder name and it's category is set to other. It specifically looks for the lines starting with `Name=` and `Category=`
|
Because apps aren't natively formated in the PortableApps.com format, LinuxPA will look in the root directory for a AppInfo.ini (for basic info such as category and name) and appicon.png. If they aren't found, it looks where the appicon_\*.png and AppInfo.ini is in PortableApps format. You can set what the AppInfo.ini and appicon.png are from LinuxPA.
|
||||||
|
|
||||||
# AppImage Support
|
# AppImage Support
|
||||||
[AppImage Website](http://appimage.org)
|
[AppImage Website](http://appimage.org)
|
||||||
Right now AppImages are simply supported via the native linux executable support, but later I'm hoping to add downloading and automatic updating support later on.
|
Right now AppImages are simply supported via the native linux executable support, and you can download AppImages. (Woo)
|
||||||
|
|
||||||
# USB mount
|
# USB mount
|
||||||
Unfortunately Linux, by default, doesn't support running executables off of FAT formated flash drives, requiring you to mount your drive with special mount arguments or format in a linux friendly format (such as EXT4). I personally use the arguments `exec,noauto,nodev,nosuid,umask=0000`
|
Unfortunately Linux, by default, doesn't support running executables off of FAT formated flash drives, requiring you to mount your drive with special mount arguments or format in a linux friendly format (such as EXT4). I personally use the arguments `exec,noauto,nodev,nosuid,umask=0000`
|
||||||
|
|
||||||
# Screenshots
|
# Screenshots
|
||||||
Photos are found [Here](https://goo.gl/photos/VtBUL6DyZTMidj5n6)
|
Photos are found [Here](https://goo.gl/photos/VtBUL6DyZTMidj5n6). The screenshots are with the adapta gtk theme
|
||||||
|
|
||||||
# TODO (Might be in order)
|
# TODO (Might be in order)
|
||||||
1. MAKE IT BETTER
|
1. MAKE IT BETTER
|
||||||
1. Add updater for .AppImage files
|
1. Ask if you want to update
|
||||||
1. Download .AppImage files (maybe)
|
1. Better appimage support in general
|
||||||
1. Check if all apps are closed when it closes and ask if you want to force stop the apps.
|
1. Check if all apps are closed when it closes and ask if you want to force stop the apps. .
|
||||||
|
|||||||
+4
-2
@@ -1,11 +1,13 @@
|
|||||||
package appimg
|
package appimg
|
||||||
|
|
||||||
type appimg struct {
|
type appimg struct {
|
||||||
name string
|
full string
|
||||||
|
name string
|
||||||
|
version string
|
||||||
}
|
}
|
||||||
|
|
||||||
func newApp(name string) appimg {
|
func newApp(name string) appimg {
|
||||||
var out appimg
|
var out appimg
|
||||||
out.name = name
|
out.full = name
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-6
@@ -19,7 +19,7 @@ func downloadApp(parent *gtk.Window, ap appimg) {
|
|||||||
})
|
})
|
||||||
spn, _ := gtk.SpinnerNew()
|
spn, _ := gtk.SpinnerNew()
|
||||||
spn.Start()
|
spn.Start()
|
||||||
lbl, _ := gtk.LabelNew("Downloading " + ap.name + "...")
|
lbl, _ := gtk.LabelNew("Downloading " + ap.full + "...")
|
||||||
box, _ := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 5)
|
box, _ := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 5)
|
||||||
box.SetMarginStart(10)
|
box.SetMarginStart(10)
|
||||||
box.SetMarginEnd(10)
|
box.SetMarginEnd(10)
|
||||||
@@ -39,28 +39,29 @@ func downloadApp(parent *gtk.Window, ap appimg) {
|
|||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
resp, err := check.Get(urlBase + ap.name)
|
resp, err := check.Get(urlBase + ap.full)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
name := strings.Split(ap.name, "-")[0]
|
name := strings.Split(ap.full, "-")[0]
|
||||||
var foldName string
|
var foldName string
|
||||||
if _, err = os.Open("PortableApps/" + name + "Portable"); err == nil {
|
if _, err = os.Open("PortableApps/" + name + "Portable"); err == nil {
|
||||||
foldName = "PortableApps/" + name + "Portable"
|
foldName = "PortableApps/" + name + "Portable"
|
||||||
} else if _, err = os.Open("PortableApps/" + name); err == nil {
|
} else if _, err = os.Open("PortableApps/" + name); err == nil {
|
||||||
foldName = "PortableApps/" + name
|
foldName = "PortableApps/" + name
|
||||||
} else {
|
} else {
|
||||||
os.Mkdir("PortableApps/"+name, 0777)
|
os.Mkdir("PortableApps/"+name+"Portable", 0777)
|
||||||
foldName = "PortableApps/" + name
|
foldName = "PortableApps/" + name
|
||||||
}
|
}
|
||||||
fil, err := os.Create(foldName + "/" + ap.name)
|
os.Remove(foldName + "/" + ap.full)
|
||||||
|
fil, err := os.Create(foldName + "/" + ap.full)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
io.Copy(fil, resp.Body)
|
io.Copy(fil, resp.Body)
|
||||||
_ = fil.Chmod(0777)
|
fil.Chmod(0777)
|
||||||
}(win, ap)
|
}(win, ap)
|
||||||
}
|
}
|
||||||
|
|||||||
+40
-8
@@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gotk3/gotk3/glib"
|
"github.com/gotk3/gotk3/glib"
|
||||||
@@ -16,7 +17,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//ShowUI shows the list of possible AppImages to be downloaded in a gtk.Window
|
//ShowUI shows the list of possible AppImages to be downloaded in a gtk.Window
|
||||||
func ShowUI(clsFunc func()) {
|
func ShowUI(newestVersionOnly bool, clsFunc func()) {
|
||||||
win, _ := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
|
win, _ := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
|
||||||
win.Connect("destroy", func() {
|
win.Connect("destroy", func() {
|
||||||
clsFunc()
|
clsFunc()
|
||||||
@@ -45,13 +46,44 @@ func ShowUI(clsFunc func()) {
|
|||||||
win.Show()
|
win.Show()
|
||||||
getList(win, apch)
|
getList(win, apch)
|
||||||
go func(win *gtk.Window, apch chan appimg, list *gtk.ListBox) {
|
go func(win *gtk.Window, apch chan appimg, list *gtk.ListBox) {
|
||||||
for i := range apch {
|
if newestVersionOnly {
|
||||||
glib.IdleAdd(func(list *gtk.ListBox, i appimg) {
|
imgs := make([]appimg, 0)
|
||||||
lbl, _ := gtk.LabelNew(i.name)
|
a := make(map[string][]appimg)
|
||||||
list.Add(lbl)
|
names := make([]string, 0)
|
||||||
apps = append(apps, i)
|
for i := range apch {
|
||||||
lbl.Show()
|
imgs = append(imgs, i)
|
||||||
}, list, i)
|
}
|
||||||
|
for i, v := range imgs {
|
||||||
|
sp := strings.Split(v.full, "-")
|
||||||
|
if len(sp) >= 2 {
|
||||||
|
vers := sp[1]
|
||||||
|
removeLetters(vers)
|
||||||
|
imgs[i].version = vers
|
||||||
|
imgs[i].name = sp[0]
|
||||||
|
if _, ok := a[imgs[i].name]; !ok {
|
||||||
|
names = append(names, imgs[i].name)
|
||||||
|
}
|
||||||
|
a[imgs[i].name] = append(a[imgs[i].name], imgs[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sort.Strings(names)
|
||||||
|
for _, name := range names {
|
||||||
|
glib.IdleAdd(func(name string, list *gtk.ListBox, i appimg) {
|
||||||
|
lbl, _ := gtk.LabelNew(name)
|
||||||
|
list.Add(lbl)
|
||||||
|
apps = append(apps, i)
|
||||||
|
lbl.Show()
|
||||||
|
}, name, list, a[name][compareVersions(a[name])])
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for i := range apch {
|
||||||
|
glib.IdleAdd(func(list *gtk.ListBox, i appimg) {
|
||||||
|
lbl, _ := gtk.LabelNew(i.full)
|
||||||
|
list.Add(lbl)
|
||||||
|
apps = append(apps, i)
|
||||||
|
lbl.Show()
|
||||||
|
}, list, i)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}(win, apch, appList)
|
}(win, apch, appList)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package appimg
|
||||||
|
|
||||||
|
import "strings"
|
||||||
|
|
||||||
|
func removeLetters(vers string) string {
|
||||||
|
vers = strings.ToLower(vers)
|
||||||
|
letters := []string{"abcdefghijklmnopqrstuvwxyz"}
|
||||||
|
for _, v := range letters {
|
||||||
|
vers = strings.Replace(vers, v, "", -1)
|
||||||
|
}
|
||||||
|
return vers
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package appimg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
func compareVersions(imgs []appimg) int {
|
||||||
|
for i := range imgs {
|
||||||
|
imgs[i].version = removeLetters(imgs[i].version)
|
||||||
|
}
|
||||||
|
highest := 0
|
||||||
|
higharr := strings.Split(imgs[0].version, ".")
|
||||||
|
for i := 0; i < len(imgs); i++ {
|
||||||
|
if i != highest {
|
||||||
|
varr := strings.Split(imgs[i].version, ".")
|
||||||
|
if len(higharr) < len(varr) {
|
||||||
|
for j := 0; j < len(higharr); j++ {
|
||||||
|
h, _ := strconv.Atoi(higharr[j])
|
||||||
|
c, _ := strconv.Atoi(varr[j])
|
||||||
|
if h > c {
|
||||||
|
break
|
||||||
|
} else if c > h {
|
||||||
|
highest = i
|
||||||
|
higharr = varr
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return highest
|
||||||
|
}
|
||||||
@@ -9,18 +9,20 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
version = "2.1.0.5"
|
version = "2.1.1.0"
|
||||||
defIni = ""
|
defIni = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
master map[string][]app
|
master map[string][]app
|
||||||
linmaster map[string][]app
|
linmaster map[string][]app
|
||||||
cats []string
|
cats []string
|
||||||
lin []string
|
lin []string
|
||||||
wine bool
|
wine bool
|
||||||
comEnbld bool
|
comEnbld bool
|
||||||
wineAvail bool
|
wineAvail bool
|
||||||
|
portableHide bool
|
||||||
|
versionNewest = true
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -52,15 +54,24 @@ func uiStart() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func savePrefs() {
|
func savePrefs() {
|
||||||
fil, err := os.Open("PortableApps/LinuxPACom/Prefs.gob")
|
os.Remove("PortableApps/LinuxPACom/Prefs.gob")
|
||||||
if os.IsNotExist(err) {
|
fil, err := os.Create("PortableApps/LinuxPACom/Prefs.gob")
|
||||||
fil, err = os.Create("PortableApps/LinuxPACom/Prefs.gob")
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
enc := gob.NewEncoder(fil)
|
enc := gob.NewEncoder(fil)
|
||||||
enc.Encode(wine)
|
err = enc.Encode(wine)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = enc.Encode(portableHide)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = enc.Encode(versionNewest)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadPrefs() {
|
func loadPrefs() {
|
||||||
@@ -69,7 +80,18 @@ func loadPrefs() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
dec := gob.NewDecoder(fil)
|
dec := gob.NewDecoder(fil)
|
||||||
dec.Decode(&wine)
|
err = dec.Decode(&wine)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = dec.Decode(&portableHide)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = dec.Decode(&versionNewest)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func contains(arr []string, str string) bool {
|
func contains(arr []string, str string) bool {
|
||||||
|
|||||||
+55
-4
@@ -3,14 +3,22 @@ package main
|
|||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
|
||||||
|
"github.com/gotk3/gotk3/glib"
|
||||||
"github.com/gotk3/gotk3/gtk"
|
"github.com/gotk3/gotk3/gtk"
|
||||||
)
|
)
|
||||||
|
|
||||||
func settingsUI() {
|
func settingsUI(parent *gtk.Window, onExit func()) {
|
||||||
win, _ := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
|
win, _ := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
|
||||||
|
win.SetTransientFor(parent)
|
||||||
|
parent.SetSensitive(false)
|
||||||
win.SetDefaultSize(600, 300)
|
win.SetDefaultSize(600, 300)
|
||||||
win.SetPosition(gtk.WIN_POS_CENTER)
|
win.SetPosition(gtk.WIN_POS_CENTER_ON_PARENT)
|
||||||
|
win.Connect("destroy", func() {
|
||||||
|
parent.SetSensitive(true)
|
||||||
|
onExit()
|
||||||
|
})
|
||||||
comTagTbl, _ := gtk.TextTagTableNew()
|
comTagTbl, _ := gtk.TextTagTableNew()
|
||||||
comBuf, _ := gtk.TextBufferNew(comTagTbl)
|
comBuf, _ := gtk.TextBufferNew(comTagTbl)
|
||||||
ntbk, _ := gtk.NotebookNew()
|
ntbk, _ := gtk.NotebookNew()
|
||||||
@@ -20,8 +28,8 @@ func settingsUI() {
|
|||||||
gnrl.SetMarginTop(10)
|
gnrl.SetMarginTop(10)
|
||||||
gnrl.SetMarginBottom(10)
|
gnrl.SetMarginBottom(10)
|
||||||
dlWine, _ := gtk.ButtonNewWithLabel("Download Wine")
|
dlWine, _ := gtk.ButtonNewWithLabel("Download Wine")
|
||||||
|
wineCheck, _ := gtk.CheckButtonNewWithLabel("Show Windows apps (Wine)")
|
||||||
wineLbl, _ := gtk.LabelNew("PortableApps/LinuxPACom/Wine present")
|
wineLbl, _ := gtk.LabelNew("PortableApps/LinuxPACom/Wine present")
|
||||||
gnrl.Add(wineLbl)
|
|
||||||
dlWine.Connect("clicked", func() {
|
dlWine.Connect("clicked", func() {
|
||||||
cb := make(chan bool)
|
cb := make(chan bool)
|
||||||
downloadWine(win, cb)
|
downloadWine(win, cb)
|
||||||
@@ -31,13 +39,56 @@ func settingsUI() {
|
|||||||
setupTxt(comBuf)
|
setupTxt(comBuf)
|
||||||
wineLbl.Show()
|
wineLbl.Show()
|
||||||
}
|
}
|
||||||
|
if _, err := os.Open("PortableApps/LinuxPACom/Wine"); os.IsNotExist(err) {
|
||||||
|
if _, errd := exec.LookPath("wine"); errd == nil {
|
||||||
|
wineAvail = true
|
||||||
|
}
|
||||||
|
} else if err == nil {
|
||||||
|
wineAvail = true
|
||||||
|
}
|
||||||
|
glib.IdleAdd(func() {
|
||||||
|
if !wineAvail {
|
||||||
|
wineCheck.SetSensitive(false)
|
||||||
|
wineCheck.SetTooltipText("Download wine to run windows apps")
|
||||||
|
} else {
|
||||||
|
wineCheck.SetSensitive(true)
|
||||||
|
wineCheck.SetTooltipText("")
|
||||||
|
}
|
||||||
|
})
|
||||||
}()
|
}()
|
||||||
})
|
})
|
||||||
if !comEnbld {
|
if !comEnbld {
|
||||||
dlWine.SetSensitive(false)
|
dlWine.SetSensitive(false)
|
||||||
dlWine.SetTooltipText("common.sh needed")
|
dlWine.SetTooltipText("common.sh needed")
|
||||||
}
|
}
|
||||||
|
pthdCheck, _ := gtk.CheckButtonNewWithLabel("Hide \"Portable\" from app name")
|
||||||
|
pthdCheck.Connect("toggled", func() {
|
||||||
|
portableHide = pthdCheck.GetActive()
|
||||||
|
master = make(map[string][]app)
|
||||||
|
linmaster = make(map[string][]app)
|
||||||
|
cats = make([]string, 0)
|
||||||
|
lin = make([]string, 0)
|
||||||
|
setup()
|
||||||
|
})
|
||||||
|
pthdCheck.SetActive(portableHide)
|
||||||
|
if !wineAvail {
|
||||||
|
wineCheck.SetSensitive(false)
|
||||||
|
wineCheck.SetTooltipText("Download wine to run windows apps")
|
||||||
|
}
|
||||||
|
wineCheck.SetActive(wine)
|
||||||
|
wineCheck.Connect("toggled", func() {
|
||||||
|
wine = wineCheck.GetActive()
|
||||||
|
})
|
||||||
|
versCheck, _ := gtk.CheckButtonNewWithLabel("Only show newest app version in downloads (A bit iffy ATM)")
|
||||||
|
versCheck.SetActive(versionNewest)
|
||||||
|
versCheck.Connect("toggled", func() {
|
||||||
|
versionNewest = versCheck.GetActive()
|
||||||
|
})
|
||||||
|
gnrl.Add(wineLbl)
|
||||||
gnrl.Add(dlWine)
|
gnrl.Add(dlWine)
|
||||||
|
gnrl.Add(pthdCheck)
|
||||||
|
gnrl.Add(wineCheck)
|
||||||
|
gnrl.Add(versCheck)
|
||||||
ntbk.AppendPage(gnrl, getLabel("General"))
|
ntbk.AppendPage(gnrl, getLabel("General"))
|
||||||
com, _ := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 5)
|
com, _ := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 5)
|
||||||
com.SetMarginStart(10)
|
com.SetMarginStart(10)
|
||||||
@@ -51,7 +102,6 @@ func settingsUI() {
|
|||||||
hScroll, _ := gtk.AdjustmentNew(0, 0, 0, 0, 0, 0)
|
hScroll, _ := gtk.AdjustmentNew(0, 0, 0, 0, 0, 0)
|
||||||
comScrl, _ := gtk.ScrolledWindowNew(hScroll, vScroll)
|
comScrl, _ := gtk.ScrolledWindowNew(hScroll, vScroll)
|
||||||
comScrl.Add(comEdit)
|
comScrl.Add(comEdit)
|
||||||
com.Add(comScrl)
|
|
||||||
svBox, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 5)
|
svBox, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 5)
|
||||||
sv, _ := gtk.ButtonNewWithLabel("Save")
|
sv, _ := gtk.ButtonNewWithLabel("Save")
|
||||||
sv.Connect("clicked", func() {
|
sv.Connect("clicked", func() {
|
||||||
@@ -65,6 +115,7 @@ func settingsUI() {
|
|||||||
})
|
})
|
||||||
svBox.Add(sv)
|
svBox.Add(sv)
|
||||||
svBox.Add(cnl)
|
svBox.Add(cnl)
|
||||||
|
com.Add(comScrl)
|
||||||
com.Add(svBox)
|
com.Add(svBox)
|
||||||
ntbk.AppendPage(com, getLabel("common.sh"))
|
ntbk.AppendPage(com, getLabel("common.sh"))
|
||||||
win.Add(ntbk)
|
win.Add(ntbk)
|
||||||
|
|||||||
@@ -82,6 +82,9 @@ func processApp(fold string) (out app) {
|
|||||||
if out.cat == "" {
|
if out.cat == "" {
|
||||||
out.cat = "Other"
|
out.cat = "Other"
|
||||||
}
|
}
|
||||||
|
if portableHide {
|
||||||
|
out.name = strings.TrimSuffix(out.name, "Portable")
|
||||||
|
}
|
||||||
out.icon = getIcon(fold)
|
out.icon = getIcon(fold)
|
||||||
folder, _ := os.Open(fold)
|
folder, _ := os.Open(fold)
|
||||||
fis, _ := folder.Readdirnames(-1)
|
fis, _ := folder.Readdirnames(-1)
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ func ui(win *gtk.Window) {
|
|||||||
header.SetTitle("LinuxPA")
|
header.SetTitle("LinuxPA")
|
||||||
header.SetSubtitle("PortableApps.com type launcher")
|
header.SetSubtitle("PortableApps.com type launcher")
|
||||||
settings, _ := gtk.ButtonNewFromIconName("applications-system", gtk.ICON_SIZE_SMALL_TOOLBAR)
|
settings, _ := gtk.ButtonNewFromIconName("applications-system", gtk.ICON_SIZE_SMALL_TOOLBAR)
|
||||||
settings.Connect("clicked", func() {
|
|
||||||
settingsUI()
|
|
||||||
})
|
|
||||||
settings.SetTooltipText("Settings")
|
settings.SetTooltipText("Settings")
|
||||||
dnl, _ := gtk.ButtonNewFromIconName("emblem-downloads", gtk.ICON_SIZE_SMALL_TOOLBAR)
|
dnl, _ := gtk.ButtonNewFromIconName("emblem-downloads", gtk.ICON_SIZE_SMALL_TOOLBAR)
|
||||||
dnl.SetTooltipText("Download Apps")
|
dnl.SetTooltipText("Download Apps")
|
||||||
@@ -57,24 +54,6 @@ func ui(win *gtk.Window) {
|
|||||||
botBox.SetMarginEnd(10)
|
botBox.SetMarginEnd(10)
|
||||||
botBox.SetMarginTop(10)
|
botBox.SetMarginTop(10)
|
||||||
botBox.SetMarginBottom(10)
|
botBox.SetMarginBottom(10)
|
||||||
wineCheck, _ := gtk.CheckButtonNewWithLabel("Show Windows apps (Wine)")
|
|
||||||
if !wineAvail {
|
|
||||||
wineCheck.SetSensitive(false)
|
|
||||||
wineCheck.SetTooltipText("Download wine to run windows apps")
|
|
||||||
}
|
|
||||||
wineCheck.SetActive(wine)
|
|
||||||
wineCheck.Connect("toggled", func() {
|
|
||||||
wine = wineCheck.GetActive()
|
|
||||||
store.Clear()
|
|
||||||
for i := range ls {
|
|
||||||
catList.Remove(catList.GetRowAtIndex(len(ls) - i - 1))
|
|
||||||
}
|
|
||||||
ls = getCatRows()
|
|
||||||
for _, v := range ls {
|
|
||||||
catList.Add(v)
|
|
||||||
}
|
|
||||||
catList.ShowAll()
|
|
||||||
})
|
|
||||||
edit, _ := gtk.ButtonNewWithLabel("Edit App..")
|
edit, _ := gtk.ButtonNewWithLabel("Edit App..")
|
||||||
edit.Connect("clicked", func() {
|
edit.Connect("clicked", func() {
|
||||||
selec, _ := appsList.GetSelection()
|
selec, _ := appsList.GetSelection()
|
||||||
@@ -111,7 +90,6 @@ func ui(win *gtk.Window) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
botBox.Add(wineCheck)
|
|
||||||
botBox.PackEnd(edit, false, false, 0)
|
botBox.PackEnd(edit, false, false, 0)
|
||||||
topLvl.Add(lrBox)
|
topLvl.Add(lrBox)
|
||||||
topLvl.PackEnd(botBox, false, true, 0)
|
topLvl.PackEnd(botBox, false, true, 0)
|
||||||
@@ -162,7 +140,7 @@ func ui(win *gtk.Window) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
dnl.Connect("clicked", func() {
|
dnl.Connect("clicked", func() {
|
||||||
appimg.ShowUI(func() {
|
appimg.ShowUI(versionNewest, func() {
|
||||||
master = make(map[string][]app)
|
master = make(map[string][]app)
|
||||||
linmaster = make(map[string][]app)
|
linmaster = make(map[string][]app)
|
||||||
cats = make([]string, 0)
|
cats = make([]string, 0)
|
||||||
@@ -179,6 +157,19 @@ func ui(win *gtk.Window) {
|
|||||||
catList.ShowAll()
|
catList.ShowAll()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
settings.Connect("clicked", func() {
|
||||||
|
settingsUI(win, func() {
|
||||||
|
store.Clear()
|
||||||
|
for i := range ls {
|
||||||
|
catList.Remove(catList.GetRowAtIndex(len(ls) - i - 1))
|
||||||
|
}
|
||||||
|
ls = getCatRows()
|
||||||
|
for i, v := range ls {
|
||||||
|
catList.Insert(v, i)
|
||||||
|
}
|
||||||
|
catList.ShowAll()
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func getCatRows() (out []*gtk.Label) {
|
func getCatRows() (out []*gtk.Label) {
|
||||||
|
|||||||
Reference in New Issue
Block a user