mihirlad55 / dwm-anybar

MIT License
34 stars 0 forks source link

Flash on module update #6

Open rensenware opened 3 years ago

rensenware commented 3 years ago

I have two polybar modules, battery-combined-udev and a custom keyboard layout indicator, which quickly make themselves and the surrounding modules 'flash' in a glitchy way upon an update of it. It doesn't do this with polybar with the dwm module disabled or on any other wm (tested on xmonad, i3wm, and bspwm), so I strongly suspect it's an issue with this patch or with dwm itself. The keyboard indicator layout module for reference:

#!/bin/sh

path_pid="/tmp/keylayout.pid"
case "$1" in
        --update)
                pid=$(cat $path_pid)

                if [ "$pid" != "" ]; then
                        kill -10 "$pid"
                fi
                ;;
        *)
                echo $$ > $path_pid

                trap exit INT
                trap "echo" USR1

                while true; do
                        echo $(setxkbmap -query | sed '3!d' | cut -d\  -f6 | head -c 2)

                        sleep infinity &
                        wait
                done
                ;;
esac
mihirlad55 commented 3 years ago

Sorry for the late response. Could you post your polybar config? Is it both the battery and keyboard module or either one that causes issues? Could you post the battery module script if there is one?

rensenware commented 3 years ago

I don't think the polybar config is an issue- it works with even an example polybar config with the script added. It happens with battery-combined-udev (https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/battery-combined-udev) and my keyboard script which uses the same code to update itself. If it doesn't happen on your config, I can provide my polybar config and scripts.