diff options
| author | 2014-10-25 22:26:54 +0200 | |
|---|---|---|
| committer | 2014-10-25 22:26:54 +0200 | |
| commit | 3e94a3e724c36267fa2e4039e3759473c59e8510 (patch) | |
| tree | 379d0598c0d26d3b0c746604d80bb9e803371fb0 /.config/herbstluftwm/notify.sh | |
| parent | 8ecace69cb3b35ac6b72859ebf0be70d11d2d71e (diff) | |
| download | dotfiles-3e94a3e724c36267fa2e4039e3759473c59e8510.tar.gz dotfiles-3e94a3e724c36267fa2e4039e3759473c59e8510.tar.bz2 dotfiles-3e94a3e724c36267fa2e4039e3759473c59e8510.zip | |
Restructured dotfile repo to take advantage of GNU Stow
Diffstat (limited to '.config/herbstluftwm/notify.sh')
| -rwxr-xr-x | .config/herbstluftwm/notify.sh | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/.config/herbstluftwm/notify.sh b/.config/herbstluftwm/notify.sh deleted file mode 100755 index 190d496..0000000 --- a/.config/herbstluftwm/notify.sh +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | monitor_w=$1 | ||
| 4 | window_p=$2 | ||
| 5 | panel_h=$3 | ||
| 6 | |||
| 7 | popup_w=$(echo "$monitor_w - (2 * $window_p)" | bc) | ||
| 8 | popup_h=$panel_h | ||
| 9 | popup_x=$window_p | ||
| 10 | popup_y=$window_p | ||
| 11 | |||
| 12 | popup_opts="-w $popup_w -h $popup_h -x $popup_x -y $popup_y" | ||
| 13 | |||
| 14 | while true; do | ||
| 15 | |||
| 16 | bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) | ||
| 17 | bat_stat=$(cat /sys/class/power_supply/BAT1/status) | ||
| 18 | |||
| 19 | if [[ $bat_lvl -le 5 && $bat_stat == "Discharging" ]]; then | ||
| 20 | $4 -m "Battery level critical: $bat_lvl%%" -u "high" $popup_opts | ||
| 21 | elif [[ $bat_lvl -eq 10 && $bat_stat == "Discharging" ]]; then | ||
| 22 | $4 -m "Battery level low: $bat_lvl%%" $popup_opts | ||
| 23 | elif [[ $bat_lvl -eq 50 && $bat_stat == "Discharging" ]]; then | ||
| 24 | $4 -m "Battery level at $bat_lvl%%" $popup_opts | ||
| 25 | elif [[ $bat_lvl -eq 100 && $bat_stat == "Charging" ]]; then | ||
| 26 | $4 -m "Battery fully charged" | ||
| 27 | fi | ||
| 28 | |||
| 29 | sleep 60; | ||
| 30 | done | ||
