Home > Blockchain >  How can I cycle through a specific list of workspaces on XMonad?
How can I cycle through a specific list of workspaces on XMonad?

Time:11-09

I'm a bit familiar with python, but not at all with haskell (although learning a programming language has definitely helped with understanding the XMonad documentation).

Used TreeSelect to create a dynamic group of workspaces (and sub-workspaces).

Using CycleWS to navigate these workspaces.

I am currently using 'ignoringWSs' within my keybindings to cycle through a small list of workspaces using a large list of workspaces to exclude from the cycle. Looking to do the opposite, where I cycle through a small list of workspaces, without having to exclude the existing workspaces that I don't wish to interact with using that specific keybinding.

Currently using:

, ("M-3", addName "Switch to Next ... Page"               $ moveTo Next $ hiddenWS :&: ignoringWSs     [ "{Programming}.$Terminals.1>"
                                                                                                    , "{Programming}.$Terminals.2>"
                                                                                                    , "{Programming}.$Terminals.3>"
                                                                   
                                    ...
                                                                               

It's a crude solution, but I'm looking to use something that simplifies my code a bit.

Any suggestions on any optimizations (including to my form of asking questions, as this is my first one!) would be highly appreciated.

Thank you in advance!

CodePudding user response:

Hi just to clarify: you have a list of ws, lets named it large_list. You want to cycle over an small subset of it: my_cycle_list. To do so, you build a large_exclusion_list of the ws you don't want to cycle over, which contains all ws in large_list except for those in my_cycle_list isn't it?.

You want to do the opposite: defining my_cycle_list and cycle over it. This is what I've understood.

If that the case, I think you can simply negate the condition. Notice I haven't tried myself this solution.

, ("M-3", addName "Switch to Next ... Page" 
      $ moveTo Next $ hiddenWS :&: Not (ignoringWSs my_small_cycle_list)

CodePudding user response:

Figured it out.

Now using:

  , ("M-<Right>", addName "Next Workspace"                   $ moveTo Next (wsTagGroup '.'))

At the time that I posted this question, I was simply copy & pasting examples from the Haskell documentation, but this specific module didn't list an example of its use.

Reading through "Learn You A Haskell For Great Good" really helped me understand more about configuring XMonad and, of course, about Haskell in general.

I highly recommend it if you're currently working on your own XMonad config and looking to be more proactive within the process!

  • Related