diff --git a/README.md b/README.md index 7ba3de6..5ff1926 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ Plugin: - [i2p.plugins.tor-manager-linux-386](i2p.plugins.tor-manager-linux-386.su3) - [i2p.plugins.tor-manager-windows-amd64](i2p.plugins.tor-manager-windows-amd64.su3) - [i2p.plugins.tor-manager-darwin-arm64](i2p.plugins.tor-manager-darwin-arm64.su3) -- [i2p.plugins.tor-manager-linux-arm64](i2p.plugins.tor-manager-linux-arm64.su3) - [i2p.plugins.tor-manager-linux-amd64](i2p.plugins.tor-manager-linux-amd64.su3) - [i2p.plugins.tor-manager-windows-386](i2p.plugins.tor-manager-windows-386.su3) - [i2p.plugins.tor-manager-darwin-amd64](i2p.plugins.tor-manager-darwin-amd64.su3) diff --git a/index.html b/index.html index 60e00f7..5af553f 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,6 @@
  • i2p.plugins.tor-manager-linux-386
  • i2p.plugins.tor-manager-windows-amd64
  • i2p.plugins.tor-manager-darwin-arm64
  • -
  • i2p.plugins.tor-manager-linux-arm64
  • i2p.plugins.tor-manager-linux-amd64
  • i2p.plugins.tor-manager-windows-386
  • i2p.plugins.tor-manager-darwin-amd64
  • diff --git a/link_darwin.go b/link_darwin.go index a2e34ff..16b43db 100644 --- a/link_darwin.go +++ b/link_darwin.go @@ -1,9 +1,55 @@ package main +import ( + "i2pgit.org/idk/i2p.plugins.tor-manager/get" + "os" + "path/filepath" +) + func GenerateAppArmor() error { return nil } func CreateShortcuts() error { + if err := CreateShortcut("torbrowser"); err != nil { + return err + } + if err := CreateShortcut("i2pbrowser"); err != nil { + return err + } + if err := CreateShortcut("i2pconfig"); err != nil { + return err + } + return nil +} + +func CreateShortcut(linkname string) error { + // check if there is a symlink in the $HOME/Desktop Directory + // if not, create one + // if there is, check if it points to the correct location + // if not, delete it and create a new one + // if there is, do nothing + exe, err := os.Executable() + if err != nil { + return err + } + absolutepath, err := filepath.Abs(filepath.Join(filepath.Dir(exe), exe)) + if err != nil { + return err + } + home, err := os.UserHomeDir() + if err != nil { + return err + } + path := filepath.Join(home, "Desktop", linkname) + if tbget.FileExists(linkname) { + if originfile, err := os.Readlink(path); err != nil || originfile != absolutepath { + if err := os.Remove(path); err != nil { + return err + } + return os.Symlink(absolutepath, path) + } + } + return os.Symlink(absolutepath, path) return nil } diff --git a/main.go b/main.go index a665a3c..3c5ebe4 100644 --- a/main.go +++ b/main.go @@ -47,14 +47,16 @@ func OS() string { } func ARCH() string { - // if OS() == "osx" { - // return "" - // } switch runtime.GOARCH { case "386": return "32" case "amd64": return "64" + case "arm64": + if OS() == "osx" { + return "64" + } + return "" default: return "unknown" } @@ -109,7 +111,7 @@ func main() { } else if filename == "firefox" { log.Println("Starting Firefox") if *profile != "" { - *profile = filepath.Join(tbget.WORKING_DIR, "i2p.firefox") + *profile = filepath.Join(tbget.WORKING_DIR, "profile.firefox") } log.Println("Using profile", *profile) }