|
- #!/bin/bash
- source ~/.profile
-
- # Setup statusbar and mail
- speaker_muted=🔇
- speaker_low=🔈
- speaker_medium=🔉
- speaker_high=🔊
- brightness_symbol=🔅
-
- # Check number of unread emails
- messages() {
- printf "$(find ~/Mail -path '*INBOX*' -not -name \
- '.uidvalidity' -type f | grep -vE ',[^,]*S[^,]*$'| wc -l)"
- }
-
- DELAY=10m
-
- while true; do
- mbsync -a
- sleep $DELAY
- done &
-
- while true; do
- volume=$(amixer sget Master | awk -F"[][]" 'END{ print $2 }')
- volume_amount=$(printf $volume | tr -d %)
- if [ $volume_amount = 0 ]; then
- volume_symbol=$speaker_muted
- elif [ $volume_amount -lt 30 ]; then
- volume_symbol=$speaker_low
- elif [ $volume_amount -lt 70 ]; then
- volume_symbol=$speaker_medium
- else
- volume_symbol=$speaker_high
- fi
-
- xsetroot -name "📧Messages $(messages) |
- $volume_symbol$volume | $(date +"%c")"
- sleep $DELAY
- done &
-
- setxkbmap -option ctrl:swapcaps -option tilde:swapescape
- picom -b
- ~/.fehbg
- xbindkeys -f $HOME/Source/configs/xbindkeysrc
-
- ( mru update; mru updatedirs ) &
-
- # Relaunch DWM if the binary changes, otherwise bail
- csum=$(sha1sum $(which dwm))
- new_csum=""
- while true
- do
- if [ "$csum" != "$new_csum" ]
- then
- csum=$new_csum
- dwm
- else
- exit 0
- fi
- new_csum=$(sha1sum $(which dwm))
- sleep 0.5
- done
|