3 ####################################################
4 ## script for instantOS autostart ##
5 ####################################################
7 bashes=$(pgrep bash | wc -l)
8 if [ "$bashes" -gt 2 ]; then
13 # fix small graphical glitch on status bar startup
18 if acpi | grep -q '%' &>/dev/null; then
19 export ISLAPTOP="true"
20 echo "laptop detected"
25 if command -v picom &>/dev/null; then
33 mkdir -p /tmp/notifications &>/dev/null
34 if ! pgrep dunst; then
43 if ! grep -q '....' ~/instantos/monitor/max.txt; then
44 bash /opt/instantos/scripts/monitor.sh
47 [ -e ~/instantos/monitor.sh ] &&
48 bash ~/instantos/monitor.sh &
50 if ping google.com -c 2; then
53 instantwallpaper offline
54 for i in $(seq 10); do
55 if ping google.com -c 2; then
64 # apply german keybpard layout
65 if locale | grep -q 'de_DE'; then
69 # laptop specific background jobs
70 if [ -n "$ISLAPTOP" ]; then
71 command -v libinput-gestures \
81 command -v conky &>/dev/null && conky &
91 if [ -e ~/.instantsilent ]; then
96 # run every 60 seconds
97 if [ "$REPETITIONS" = "xxxxxx" ]; then
99 if ping -q -c 1 -W 1 8.8.8.8; then
102 INTERNET="^c#ff0000^X^d^"
105 # battery indicator on laptop
106 if [ -n "$ISLAPTOP" ]; then
108 if [[ $TMPBAT =~ "Charging" ]]; then
109 BATTERY="^c#00ff00^B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")"^d^"
111 BATTERY="B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")
112 # make indicator red on low battery
113 if [ $(grep '[0-9]*' <<<$BATTERY) -lt 10 ]; then
114 BATTERY="^c#ff0000^$BATTERY^d^"
121 REPETITIONS="$REPETITIONS"x
124 addstatus "$(date +'%d-%m|%H:%M')"
125 addstatus "A$(amixer get Master | egrep -o '[0-9]{1,3}%' | head -1)"
126 [ -n "$ISLAPTOP" ] && addstatus "$BATTERY"
127 addstatus "$INTERNET"
129 xsetroot -name "^f11^$date"