Script que manda una notificación sobre el sistema

This commit is contained in:
Cat /dev/Nulo 2021-12-22 18:33:08 -03:00
parent fd4ba05318
commit 2b3c59fdf2
2 changed files with 13 additions and 0 deletions

View file

@ -91,6 +91,8 @@ riverctl map passthrough $mod F11 enter-mode normal
riverctl map normal $mod Z spawn 'pamixer --default-source --toggle-mute' riverctl map normal $mod Z spawn 'pamixer --default-source --toggle-mute'
riverctl map normal $mod X spawn 'notificar-informacion.sh'
for mode in normal locked for mode in normal locked
do do
# https://github.com/cdemoulins/pamixer # https://github.com/cdemoulins/pamixer

View file

@ -0,0 +1,11 @@
#!/bin/sh
battery="$(upower -i /org/freedesktop/UPower/devices/battery_BAT0)"
get_battery_value () {
echo "$battery" | grep "$1" | awk '{ print $2 }'
}
title="$(date +%T)"
body="\
$(date +"%A %d of %B")
$(get_battery_value percentage) $(get_battery_value state)\
"
notify-send --expire-time=5000 "$title" "$body"