From 2b3c59fdf238420121bd0debcfed0cefbb71553a Mon Sep 17 00:00:00 2001 From: Nulo Date: Wed, 22 Dec 2021 18:33:08 -0300 Subject: [PATCH] =?UTF-8?q?Script=20que=20manda=20una=20notificaci=C3=B3n?= =?UTF-8?q?=20sobre=20el=20sistema?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/river/keys | 2 ++ .local/bin/notificar-informacion.sh | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100755 .local/bin/notificar-informacion.sh diff --git a/.config/river/keys b/.config/river/keys index 57439c2..0128e19 100755 --- a/.config/river/keys +++ b/.config/river/keys @@ -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 X spawn 'notificar-informacion.sh' + for mode in normal locked do # https://github.com/cdemoulins/pamixer diff --git a/.local/bin/notificar-informacion.sh b/.local/bin/notificar-informacion.sh new file mode 100755 index 0000000..ff4b736 --- /dev/null +++ b/.local/bin/notificar-informacion.sh @@ -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"