Open Quelklef opened 1 year ago
Just chiming in to say that this looks really cool! I don't have the capacity to review this in full just now, but it's definitely on my radar!
And I think the
WorkspaceLayout.*
shouldn't be a top-level submodule ofXMonad
.XMonad.Util
might be a good fit.
Don't want to bikeshed too much but can't resist here: this WorkspaceLayout
stuff is closer to XMonad.Layout.IndependentScreens
than to anything in XMonad.Util
. Arguably IndependentScreens is not a window layout, it's more of a … workspace layout. If none of this already existed I'd probably put it in XMonad.Actions
because all this workspace layout logic mostly happens in keybindings that switch workspaces, but that's just me trying to fit this into the existing namespace.
Anyway, that's just my thoughts. Not a suggestion, not a conclusion, just a thought experiment. :-)
@Quelklef Hi, I tried few days ago KDE "activities" feature first time, and I want to share some ideas with you.
What activity-like features I would like to have:
XMonad.Actions.TreeSelect
, workspace name can be separated via ".", so no need 2 dimensions (name like "Work.Proj1.Term" is also allowed - activity name will be "Work.Proj1") e.g:
[ "Relax.WWW" "Relax.DOC", "Relax.Gimp"
,"Work.Term", "Work.WWW" "Work.Editor", "Work.etc"
,"MyProjects.Term", "MyProjects.WWW" "MyProjects.Editor", "MyProjects.etc"
,"Study.WWW", "Study.Doc", "Study.Doc" ]
Again, this is just ideas and not request for change and might be done in another module but it is very close to your module and you might want to have smtg from above list for yourself needs
Hi @osv, thank you for the comment! Let me make sure I am understanding you correctly. You're thinking of using the y-axis in order to keep track of what "activity" you are engaging with. And you are thinking that:
These are some interesting suggestions. Here are my thoughts --
WorkspaceLayout
implementation. In my examples, workspaces are named after their x-coordinate, but in actuality you can name them whatever you want :PWorkspaceLayout
implementation on its own does not control when workspaces are changed; the user does. The user has to configure, for instance, that Super+W moves the y-coordinate down by one. If the user also wants something to happen on workspace change, they can add that code to the callsite. In other words, they can change the (hypothetical) callsite on "Super+W" (changeCoordinate addOneToY)
to on "Super+W" (changeCoordinate addOneToY >> doSomethingElse)
neighborhood
and label
from WorkspaceLayoutView
. That being said, it might also be a good addition to WorkspaceLayout
proper, assuming it doesn't require too much code to implementI probably won't implement these right now, since it's unclear to me whether or not this PR is headed towards merging or not anyway. If it is eventually merged (or it is known that it will eventually be merged), I'd be happy to look more into implementing these =)
Description
This PR introduces "workspace layouts", which allow non-standard organization of the workspaces themselves, such as alignment into a grid, or combination of multiple workspaces.
The modules (at the time of PR creation) are as follows:
XMonad.Util.OneState
andXMonad.WorkspaceLayout.Util
-- Utility modulesXMonad.WorkspaceLayout.Core
-- Defines functionality shared between workspace layoutsXMonad.WorkspaceLayout.Grid
-- Defines a 2d-grid workspace layout. This is likeXMonad.Actions.Plane
, but not hacky and more featurful. The grid layout allows the user to organize their workspaces into a grid and for multiple coordinates on the grid to map to the same workspace.XMonad.WorkspaceLayout.Cycle
-- Defines a cyclic workspace layout. This module is intended to be more of a demonstration than anything. Its use for me during development was to help mitigate the risk of me over-coupling generic code with the grid layout.Let me elaborate a bit on the deal with the grid layout by way of giving the example of my own current XMonad layout. I have a grid which is 10 cells across, and 4 cells tall. Altogether it looks like this:
This means that I have a grid of 32 cells total. Each row has the same names for its cells but these cells are distinct.
As I write this, I am positioned on cell
α
of rowy=1
:Using keybindings
MOD+n
for a numbern
, I can move around the rowy=1
to other workspaces on that row. If I pressMOD+3
, for instance, I move to workspace3
on rowy=1
, which contains some terminals:To move around the y-axis, I press
MOD+s
to incrementy
andMOD+w
to decrement it. If I incrementy
twice to reach rowy=3
, my status bar looks like this:This row contains a different set of workspaces than
y=1
, hence the difference in coloration for the labels.It's also worth noting that I have the
α
andγ
cells in each row to be linked together. This means that if I am on rowy=2
and open a terminal in cellγ
, and then I move to cellγ
of rowy=3
, the same terminal will be there. Under the hood, the workspacesy=2 γ
andy=3 γ
are actually the same workspace.My intent with the inclusion of the namespace
XMonad.WorkspaceLayout
and the moduleXMonad.WorkspaceLayout.Core
is to encourage other XMonad contributors to possibly create and add their own workspace layouts besides justGrid
andCycle
. (As it so happens,XMonad.WorkspaceLayout.Core
turned out to be minimal in terms of code, but so be it.)This PR is far from complete. The checklist below enumerates a number of outstanding tasks.
However, I wanted to open it earlier rather than later to start receiving feedback as soon as possible. Some questions include:
XMonad.WorkspaceLayout
namespace?XMonad.WorkspaceLayout.Core
affordance is not so ... lacking?Thanks!
post-script. I recognize that I haven't include any example client code that uses this PR. As of right now, the best example I have is my own XMonad config; see specifically how I hook into XMonad, hook into my status bar, and deifne my keybindings.
Checklist
xmonad-contrib
tests still passCHANGES.md
updatedhlint
passes