-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathqshellctl
More file actions
executable file
·39 lines (36 loc) · 1.45 KB
/
qshellctl
File metadata and controls
executable file
·39 lines (36 loc) · 1.45 KB
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
#!/bin/bash
bname=`basename "$0"`
fn="$1"
check_pidof() {
[[ ! $(pidof qshell) ]] && echo "$bname: Q::Shell isn't running" && exit 1
return 0
}
case "$fn" in
activateLauncherMenu)
check_pidof && qdbus org.qshell /org/qshell/qshell local.qshell.Q.Shell.activateLauncherMenu && exit $?
;;
reload)
check_pidof && qdbus org.qshell /org/qshell/qshell local.qshell.Q.Shell.reloadAll "$2" && exit $?
;;
showWidget) check_pidof && qdbus org.qshell /org/qshell/qshell local.qshell.Q.Shell.showWidget "$2" && exit $?
;;
hideWidget) check_pidof && qdbus org.qshell /org/qshell/qshell local.qshell.Q.Shell.hideWidget "$2" && exit $?
;;
toggleWidget) check_pidof && qdbus org.qshell /org/qshell/qshell local.qshell.Q.Shell.toggleWidget "$2" && exit $?
;;
*)
echo "Usage:"
echo " $bname fn [arg]"
echo
echo "Controls a currently running instance of Q::Shell."
echo
echo "Available commands:"
echo " activateLauncherMenu: activates dash menu"
echo " reload [file]: reloads with configuration from [file]"
echo " ~/.config/qshellrc will be used if [file] isn't specified"
echo " showWidget [widget]: shows widget with name [widget]"
echo " hideWidget [widget]: hides widget with name [widget]"
echo " toggleWidget [widget]: toggle visibility of widget with name [widget]"
exit 0
;;
esac