Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //batcheck
- #!/bin/bash
- BATTINFO=$(acpi -b)
- if [[ "$(echo $BATTINFO | grep Discharging)" && "$(echo $BATTINFO | cut -f 5 -d " ")" < 00:05:00 ]]; then
- systemctl hibernate
- elif [[ "$(echo $BATTINFO | grep Discharging)" && "$(echo $BATTINFO | cut -f 5 -d " ")" < 00:15:00 ]] ; then
- if [ -r "$HOME/.dbus/Xdbus" ]; then
- . "$HOME/.dbus/Xdbus"
- fi
- export DISPLAY=:0
- notify-send -u critical "P-R-E-R-I-G-O" "$BATTINFO"
- fi
- //~/.dbus/Xdbus
- DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
- export DBUS_SESSION_BUS_ADDRESS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement