repos/scripts

Simple scripts that I made for my personal computer to map keys, make bluetooth work, brightness keys, etc.
Commits Files Refs README LICENSE
power.sh (9 lines)
   1 #!/bin/sh
   2 
   3 pstatus=$(acpi | sed -e '/Battery 1/d' -e 's/,//' | awk '{ print $3 }')
   4 percentage=$(acpi | sed -e '/Battery 1/d' -e 's/,//g' -e 's/%//g'| awk '{ print $4 }')
   5 remaining=$(acpi | sed -e '/Battery 1/d' -e 's/,//g' | awk '{ print $5 }' | cut -d ":" -f 1,2)
   6 
   7 [ $pstatus = "Discharging" ] && [ $percentage -lt 20 ] && $(dunstify -t 3500 -u critical "Low battery!" "$remaining Remaining")
   8 
   9 echo $pstatus