fix powerbutton - with xmonad | remove xmobar
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
bat=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
stat=$(cat /sys/class/power_supply/BAT0/status)
|
||||
stat=$(cat /sys/class/power_supply/AC/online)
|
||||
|
||||
class="batteryFull"
|
||||
|
||||
if [[ $stat == "Charging" ]]; then
|
||||
if [[ $stat == 1 ]]; then
|
||||
class="batteryCharging"
|
||||
elif [[ $bat -le 10 ]]; then
|
||||
class="batteryEmpty"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
bat=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
stat=$(cat /sys/class/power_supply/BAT0/status)
|
||||
stat=$(cat /sys/class/power_supply/AC/online)
|
||||
|
||||
icon=""
|
||||
|
||||
if [[ $stat == "Charging" ]]; then
|
||||
if [[ $stat == 1 ]]; then
|
||||
icon=""
|
||||
elif [[ $bat -le 10 ]]; then
|
||||
icon=""
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
WINDOW_NAME="power"
|
||||
if eww windows | grep -q "$WINDOW_NAME"; then
|
||||
|
||||
echo "Power button pressed" >>/tmp/acpi_log.txt
|
||||
|
||||
# Check if the window is already open
|
||||
if eww active-windows | grep -q "$WINDOW_NAME"; then
|
||||
eww close "$WINDOW_NAME"
|
||||
else
|
||||
eww open "$WINDOW_NAME"
|
||||
|
||||
Reference in New Issue
Block a user