diff --git a/.bashrc b/.bashrc index e31f8be..78114ab 100755 --- a/.bashrc +++ b/.bashrc @@ -127,7 +127,7 @@ alias mountedinfo='df -hT' # Alias's for archives alias mktar='tar -cvf' alias mkbz2='tar -cvjf' -alias mkgz='tar -cvzf' +alias mgz='tar -cvzf' alias untar='tar -xvf' alias unbz2='tar -xvjf' alias ungz='tar -xvzf' @@ -141,6 +141,8 @@ alias tbr='trans :pt-BR' # ncmpcpp alias ncmpcpp='ncmpcpp -b ~/.config/ncmpcpp/bindings' +alias t='todo' + ####################################################### # WORK diff --git a/.local/bin/battery_alert.sh b/.local/bin/battery_alert.sh new file mode 100755 index 0000000..951d6a2 --- /dev/null +++ b/.local/bin/battery_alert.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +BAT_PATH="/sys/class/power_supply/BAT0" +CAPACITY=$(cat "$BAT_PATH/capacity") +STATUS=$(cat "$BAT_PATH/status") + +notify() { + dunstify -u critical -r 999 "⚡ Battery low: $1%" "Plug in your charger NOW!" +} + +if [ "$STATUS" != "Charging" ]; then + if [ "$CAPACITY" -le 5 ]; then + notify 5 + elif [ "$CAPACITY" -le 10 ]; then + notify 10 + elif [ "$CAPACITY" -le 20 ]; then + notify 20 + elif [ "$CAPACITY" -le 30 ]; then + notify 30 + fi +fi +