baskerville / xdo

Small X utility to perform elementary actions on windows
BSD 2-Clause "Simplified" License
300 stars 18 forks source link

Making panel on top of all windows except fullscreen #8

Closed jamietanna closed 8 years ago

jamietanna commented 8 years ago

Resubmitted from baskerville/bspwm#484.

I'm currently using the following code inside my panel, which is the same as found in bspwm/examples/panel/panel.

panel_bar < "$PANEL_FIFO" | lemonbar -n "$PANEL_WM_NAME" -g x$PANEL_HEIGHT -f "$PANEL_FONT_FAMILY" -F "$(bar_color_fg COLOR_BAR)" -B "$(bar_color_bg COLOR_BAR)" | while read line; do
    eval "$line"
done

wid=$(xdo id -a "$PANEL_WM_NAME")
tries_left=20
while [ -z "$wid" -a "$tries_left" -gt 0 ] ; do
    sleep 0.05
    wid=$(xdo id -a "$PANEL_WM_NAME")
    tries_left=$((tries_left - 1))
done
[ -n "$wid" ] && xdo above -t "$(xdo id -N Bspwm -n root | sort | head -n 1)" "$wid"

However, I'm finding that other applications, when fullscreened, remain underneath the panel: 2016-05-18-151435_508x85_scrot

I have found a workaround that lowers the panel once, to just below a fullscreen screen:

if [ -n "$wid" ]; then
    xdo above -t "$(xdo id -N Bspwm -n root | sort | head -n 1)" "$wid"
    xdo lower "$wid"
fi

However, this issue does not work when using multiple monitors; on the second monitor, the rule is not applied:

2016-05-18-152001_527x136_scrot

Could this be a bug in xdo, or is it more likely me doing something wrong?

baskerville commented 8 years ago

Sorry, I should have been more explicit: this can't be an xdo bug.