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 mkdir -p /tmp/notifications &>/dev/null
29 if ! pgrep dbus-monitor; then
31 dbus-monitor "interface='org.freedesktop.Notifications'" >/tmp/notifications/notif.txt
36 if ! pgrep dunst; then
43 [ -e /home/benjamin/paperbenni/monitor.sh ] &&
44 bash /home/benjamin/paperbenni/monitor.sh &
46 # chrome os wallpaper changer
47 [ -e /home/benjamin/paperbenni/menus/dm/wg.sh ] &&
48 bash /home/benjamin/paperbenni/menus/dm/wg.sh &
50 # apply german keybpard layout
51 if locale | grep -q 'de_DE'; then
55 # laptop specific background jobs
56 if [ -n "$ISLAPTOP" ]; then
57 command -v libinput-gestures \
67 command -v conky &>/dev/null && conky &
77 if [ -e ~/.dwmsilent ]; then
82 # run every 60 seconds
83 if [ "$REPETITIONS" = "xxxxxx" ]; then
85 if ping -q -c 1 -W 1 8.8.8.8; then
88 INTERNET="^c#ff0000^X^d^"
91 # battery indicator on laptop
92 if [ -n "$ISLAPTOP" ]; then
94 if [[ $TMPBAT =~ "Charging" ]]; then
95 BATTERY="^c#00ff00^B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")"^d^"
97 BATTERY="B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")
98 # make indicator red on low battery
99 if [ $(grep '[0-9]*' <<<$BATTERY) -lt 10 ]; then
100 BATTERY="^c#ff0000^$BATTERY^d^"
107 REPETITIONS="$REPETITIONS"x
110 addstatus "$(date +'%d-%m|%H:%M')"
111 addstatus "A$(amixer get Master | egrep -o '[0-9]{1,3}%' | head -1)"
112 [ -n "$ISLAPTOP" ] && addstatus "$BATTERY"
113 addstatus "$INTERNET"
115 xsetroot -name "$date"