bashrc alias add pluys battery alert scrip
This commit is contained in:
4
.bashrc
4
.bashrc
@@ -127,7 +127,7 @@ alias mountedinfo='df -hT'
|
|||||||
# Alias's for archives
|
# Alias's for archives
|
||||||
alias mktar='tar -cvf'
|
alias mktar='tar -cvf'
|
||||||
alias mkbz2='tar -cvjf'
|
alias mkbz2='tar -cvjf'
|
||||||
alias mkgz='tar -cvzf'
|
alias mgz='tar -cvzf'
|
||||||
alias untar='tar -xvf'
|
alias untar='tar -xvf'
|
||||||
alias unbz2='tar -xvjf'
|
alias unbz2='tar -xvjf'
|
||||||
alias ungz='tar -xvzf'
|
alias ungz='tar -xvzf'
|
||||||
@@ -141,6 +141,8 @@ alias tbr='trans :pt-BR'
|
|||||||
# ncmpcpp
|
# ncmpcpp
|
||||||
alias ncmpcpp='ncmpcpp -b ~/.config/ncmpcpp/bindings'
|
alias ncmpcpp='ncmpcpp -b ~/.config/ncmpcpp/bindings'
|
||||||
|
|
||||||
|
alias t='todo'
|
||||||
|
|
||||||
|
|
||||||
#######################################################
|
#######################################################
|
||||||
# WORK
|
# WORK
|
||||||
|
|||||||
22
.local/bin/battery_alert.sh
Executable file
22
.local/bin/battery_alert.sh
Executable file
@@ -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
|
||||||
|
|
||||||
Reference in New Issue
Block a user