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 /home/benjamin/paperbenni/monitor.sh ] &&
37 bash /home/benjamin/paperbenni/monitor.sh &
39 # chrome os wallpaper changer
40 [ -e "$HOME/instantos/wallpapers/wall.sh" ] &&
41 bash "$HOME/instantos/wallpapers/wall.sh" &
43 # apply german keybpard layout
44 if locale | grep -q 'de_DE'; then
48 # laptop specific background jobs
49 if [ -n "$ISLAPTOP" ]; then
50 command -v libinput-gestures \
60 command -v conky &>/dev/null && conky &
68 # fix small graphical glitch on status bar startup
75 if [ -e ~/.instantsilent ]; then
80 # run every 60 seconds
81 if [ "$REPETITIONS" = "xxxxxx" ]; then
83 if ping -q -c 1 -W 1 8.8.8.8; then
86 INTERNET="^c#ff0000^X^d^"
89 # battery indicator on laptop
90 if [ -n "$ISLAPTOP" ]; then
92 if [[ $TMPBAT =~ "Charging" ]]; then
93 BATTERY="^c#00ff00^B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")"^d^"
95 BATTERY="B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")
96 # make indicator red on low battery
97 if [ $(grep '[0-9]*' <<<$BATTERY) -lt 10 ]; then
98 BATTERY="^c#ff0000^$BATTERY^d^"
105 REPETITIONS="$REPETITIONS"x
108 addstatus "$(date +'%d-%m|%H:%M')"
109 addstatus "A$(amixer get Master | egrep -o '[0-9]{1,3}%' | head -1)"
110 [ -n "$ISLAPTOP" ] && addstatus "$BATTERY"
111 addstatus "$INTERNET"
113 xsetroot -name "$date"