Created
December 28, 2022 00:38
-
-
Save AllanChain/4958bbebaffe492f7eef28fa944c3c96 to your computer and use it in GitHub Desktop.
Start programs if laptop is charging
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 | |
bat_status=$(cat /sys/class/power_supply/BAT1/status) | |
if [[ $bat_status != "Discharging" ]]; then | |
# More programs before Wayland tray is reday | |
sleep 30 # wait for Wayland tray | |
/usr/bin/safeeyes & | |
# More... | |
fi | |
wait $(jobs -p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment