The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
1

Show or hide i3bar on a specific output

asked 2015-06-26 16:08:21 +0000

setzer22 gravatar image

I have a dual monitor setup where I have two i3bar instances. One is in dock mode at the left, and the other one is in hide mode on the right. The right one is shown when the mod key is pressed.

Now, I want to show the bar when the cursor is over a certain screen region (without using the keyboard), so I've made a basic python script that checks for that with the help of xdotool and I just need to send the command to actually show the bar.

I've tried using

i3-msg "bar mode dock"

But it didn't work because both bars were shown / hidden.

So my question basically is, how can I send a message to i3 so only one of the two bars is shown?

Thank you!

edit retag flag offensive close merge delete

Comments

Given the number of views and no answers I'll just assume i3 doesn't have this kind of functionality implemented.

setzer22 gravatar imagesetzer22 ( 2015-06-30 12:50:05 +0000 )edit

1 answer

Sort by ยป oldest newest most voted
3

answered 2015-07-23 09:27:24 +0000

vandannen gravatar image

You actually can do this. Each bar instance can have an id assigned (by default this is bar-0, bar-1, ...). So you can use i3 bar mode dock bar-0 to change the mode of the first bar instance or i3 bar mode dock to change the mode of all bar instances. The same works for all other bar commands. If you want you can also set the id of the yourself: bar { id 1 ... }

edit flag offensive delete link more

Comments

Thank you very much, I had already gotten this to work with another command that only worked in my case and forgot to post it but yours seems to be the right way. I had already tried the id approach, but it seems i3-msg wasn't able to work with that kind of commands.

setzer22 gravatar imagesetzer22 ( 2015-08-30 13:56:02 +0000 )edit

Question Tools

1 follower

Stats

Asked: 2015-06-26 16:08:21 +0000

Seen: 230 times

Last updated: Jul 23