3 ####################################################
4 ## script for instantOS autostart ##
5 ####################################################
7 bashes=$(pgrep bash | wc -l)
8 if [ "$bashes" -gt 2 ]; then
13 if acpi | grep -q '%' &>/dev/null; then
14 export ISLAPTOP="true"
15 echo "laptop detected"
20 if command -v picom &>/dev/null; then
28 mkdir -p /tmp/notifications &>/dev/null
29 if ! pgrep dunst; then
36 [ -e ~/instantos/monitor.sh ] &&
37 bash ~/instantos/monitor.sh &
40 [ -e "$HOME/instantos/wallpapers/wall.sh" ] && bash "$HOME/instantos/wallpapers/wall.sh"
43 if ping google.com -c 2; then
46 [ -e "$HOME/instantos/wallpapers/offlinewall.sh" ] && bash "$HOME/instantos/wallpapers/offlinewall.sh"
47 for i in $(seq 10); do
48 if ping google.com -c 2; then
57 # apply german keybpard layout
58 if locale | grep -q 'de_DE'; then
62 # laptop specific background jobs
63 if [ -n "$ISLAPTOP" ]; then
64 command -v libinput-gestures \
74 command -v conky &>/dev/null && conky &
82 # fix small graphical glitch on status bar startup
89 if [ -e ~/.instantsilent ]; then
94 # run every 60 seconds
95 if [ "$REPETITIONS" = "xxxxxx" ]; then
97 if ping -q -c 1 -W 1 8.8.8.8; then
100 INTERNET="^c#ff0000^X^d^"
103 # battery indicator on laptop
104 if [ -n "$ISLAPTOP" ]; then
106 if [[ $TMPBAT =~ "Charging" ]]; then
107 BATTERY="^c#00ff00^B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")"^d^"
109 BATTERY="B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")
110 # make indicator red on low battery
111 if [ $(grep '[0-9]*' <<<$BATTERY) -lt 10 ]; then
112 BATTERY="^c#ff0000^$BATTERY^d^"
119 REPETITIONS="$REPETITIONS"x
122 addstatus "$(date +'%d-%m|%H:%M')"
123 addstatus "A$(amixer get Master | egrep -o '[0-9]{1,3}%' | head -1)"
124 [ -n "$ISLAPTOP" ] && addstatus "$BATTERY"
125 addstatus "$INTERNET"
127 xsetroot -name "^f11^$date"