fix powerbutton - with xmonad | remove xmobar

This commit is contained in:
2025-05-03 12:33:35 +02:00
parent 228215db5e
commit 3704615cd4
11 changed files with 32 additions and 279 deletions

View File

@@ -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"

View File

@@ -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=""

View File

@@ -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"