Compare commits
3 Commits
launcher
...
93d2163ce9
| Author | SHA1 | Date | |
|---|---|---|---|
|
93d2163ce9
|
|||
|
1634321bd2
|
|||
|
0bffb6ad35
|
1
configs/box
Normal file
1
configs/box
Normal file
@@ -0,0 +1 @@
|
||||
{"extends": "shell", "mountcwd": true}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"mount": [],
|
||||
"romount": ["/etc", "/var", "/usr", "/opt", ".oh-my-zsh", ".zsh", ".zshrc"],
|
||||
"romount": ["/etc", "/var", "/usr", "/opt"],
|
||||
"symlinks": [
|
||||
{"src": "usr/lib", "dst": "/lib"},
|
||||
{"src": "usr/lib64", "dst": "/lib64"},
|
||||
1
configs/dev
Normal file
1
configs/dev
Normal file
@@ -0,0 +1 @@
|
||||
{"extends": "shell", "romount": [".gitconfig", ".gnupg", "/run/user/1000/gnupg", ".ssh/config"], "mountcwd": true, "mount": [".ssh/known_hosts"]}
|
||||
1
configs/gui
Normal file
1
configs/gui
Normal file
@@ -0,0 +1 @@
|
||||
{"extends": "default", "romount": [".Xauthority", "/tmp/.X11-unix", "/run/user/1000/pulse/native"], "dbus": true, "dbuscall": ["org.freedesktop.Notifications.*=@/org/freedesktop/Notifications", "org.freedesktop.portal.*=*"], "dbusbroadcast": ["org.freedesktop.portal.*=@/org/freedesktop/portal/*"]}
|
||||
1
configs/shell
Normal file
1
configs/shell
Normal file
@@ -0,0 +1 @@
|
||||
{"extends": "default", "romount": [".oh-my-zsh", ".zsh", ".zshrc", ".zshrc-local"], "sethostname": true}
|
||||
@@ -38,4 +38,7 @@ proc parseArgs*(): Option[Args] =
|
||||
if command.len > 0:
|
||||
args.cmd = some(command)
|
||||
|
||||
return some(args)
|
||||
if args.name.isSome or args.cmd.isSome or args.profile.isSome:
|
||||
return some(args)
|
||||
else:
|
||||
return none(Args)
|
||||
|
||||
@@ -15,9 +15,19 @@ proc checkRelativePath*(p: string): string =
|
||||
getHomeDir().joinPath(p)
|
||||
|
||||
proc getProfilePath*(profile: string): string =
|
||||
getConfigDir()
|
||||
.joinPath(APP_NAME)
|
||||
.joinPath(profile)
|
||||
let pid = getCurrentProcessId()
|
||||
|
||||
for path in [
|
||||
getConfigDir().joinPath(APP_NAME),
|
||||
&"/usr/share/{APP_NAME}",
|
||||
parentDir(expandSymlink(&"/proc/{pid}/exe")).joinPath("configs")
|
||||
]:
|
||||
let file = path.joinPath(profile)
|
||||
|
||||
if fileExists(file):
|
||||
return file
|
||||
|
||||
raise newException(IOError, "Profile not found")
|
||||
|
||||
proc getProfilePath*(args: Args): string =
|
||||
getProfilePath(args.getProfile())
|
||||
|
||||
Reference in New Issue
Block a user