-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsicht
More file actions
executable file
·44 lines (40 loc) · 847 Bytes
/
sicht
File metadata and controls
executable file
·44 lines (40 loc) · 847 Bytes
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
#!/bin/bash
# kill fricking ubersicht with its damn name
# KilL
_kill() {
printf "Killing app (takes a few seconds) ...\n"
osascript -e 'tell application "Übersicht" to quit'
}
_open() {
printf "Starting app (takes a few seconds) ...\n"
open -a /Applications/Übersicht.app
}
_toggle() {
proc=$(ps aux|grep "Übersicht"|wc -l)
if [[ $proc -gt 1 ]]; then
_kill
else
_open
fi
}
if [[ -n "$1" ]]; then
case "$1" in
-k|--kill)
_kill
;;
-r|--refresh)
osascript -e 'tell application "Übersicht" to refresh'
;;
-t|--toggle)
_toggle
;;
*)
printf "incorrect usage: -r|-k|-t"
;;
esac
else
# default usage: kill, wait, reopen
_kill
sleep 2
_open
fi