-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathdirzsh.zsh
50 lines (48 loc) · 1.42 KB
/
dirzsh.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$ID:load() {
lib:path-alloc2 "PATHALLOC_$ID" ./scripts :
alias execute="ID=$ID $ID:execute"
alias lg="ID=$ID $ID:lg"
alias dbus-docker="ID=$ID $ID:dbus-docker"
alias notify="ID=$ID $ID:notify"
alias notify-test="ID=$ID $ID:notify-test"
alias prefs="ID=$ID $ID:prefs"
}
$ID:unload() {
lib:path-free "PATHALLOC_$ID"
unalias execute
unalias lg
unalias dbus-docker
unalias notify
unalias notify-test
unalias prefs
}
$ID:execute() {
if [ -e ./host/vncready ]; then
sudo docker compose exec -u gnome gnome-docker env DISPLAY=":0" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval "$1"
else
gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval "$1"
fi
}
$ID:dbus-docker() {
sudo docker compose exec -u gnome gnome-docker env DISPLAY=":0" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus $@
}
$ID:lg() {
$ID:execute "Main.createLookingGlass().toggle()"
}
$ID:notify() {
if [ -e ./host/vncready ]; then
$ID:dbus-docker notify-send $@
else
notify-send $@
fi
}
$ID:notify-test() {
$ID:notify test testmessage -u normal -t 0
}
$ID:prefs() {
if [ -e ./host/vncready ]; then
$ID:dbus-docker gnome-extensions prefs quick-settings-tweaks@qwreey
else
gnome-extensions prefs quick-settings-tweaks@qwreey
fi
}