From 41afc65826b4243c914fc45283d596ed2276b477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Thu, 2 Jan 2025 08:48:40 +0100 Subject: [PATCH] hlwm: update ac and player bar --- .../herbstluftwm/executable_autostart.tmpl | 4 +++ .../herbstluftwm/executable_panel-handler | 36 +++++++------------ 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/dot_config/herbstluftwm/executable_autostart.tmpl b/dot_config/herbstluftwm/executable_autostart.tmpl index fc92a60..426bb91 100644 --- a/dot_config/herbstluftwm/executable_autostart.tmpl +++ b/dot_config/herbstluftwm/executable_autostart.tmpl @@ -13,6 +13,7 @@ hc emit_hook reload ### disable touchpad, cuz trackpoint rulezzzz xinput --disable 'SynPS/2 Synaptics TouchPad' +xinput --disable 'SYNA88022:00 06CB:CE67 Touchpad' xsetroot -solid "${colors[dark0_hard]}" @@ -137,6 +138,9 @@ hc keybind XF86AudioNext spawn systemd-run --scope --user "$HOME/bin/mprisctl" n hc keybind XF86AudioPrev spawn systemd-run --scope --user "$HOME/bin/mprisctl" prev hc keybind XF86AudioPlay spawn systemd-run --scope --user "$HOME/bin/mprisctl" toggle +hc keybind XF86MonBrightnessDown spawn brightnessctl set 10%- +hc keybind XF86MonBrightnessUp spawn brightnessctl set 10%+ + # shellcheck disable=2016 # needed to pass whole script to keybind... hc keybind XF86TouchpadToggle spawn systemd-run --scope --user sh -c 'xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" $(xinput --list-props "SynPS/2 Synaptics TouchPad" | awk -F ":\t+" "/Device Enabled/ { print (1+\$2)%2}")' diff --git a/dot_config/herbstluftwm/executable_panel-handler b/dot_config/herbstluftwm/executable_panel-handler index 9dc6b6d..df4b74d 100644 --- a/dot_config/herbstluftwm/executable_panel-handler +++ b/dot_config/herbstluftwm/executable_panel-handler @@ -183,7 +183,8 @@ hc --idle | { play_sym="%{T2}%{T-}" ;; esac - playing="$play_sym$play_line" + #playing="$play_sym$play_line" + playing="$play_sym" [[ -n "$playing" ]] && playing+=" $separator" fi @@ -191,25 +192,6 @@ hc --idle | { # notify "Player: ${cmd[1]}" "${cmd[2]}" # player_status[${cmd[1]}]="${cmd[2]}" ;; - ac) - case ${cmd[1]} in - charging) - batt_sym="%{F#00aa00}$batt_sym%{F-}" - ac="+" - notify "Power" "Battery charging" - ;; - discharging) - ac="-" - batt_sym="%{F#ffdb00}$batt_sym%{F-}" - notify "Power" "Battery discharging" - ;; - idle) - ac="=" - notify "Power" "Fully charged" - ;; - esac - ;; - battery) #echo "battery" >&2 batt_perc="${cmd[1]}" @@ -218,15 +200,21 @@ hc --idle | { { [ "$batt_perc" -ge 50 ] && batt_sym= ; } || { [ "$batt_perc" -ge 25 ] && batt_sym= ; } || batt_sym= - case "$ac" in - +) + old_ac="$ac" + case ${cmd[2]} in + charging) batt_sym="%{F#00aa00}$batt_sym%{F-}" ac="+" + [[ "$old_ac" != "$ac" ]] && notify "Power" "Battery charging" ;; - -) + discharging) + ac="-" batt_sym="%{F#ffdb00}$batt_sym%{F-}" + [[ "$old_ac" != "$ac" ]] && notify "Power" "Battery discharging" ;; - *) + idle) + ac="=" + [[ "$old_ac" != "$ac" ]] && notify "Power" "Fully charged" ;; esac