Last active
August 21, 2021 23:24
-
-
Save Raymo111/56b5f4b1d5d13f6eb3a6b59d7cea2881 to your computer and use it in GitHub Desktop.
UPS battery power notification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#. | |
#. | |
#. | |
# (append this) | |
# Send a desktop notif | |
sudo -u raymo DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "Warning: Utility power has failed. Now running on battery." -i battery-caution -u critical -t 10000 -h 'string:desktop-entry:ups' -a UPS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Name=UPS | |
Comment=CyberPower UPS | |
Icon=preferences-system-power-management | |
Type=Application | |
Exec=systemmonitor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment