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

Don't show specific workspace buttons on i3bar

asked 2013-10-31 12:20:29 +0000

smiszym gravatar image

I have web browser on workspace www and music player on workspace music. And, of course various programs on workspaces 1, 2, 3...

i3bar shows buttons for all workspaces present. It is great, it gives an easy information of which workspaces contain something. But a web browser is always running and I know about it, so the button of www unnecessarily fills space on the bar. Same for music.

How to tell i3bar to never show buttons for workspaces www and music?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-10-31 14:28:12 +0000

Adaephon gravatar image

It is not possible to configure i3bar to not show specific workspaces. You could hide all workspace buttons with workspace_buttons no in the bar configuration, but that's in all likelihood not what you want.


You could move your browser and music player to scratchpad windows. Perhaps like this:

for_window [class="^BrowserName$"] move scratchpad
bindsym $mod+b [class="^BrowserName$"] scratchpad show

This moves any browser window with class "BrowserName" to a scratchpad window and with $mod+b you can switch it on and off. Obviously this depends on the browser used, for Firefox it would be "Firefox". You can use xprop to get the class name. It is one of the values of WM_CLASS (for me, only the second one, with upper case characters, works)

If you don't want to move every browser window to a scratchpad you could bind an extra key for moving a specific window there:

bindsym $mod+Shift+b mark browser; [con_mark="^browser$"] move scratchpad
bindsym $mod+b [con_mark="^browser$"] scratchpad show

This marks the current window and moves it to a scratchpad. The mark is also used to toggle the visible state. (Note: only one window may have a specific mark. If a already present mark is set on a window it is unset from the other window)

Using scratchpad has some drawbacks:

  • On the initial move to scratchpad the window is resized to 50% of the screen width and 75% of the height, but resizing is possible and the new size is remembered during visibility toggles.
  • It is a floating window (after all, we do use i3 for a reason, don't we)
  • When having several scratchpad windows matching the same criteria (class, title) each window is toggled at the same time. Cycling through all windows seems only possible with the vanilla scratchpad show (Without criteria. It shows one scratchpad on the first call, then hides it on the next. If called once again it shows the next scratchpad.)

On the plus side:

  • Does not take up space on the i3bar.
  • You have access to your browser window on every workspace.

If scratchpad is not for you and you only want to save space on the i3bar, I'd suggest using a single character for the workspace names. If you don't like names like 'B' you could always use " " or any other character with low visual impact (Unicode provides ;) ) so that the buttons are not that visible.

edit flag offensive delete link more

Comments

I've never used scratchpad, but it sounds good, so I'll try it. And because hiding buttons, as I expected, is all or none, an invisible/small workspace name is my favourite solution :) Thanks!

smiszym gravatar imagesmiszym ( 2013-10-31 21:20:15 +0000 )edit

Question Tools

Stats

Asked: 2013-10-31 12:20:29 +0000

Seen: 727 times

Last updated: Oct 31 '13