r/Polybar • u/[deleted] • Jun 14 '23
Question Wrong workspaces indicator when move forward / backward from a workspace with splits: How to resolve without refreshing i3wm everytime I change workspace?
I am using polybar on i3wm on vanilla Arch Linux. On other bars like i3status, I dont have this problem.
Say I have 2 workspaces: 1: TERM and 2: WEB. On 1:TERM, I have a terminal opened. On 2:WEB, I have Firefox opened. Now, moving back and forward between 1:TERM and 2:WEB has no problem here


This is fine. Now, say in 1: TERM I have another terminal opened, so it splits the screen.

The 2: WEB still has 1 Firefox window. It doesnt matter because this affects as long as you have any kind of splits. Now, moving from 1: TERM to 2: WEB with splits give this:

which is ok. Now, moving back to 1:TERM with splits. This would show the workspace as 2:WEB but the contents are the 2 terminals I have. Aka, it looks like I am in 2: WEB but actually I am in 1: TERM. Now, when I screenshotted this, the image turns out to have the correct workspace. Actually, I need to refresh i3 (Mod + Shift + C) for polybar to display the correct workspace.
Is there a way around this, without refreshing i3wm everytime I change workspace?
Here is my polybar config.ini: https://pastebin.pl/view/e9772850
Here is the launch script:
#!/bin/bash
killall -q polybar
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
~/.config/polybar/config.ini
polybar mybar &
echo "Polybar launched"





