-
Notifications
You must be signed in to change notification settings - Fork 0
/
autorun.sh
executable file
·67 lines (51 loc) · 1.37 KB
/
autorun.sh
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
# Startup: sh -e -c "exec \"$(cat ~/.dotfilesrc)/autorun.sh\""
# More details about specific approaches to checking VM: https://unix.stackexchange.com/q/89714
# sudo virt-what # Unknown output
# sudo dmesg | grep -i hypervisor # Contains idk
# sudo dmidecode -t system|grep 'Product\ Name' # Contains VirtualBox
is_vm() {
grep -q "^flags.*\ hypervisor" /proc/cpuinfo
}
launch() {
setsid $@ >/dev/null 2>&1 < /dev/null &
}
bpgrep() {
ps -eo pid,args | grep "$@" | grep -v "^\s*[0-9]*\s*grep"
}
first-available() {
for CHOICE in "$@" ; do
if [[ $(command -v $CHOICE) != "" ]] ; then
echo $CHOICE; exit
fi
done
echo "ERROR_NONE_FOUND"
}
run() {
# bpgrep $1
if [[ "$(bpgrep $1)" == "" ]] ; then
echo "Launching: '$@'"
launch $@
else
echo "Already running: '$1' ('$@')"
fi
}
run-first() {
run $(first-available $@)
}
# run compton --unredir-if-possible --backend glx --vsync opengl-swc
# Might need: --xrender-sync and --xrender-sync-fence
run sxhkd
run dropbox start -i
run flameshot
run-first redshift-scheduler redshift-gtk
run volti
run /home/asmageddon/.local/bin/pytka
run conky
run xfce4-clipman
run pomodorino
if [[ $(is_vm) != "" && $(command -v VBoxClient-all != "") ]]; then
notify-send "Launching VBoxClient-all"
run VBoxClient-all
fi
notify-send "Autorun successfully executed"