improvements.
This commit is contained in:
parent
b74982cc35
commit
65b254fc73
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
. $HOME/.config/wms/wms_var
|
||||
|
||||
emoji=$(cat ~/.emojis | $XMENU | awk '{print $3}')
|
||||
|
||||
echo "$emoji" | xsel -b && xsel -ob | xsel -i
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
## monitor battery status and do a few things ##
|
||||
|
||||
read -r STATUS < /sys/class/power_supply/BAT0/status # battery status
|
||||
read -r LEVEL < /sys/class/power_supply/BAT0/capacity # battery level
|
||||
|
||||
# alarm function
|
||||
alarm() {
|
||||
if [ -z "$(pgrep wms_bbthr.sh)" ]; then
|
||||
wms_batlarm.sh &
|
||||
fi
|
||||
}
|
||||
|
||||
# hibernate function
|
||||
hibernate() {
|
||||
doas pm-hibernate
|
||||
}
|
||||
|
||||
# if status and level match send alarm
|
||||
if [ $STATUS = "Discharging" ] && [ $LEVEL -le "30" ]; then
|
||||
alarm
|
||||
fi
|
||||
|
||||
# if status and level match, hibernate
|
||||
if [ $STATUS = "Discharging" ] && [ $LEVEL -le "20" ]; then
|
||||
hibernate
|
||||
fi
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue