Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f160e6d311 | |||
| 6d946a123f | |||
| c758d57f2a |
@@ -6,7 +6,7 @@ Works well with AppImage apps.
|
||||
I know that Linux only has about 2% desktop usage and I know that the traditional way to install apps isn't portable, but over the past year or so I've started to put linux apps on my flash drive (AppImage is a great example of a portable solution to linux apps. Also a lot of DRM-free games can be run portably), but there was no easy way to organize my linux apps, so I created one. I personally have used the PortableApps.com launcher for years now and I love how properly formated the apps are, which allows me to grab info about the app easily.
|
||||
|
||||
# Why script files?
|
||||
In general linux executable files have no extensions and can be a pain when trying to figure out what is executable and what isn't. I figured script files are easy to detect and allow a large amount of flexibility for me (and others who want to make apps work with this launcher).
|
||||
In general linux executable files have no extensions and can be a pain when trying to figure out what is executable and what isn't. I figured script files are easy to detect and allow a large amount of flexibility for me (and others who want to make apps work with this launcher). See below for .AppImage support (Get AppImages from [here](https://bintray.com/probono/AppImages))
|
||||
|
||||
# Why Go?
|
||||
Because I like Go :) Also the way it includes all it needs into one friendly executable.
|
||||
@@ -17,9 +17,17 @@ Basically you need go to compile the source, AND YOU ALSO NEED TO MOUNT YOUR FLA
|
||||
# Format
|
||||
The first place the program looks for an app's icon and info is in the /App/AppInfo directory (icon defaults to appicon_32.png, otherwise it just picks the last one it finds), but if it can't find the appinfo.ini or app icon, it looks in the apps root directory for appinfo.ini and appicon.png for info and icon respectively(Just to make it easier for custom settings in an app).
|
||||
|
||||
# TODO
|
||||
Add in a common.sh that is executed with each script. (Allows for setting environment variables such as HOME)
|
||||
MAKE IT BETTER
|
||||
Add an open button (I know, I just wanted to get the initial working before making it user friendly)
|
||||
Check if all apps are closed when it closes and ask if you want to force stop the apps.
|
||||
(Maybe)Create an installer.
|
||||
# common.sh
|
||||
common.sh is run before any program so you can set environment variables (such as HOME). common.sh should be in PortableApps/LinuxPACom folder.
|
||||
|
||||
# AppImage support
|
||||
It will now launch .AppImage files! If a .sh script and an .AppImage executable are both in a directory, the .sh script takes precedence. You can get AppImages from [here](https://bintray.com/probono/AppImages).
|
||||
|
||||
# TODO (Might be in order)
|
||||
1. MAKE IT BETTER
|
||||
1. Improve linux executable detection (A.K.A. a pain in the butt)
|
||||
1. Launching of .exe files via wine (wine will have to be installed on the host system, unless there is some portable wine, I may have found one)
|
||||
1. Add settings menu
|
||||
1. Add updater for .AppImage files
|
||||
1. Download .AppImage files (maybe)
|
||||
1. Check if all apps are closed when it closes and ask if you want to force stop the apps.
|
||||
|
||||
@@ -13,17 +13,28 @@ import (
|
||||
var (
|
||||
appMaster map[string][]prtap
|
||||
cats []string
|
||||
conf *os.File
|
||||
common string
|
||||
commEnbl bool
|
||||
)
|
||||
|
||||
type prtap struct {
|
||||
name string
|
||||
cat string
|
||||
ex string
|
||||
desc string
|
||||
}
|
||||
|
||||
func main() {
|
||||
commEnbl = true
|
||||
appMaster = make(map[string][]prtap)
|
||||
os.Mkdir("PortableApps", 0777)
|
||||
os.Mkdir("PortableApps/LinuxPACom", 0777)
|
||||
common = "PortableApps/LinuxPACom/common.sh"
|
||||
_, err := os.Open(common)
|
||||
if os.IsNotExist(err) {
|
||||
commEnbl = false
|
||||
}
|
||||
pa, err := os.Open("PortableApps")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -31,7 +42,7 @@ func main() {
|
||||
appstmp, _ := pa.Readdir(-1)
|
||||
var folds []string
|
||||
for _, v := range appstmp {
|
||||
if v.IsDir() {
|
||||
if v.IsDir() && v.Name() != "LinuxPACom" {
|
||||
folds = append(folds, v.Name())
|
||||
}
|
||||
}
|
||||
@@ -69,7 +80,14 @@ func processApp(fi *os.File) (out prtap) {
|
||||
out.cat = "other"
|
||||
}
|
||||
for _, v := range fis {
|
||||
if !v.IsDir() && strings.HasSuffix(v.Name(), ".sh") {
|
||||
if !v.IsDir() && strings.HasSuffix(strings.ToLower(v.Name()), ".sh") {
|
||||
//do os check here for possible cross platform support
|
||||
out.ex = fi.Name() + "/" + v.Name()
|
||||
return
|
||||
}
|
||||
}
|
||||
for _, v := range fis {
|
||||
if !v.IsDir() && strings.HasSuffix(strings.ToLower(v.Name()), ".appimage") {
|
||||
//do os check here for possible cross platform support
|
||||
out.ex = fi.Name() + "/" + v.Name()
|
||||
return
|
||||
|
||||
@@ -43,7 +43,12 @@ func uiMain(dri gxui.Driver) {
|
||||
if appAdap.ItemIndex(applist.Selected()) != -1 {
|
||||
app := applist.Selected().(prtap)
|
||||
dir, fi := path.Split(app.ex)
|
||||
cmd := exec.Command("/bin/sh", "-c", "cd \""+dir+"\"; \"./"+fi+"\"")
|
||||
var cmd *exec.Cmd
|
||||
if commEnbl {
|
||||
cmd = exec.Command("/bin/sh", "-c", ". "+common+" || exit 1;cd \""+dir+"\"; \"./"+fi+"\"")
|
||||
} else {
|
||||
cmd = exec.Command("/bin/sh", "-c", "cd \""+dir+"\"; \"./"+fi+"\"")
|
||||
}
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Start()
|
||||
@@ -53,5 +58,7 @@ func uiMain(dri gxui.Driver) {
|
||||
top.AddChild(but)
|
||||
top.AddChild(spl)
|
||||
win.AddChild(top)
|
||||
win.OnClose(dr.Terminate)
|
||||
win.OnClose(func() {
|
||||
dr.Terminate()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user