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 deadd &>/dev/null; then
29 if ! pgrep deadd; then
37 # chrome os wallpaper changer
38 [ -e /home/benjamin/paperbenni/menus/dm/wg.sh ] &&
39 bash /home/benjamin/paperbenni/menus/dm/wg.sh
41 [ -e /home/benjamin/paperbenni/monitor.sh ] &&
42 bash /home/benjamin/paperbenni/monitor.sh
44 # apply german keybpard layout
45 if locale | grep -q 'de_DE'; then
49 # laptop specific background jobs
50 if [ -n "$ISLAPTOP" ]; then
51 command -v libinput-gestures \
61 command -v conky &>/dev/null && conky &
71 if [ -e ~/.dwmsilent ]; then
76 # run every 60 seconds
77 if [ "$REPETITIONS" = "xxxxxx" ]; then
79 if ping -q -c 1 -W 1 8.8.8.8; then
82 INTERNET="^c#ff0000^X^d^"
85 # battery indicator on laptop
86 if [ -n "$ISLAPTOP" ]; then
88 if [[ $TMPBAT =~ "Charging" ]]; then
89 BATTERY="^c#00ff00^B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")"^d^"
91 BATTERY="B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")
92 # make indicator red on low battery
93 if [ $(grep '[0-9]*' <<<$BATTERY) -lt 10 ]; then
94 BATTERY="^c#ff0000^$BATTERY^d^"
101 REPETITIONS="$REPETITIONS"x
104 addstatus "$(date +'%d-%m|%H:%M')"
105 addstatus "A$(amixer get Master | egrep -o '[0-9]{1,3}%' | head -1)"
106 [ -n "$ISLAPTOP" ] && addstatus "$BATTERY"
107 addstatus "$INTERNET"
109 xsetroot -name "$date"