LBCrion/sfwbar

Workspaces not showing bar on labwc

Opened this issue ยท 9 comments

I can't get workspaces showing via pager on labwc. I have a workaround tho, but it's clunky.
pager-config:

pager {
    style = "pager"
    rows = 1
    preview = true
    numeric = true
    pins = "1","2","3","4"
}

I get this: image

labwc excerpt:

<desktops number="6" />

Am I doing something wrong, here?

Workspaces aren't supported in sfwbar on labwc. You need to use the labwc keybinds for workspaces and make a widget that uses wtype to emulate this.

Background: labwc does intentionally not support custom IPC like some other compositors. Thus labwc relies on proper upstream protocol support for features like this (e.g. ext-workspace).

what's that thing about foreign toplevel whatnot?

what's that thing about foreign toplevel whatnot?

That is for the window list and the window states (e.g. minimized / maximized / activated / fullscreen) and allows to change those states.

I think it will take some time before we get full featured workspace support via wayland protocols. As @Consolatis mentioned we'll need ext-workspace merged to get basic workspace support (I.e. list and activate workspaces). We will then need ext-foreign-toplevel-management and a yet to be created and named bridging protocol to get information about which windows belong to which workspace and to move windows across workspaces.

The good news, is that sfwbar has all the abstractions ready to support these features, so plumbing in these protocols should be easy once they are released.

@gyreas , I had the same issue, but I managed to write a widget for it in #169 if you're interested.

@gyreas , I had the same issue, but I managed to write a widget for it in #169 if you're interested.

I came up with a more or less similar solution.
An excerpt of rc.xml:

    <keybind key="W-,"> 
       <action name="Execute" command="~/.config/labwc/winutils.fish left" /> 
       <action name="GoToDesktop" to="left" wrap="yes" /> 
     </keybind> 
     <keybind key="W-."> 
       <action name="Execute" command="~/.config/labwc/winutils.fish right" /> 
       <action name="GoToDesktop" to="right" wrap="yes" /> 
     </keybind> 
     <keybind key="W-1"> 
       <action name="Execute" command="~/.config/labwc/winutils.fish 1" /> 
       <action name="GoToDesktop" to="1" wrap="no" /> 
     </keybind> 
     <keybind key="W-2"> 
       <action name="Execute" command="~/.config/labwc/winutils.fish 2" /> 
       <action name="GoToDesktop" to="2" wrap="no" /> 
     </keybind> 
     <keybind key="W-3"> 
       <action name="Execute" command="~/.config/labwc/winutils.fish 3" /> 
       <action name="GoToDesktop" to="3" wrap="no" /> 
     </keybind>

winutils.fish:

#!/usr/bin/env fish  
  
 set tmpf /tmp/labwc_wkspc 
 set default_wkspc 1 
 if [ ! -f $tmpf ] 
     echo $default_wkspc > $tmpf 
 end 
 set current_wkspc (cat $tmpf) 
  
 set MAX_WKSPC 6 
 set dir_wkspc $argv[1] 
 switch $dir_wkspc 
 case left 
     set current_wkspc $(math "($current_wkspc - 1) % $MAX_WKSPC") 
 case right 
     set current_wkspc $(math "($current_wkspc + 1) % $MAX_WKSPC") 
 case 1 
     set current_wkspc 1 
 case 2 
     set current_wkspc 2 
 case 3 
     set current_wkspc 3 
 case 4 
     set current_wkspc 4 
 case 5 
     set current_wkspc 5 
 case 6 
     set current_wkspc 6 
 case * 
     notify-send "Unknown command: '$dir_wkspc'" 
 end 
  
 echo $current_wkspc > $tmpf

Something like memcached could help since updating files is slow.

@LBCrion , wouldn't it be good to have a Discussions section (like: )labwc Discussions for users and devs to share their custom configs and widgets.

I could see multiple labwc users asking about the pager and workspaces.
And I have a python script to generate a monthly calendar(popup window) I'd like to share, for anyone who could find a use for it.

Good idea. I just enabled discussions.