Browse Source

Add dwm_alarm

main
joestandring 4 years ago
parent
commit
40c19d5dfc
3 changed files with 34 additions and 1 deletions
  1. +7
    -0
      README.md
  2. +25
    -0
      bar-functions/dwm_alarm.sh
  3. +2
    -1
      dwm_bar.sh

+ 7
- 0
README.md View File

@ -7,6 +7,7 @@ A modular statusbar for DWM
- [dwm_pulse](#dwm_pulse)
- [dwm_battery](#dwm_battery)
- [dwm_countdown](#dwm_countdown)
- [dwm_alarm](#dwm_alarm)
- [dwm_keyboard](#dwm_keyboard)
- [dwm_resources](#dwm_resources)
- [dwm_cmus](#dwm_cmus)
@ -47,6 +48,12 @@ Displays the status of [countdown](https://github.com/joestandring/countdown)
[⏳ 00:10:00]
```
Dependencies: ```countdown.sh```
### dwm_alarm
Displays upcoming alarms from [alarm](https://github.com/joestandring/alarm)
```
[⏰ 22:30:00]
```
Dependencies: ```alarm.sh```
### dwm_keyboard
Displays the current keyboard layout
```


+ 25
- 0
bar-functions/dwm_alarm.sh View File

@ -0,0 +1,25 @@
#!/bin/sh
# A dwm_status function that displays upcoming alarms from alarm.sh
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Dependencies: https://github.com/joestandring/alarm
dwm_alarm () {
for f in /tmp/alarm.*; do
if [ -e "$f" ]; then
printf "%s" "$SEP1"
if [ "$IDENTIFIER" = "unicode" ]; then
printf "⏰ %s" "$(cat /tmp/alarm.*)"
else
printf "ALM %s" "$(cat /tmp/alarm.*)"
fi
printf "%s\n" "$SEP2"
break
fi
done
}
dwm_alarm

+ 2
- 1
dwm_bar.sh View File

@ -23,6 +23,7 @@ export SEP2="]"
# Import the modules
. "$DIR/bar-functions/dwm_countdown.sh"
. "$DIR/bar-functions/dwm_alarm.sh"
. "$DIR/bar-functions/dwm_transmission.sh"
. "$DIR/bar-functions/dwm_cmus.sh"
. "$DIR/bar-functions/dwm_resources.sh"
@ -41,6 +42,6 @@ export SEP2="]"
# Update dwm status bar every second
while true
do
xsetroot -name "$(dwm_countdown)$(dwm_transmission)$(dwm_cmus)$(dwm_resources)$(dwm_battery)$(dwm_mail)$(dwm_backlight)$(dwm_alsa)$(dwm_pulse)$(dwm_weather)$(dwm_vpn)$(dwm_network)$(dwm_keyboard)$(dwm_date)"
xsetroot -name "$(dwm_countdown)$(dwm_alarm.sh)$(dwm_transmission)$(dwm_cmus)$(dwm_resources)$(dwm_battery)$(dwm_mail)$(dwm_backlight)$(dwm_alsa)$(dwm_pulse)$(dwm_weather)$(dwm_vpn)$(dwm_network)$(dwm_keyboard)$(dwm_date)"
sleep 1
done

Loading…
Cancel
Save