3 ####################################################
4 ## script for paperbenni-dwm autostart ##
5 ####################################################
7 bashes=$(pgrep bash | wc -l)
8 if [ "$bashes" -gt 2 ]; then
13 if acpi | grep -q '%'; then
14 export ISLAPTOP="true"
15 echo "laptop detected"
20 if command -v picom &>/dev/null; then
28 if command -v dunst &>/dev/null; then
29 mkdir -p /tmp/notifications &>/dev/null
30 if ! pgrep dunst; then
33 cat -v >/tmp/notifications/notif.txt
39 [ -e /home/benjamin/paperbenni/monitor.sh ] &&
40 bash /home/benjamin/paperbenni/monitor.sh &
42 # chrome os wallpaper changer
43 [ -e /home/benjamin/paperbenni/menus/dm/wg.sh ] &&
44 bash /home/benjamin/paperbenni/menus/dm/wg.sh &
46 # apply german keybpard layout
47 if locale | grep -q 'de_DE'; then
51 # laptop specific background jobs
52 if [ -n "$ISLAPTOP" ]; then
53 command -v libinput-gestures \
63 command -v conky &>/dev/null && conky &
73 if [ -e ~/.dwmsilent ]; then
78 # run every 60 seconds
79 if [ "$REPETITIONS" = "xxxxxx" ]; then
81 if ping -q -c 1 -W 1 8.8.8.8; then
84 INTERNET="^c#ff0000^X^d^"
87 # battery indicator on laptop
88 if [ -n "$ISLAPTOP" ]; then
90 if [[ $TMPBAT =~ "Charging" ]]; then
91 BATTERY="^c#00ff00^B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")"^d^"
93 BATTERY="B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")
94 # make indicator red on low battery
95 if [ $(grep '[0-9]*' <<<$BATTERY) -lt 10 ]; then
96 BATTERY="^c#ff0000^$BATTERY^d^"
103 REPETITIONS="$REPETITIONS"x
106 addstatus "$(date +'%d-%m|%H:%M')"
107 addstatus "A$(amixer get Master | egrep -o '[0-9]{1,3}%' | head -1)"
108 [ -n "$ISLAPTOP" ] && addstatus "$BATTERY"
109 addstatus "$INTERNET"
111 xsetroot -name "$date"