improvements.

This commit is contained in:
rootniformaticaservice 2023-03-27 00:27:33 -03:00
parent b74982cc35
commit 65b254fc73
2 changed files with 38 additions and 0 deletions

7
emojis.sh Executable file
View File

@ -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

31
power.sh Executable file
View File

@ -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