-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ewmh support for workspace names #122
Ewmh support for workspace names #122
Conversation
, handleEventHook = handleEventHook c +++ ewmhDesktopsEventHook | ||
, logHook = logHook c +++ ewmhWorkspaceNamesLogHook | ||
} | ||
where x +++ y = mappend y x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why there is EWMH code in WorkspaceNames.hs
. Anything with ewmh
in the name should be moved out of this file and into EwmhDesktops.hs
.
Also, your ewmhWorkspaceNames
function is almost an exact copy of the ewmh
in EwmhDesktops.hs
.
Please fix these issues then update the CHANGES.md
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The right way to do this is probably to provide an appropriate function for use with ewmhDesktopsLogHookCustom
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The right way to do this is probably to provide an appropriate function for use with ewmhDesktopsLogHookCustom.
This behavior can't be accomplished with a pure function because access to X is needed.
I don't understand why there is EWMH code in WorkspaceNames.hs. Anything with ewmh in the name should be moved out of this file and into EwmhDesktops.hs.
The behavior of these functions is specific to WorkspaceNames which is functionality that I imagine most people don't use. It seemed more appropriate to me to group this with WorkspaceNames than with ewmh.
I could write something of type
X ([WindowSpace] -> [WindowSpace])
Which you could then combine with ewmhDesktopsLogHookCustom like
ewmhWorkspaceNamesLogHook >>= ewmhDesktopsLogHookCustom
Also, your ewmhWorkspaceNames function is almost an exact copy of the ewmh in EwmhDesktops.hs.
Except that it uses the workspace names log hook instead of the one that just uses workspace tags. If I don't add this function, then users would have to manually set the startup, handleEvent and log hooks.
Is your argument that you can do something like
(ewmh def) {
logHook = (logHook def) +++ ewmhWorkspaceNamesLogHook
}
to acheive the same effect?
This just ends up seeming a bit more complicated for the end user. Would it be okay if I wrote ewmhWorkspaceNames in terms of ewmh like:
ewmhWorkspaceNames :: XConfig a -> XConfig a
ewmhWorkspaceNames c = (ewmh c) { logHook = logHook c +++ ewmhWorkspaceNamesLogHook }
where x +++ y = mappend y x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pjones @geekosaur
Any thoughts on what I've written above? I'm happy to proceed in whatever way you think is best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be better to turn the WindowSet -> WindowSet
in EwmhDesktops
into X (WindowSet -> WindowSet)
so that WorkspaceNames
can just provide such a function and users would then be able to plug that into their ewmhWhateverHookCustom
. This should simplify the code significantly.
See also #399. I'll be happy to make that change there. That is, if @IvanMalison still wants to pursue this pull request, or if there are other users who'd like to see it merged. I'm not using any pager that shows desktop names, personally, but I'd be very happy to see this supported in WorkspaceNames
and EwmhDesktops
.
Also, I'd like to remark that I'm mentioned as a maintainer of WorkspaceNames
and that I would have reacted a few years earlier had I been pinged by either one of you. :-))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I drafted this at liskin#1. Got to admit it's significantly simpler :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I just realized that you already had the simple implementation in the cover letter of #105, but it wasn't possible back then. And two years later in #238 you fixed ewmhDesktopsLogHookCustom
so that the simple implementation is possible, and this PR (#122) was never updated accordingly. Anyway, now that the simple implementation is possible, I'll just include it in #399.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And a few months later I realized it's not as simple as I thought it was. With two separate hooks, it is, as one can pass the renaming function to the log hook only, but in #399 I deprecated the individual hooks and now I need two different remaps as in #105 again. 🤦
2e982f1
Not really a big deal I guess, but I do feel like an idiot. :-)
I apologize for being a bit dense, but I don't understand the background for this change. I've read the comments on the referenced PR and yet I still don't understand the motivation behind this. Please help me understand a use case where these changes are useful. Thank you. |
XMonad.Actions.WorkspaceNames provides dynamic workspace names that are
separate from the workspace tags. This is mostly useful because, if you
have windows on a tag and remove that tag, xmonad recreates it from the
propagated StackSet and leaves the windows on it; also, and relatedly,
because tags do more than just user visible workspace names (consider all
the hacks out there to put icons etc. into the tag for use by various bars).
An argument could be made for adding a user visible name to go with tags,
but (a) this will complicate a bunch of things including backward
compatibility (b) I'm not sure it addresses the topic-space workflow cited
by the documentation for X.A.WorkspaceNames. (OTOH that may itself be a
workaround for TopicSpaces being one of the things that often causes
argument overflow on mod-q.)
…On Wed, Dec 14, 2016 at 5:52 PM, Peter J. Jones ***@***.***> wrote:
I apologize for being a bit dense, but I don't understand the background
for this change. I've read the comments on the referenced PR and yet I
still don't understand the motivation behind this.
Please help me understand a use case where these changes are useful. Thank
you.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#122 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB8SoPz_zK2UEGE6CgKyEq6x2_i7Uyfpks5rIHM9gaJpZM4K9AMJ>
.
--
brandon s allbery kf8nh sine nomine associates
allbery.b@gmail.com ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
|
738cb91
to
9bc0822
Compare
I moved the functions supporting ewmh to the ewmh module (frankly, I still think it would be more appropriate to have them in WorkspaceNames, but I don't feel very strongly about it). |
@IvanMalison Sorry for the delay. After reading @geekosaur's comment and thinking about this some more I'm wondering if it makes sense to move everything from this PR into its own module. Like you said, it doesn't really belong in EWMH, but WorkspaceNames might not be the right place either. Really, this is a way to glue those two together (if I understand correctly). How does that sound? |
@pjones Yeah, sure that works! |
@IvanMalison Are you still going to move this code into its own module? |
yep I can do that! |
ad9c800
to
688ab37
Compare
688ab37
to
2448a2a
Compare
9ce1bb1
to
70a6ead
Compare
This makes it easier to use transforms that need some state, e.g. XMonad.Actions.WorkspaceNames could provide this. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
This makes it easier to use transforms that need some state, e.g. XMonad.Actions.WorkspaceNames could provide this. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
This makes it easier to use transforms that need some state, e.g. XMonad.Actions.WorkspaceNames could provide this. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
Turns out that renaming workspaces in the transform is a bad idea in the `ewmhDesktopsEventHook'` as W.view is then unable to find the workspace. This was somewhat usable before we introduced the unified `ewmh'` config combinator as one would only rename in the transform passed to `ewmhDesktopsLogHookCustom`, but with the unified config, we actually need to separate renames from sorting/reordering, otherwise switching workspaces by pagers or wmctrl doesn't work. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
This makes it easier to use transforms that need some state, e.g. XMonad.Actions.WorkspaceNames could provide this. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
Turns out that renaming workspaces in the transform is a bad idea in the `ewmhDesktopsEventHook'` as W.view is then unable to find the workspace. This was somewhat usable before we introduced the unified `ewmh'` config combinator as one would only rename in the transform passed to `ewmhDesktopsLogHookCustom`, but with the unified config, we actually need to separate renames from sorting/reordering, otherwise switching workspaces by pagers or wmctrl doesn't work. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
This makes it easier to use transforms that need some state, e.g. XMonad.Actions.WorkspaceNames could provide this. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
Turns out that renaming workspaces in the transform is a bad idea in the `ewmhDesktopsEventHook'` as W.view is then unable to find the workspace. This was somewhat usable before we introduced the unified `ewmh'` config combinator as one would only rename in the transform passed to `ewmhDesktopsLogHookCustom`, but with the unified config, we actually need to separate renames from sorting/reordering, otherwise switching workspaces by pagers or wmctrl doesn't work. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
This makes it easier to use transforms that need some state, e.g. XMonad.Actions.WorkspaceNames could provide this. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
Turns out that renaming workspaces in the transform is a bad idea in the `ewmhDesktopsEventHook'` as W.view is then unable to find the workspace. This was somewhat usable before we introduced the unified `ewmh'` config combinator as one would only rename in the transform passed to `ewmhDesktopsLogHookCustom`, but with the unified config, we actually need to separate renames from sorting/reordering, otherwise switching workspaces by pagers or wmctrl doesn't work. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
This makes it easier to use transforms that need some state, e.g. XMonad.Actions.WorkspaceNames could provide this. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
Turns out that renaming workspaces in the transform is a bad idea in the `ewmhDesktopsEventHook'` as W.view is then unable to find the workspace. This was somewhat usable before we introduced the unified `ewmh'` config combinator as one would only rename in the transform passed to `ewmhDesktopsLogHookCustom`, but with the unified config, we actually need to separate renames from sorting/reordering, otherwise switching workspaces by pagers or wmctrl doesn't work. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
This makes it easier to use transforms that need some state, e.g. XMonad.Actions.WorkspaceNames could provide this. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
Turns out that renaming workspaces in the transform is a bad idea in the `ewmhDesktopsEventHook'` as W.view is then unable to find the workspace. This was somewhat usable before we introduced the unified `ewmh'` config combinator as one would only rename in the transform passed to `ewmhDesktopsLogHookCustom`, but with the unified config, we actually need to separate renames from sorting/reordering, otherwise switching workspaces by pagers or wmctrl doesn't work. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
This makes it easier to use transforms that need some state, e.g. XMonad.Actions.WorkspaceNames could provide this. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
…ctrl -s) Turns out that renaming workspaces in the transform is a bad idea in the `ewmhDesktopsEventHook'` as W.view is then unable to find the workspace. This was somewhat usable before we introduced the unified `ewmh'` config combinator as one would only rename in the transform passed to `ewmhDesktopsLogHookCustom`, but with the unified config, we actually need to separate renames from sorting/reordering, otherwise switching workspaces by pagers or wmctrl doesn't work. Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
…tering and renaming Now that we have `XMonad.Util.ExtensibleConf`, users can comfortably use the `ewmh` combinator and still customize workspace ordering, filter out scratchpads and expose altered workspace names. To make this all work nicely, we introduce not one, but two configuration options: a sort/filter function and a rename function. This is because renaming and sorting in one go makes it hard (perhaps even impossible) to decide which workspace to switch to upon receipt of a _NET_CURRENT_DESKTOP request from a pager or wmctrl/xdotool. (The only reason this wasn't a problem before is because one could pass the renaming function to `ewmhDesktopsLogHookCustom` only, not `ewmhDesktopsEventHookCustom`, which is a confusing hack as can be seen in the related closed pull requests.) Related: xmonad#238 Related: xmonad#105 Related: xmonad#122
Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
…tering and renaming Now that we have `XMonad.Util.ExtensibleConf`, users can comfortably use the `ewmh` combinator and still customize workspace ordering, filter out scratchpads and expose altered workspace names. To make this all work nicely, we introduce not one, but two configuration options: a sort/filter function and a rename function. This is because renaming and sorting in one go makes it hard (perhaps even impossible) to decide which workspace to switch to upon receipt of a _NET_CURRENT_DESKTOP request from a pager or wmctrl/xdotool. (The only reason this wasn't a problem before is because one could pass the renaming function to `ewmhDesktopsLogHookCustom` only, not `ewmhDesktopsEventHookCustom`, which is a confusing hack as can be seen in the related closed pull requests.) Related: xmonad#238 Related: xmonad#105 Related: xmonad#122
Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
…tering and renaming Now that we have `XMonad.Util.ExtensibleConf`, users can comfortably use the `ewmh` combinator and still customize workspace ordering, filter out scratchpads and expose altered workspace names. To make this all work nicely, we introduce not one, but two configuration options: a sort/filter function and a rename function. This is because renaming and sorting in one go makes it hard (perhaps even impossible) to decide which workspace to switch to upon receipt of a _NET_CURRENT_DESKTOP request from a pager or wmctrl/xdotool. (The only reason this wasn't a problem before is because one could pass the renaming function to `ewmhDesktopsLogHookCustom` only, not `ewmhDesktopsEventHookCustom`, which is a confusing hack as can be seen in the related closed pull requests.) Related: xmonad#238 Related: xmonad#105 Related: xmonad#122
Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
…tering and renaming Now that we have `XMonad.Util.ExtensibleConf`, users can comfortably use the `ewmh` combinator and still customize workspace ordering, filter out scratchpads and expose altered workspace names. To make this all work nicely, we introduce not one, but two configuration options: a sort/filter function and a rename function. This is because renaming and sorting in one go makes it hard (perhaps even impossible) to decide which workspace to switch to upon receipt of a _NET_CURRENT_DESKTOP request from a pager or wmctrl/xdotool. (The only reason this wasn't a problem before is because one could pass the renaming function to `ewmhDesktopsLogHookCustom` only, not `ewmhDesktopsEventHookCustom`, which is a confusing hack as can be seen in the related closed pull requests.) Related: xmonad#238 Related: xmonad#105 Related: xmonad#122
Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
…tering and renaming Now that we have `XMonad.Util.ExtensibleConf`, users can comfortably use the `ewmh` combinator and still customize workspace ordering, filter out scratchpads and expose altered workspace names. To make this all work nicely, we introduce not one, but two configuration options: a sort/filter function and a rename function. This is because renaming and sorting in one go makes it hard (perhaps even impossible) to decide which workspace to switch to upon receipt of a _NET_CURRENT_DESKTOP request from a pager or wmctrl/xdotool. (The only reason this wasn't a problem before is because one could pass the renaming function to `ewmhDesktopsLogHookCustom` only, not `ewmhDesktopsEventHookCustom`, which is a confusing hack as can be seen in the related closed pull requests.) Related: xmonad#238 Related: xmonad#105 Related: xmonad#122
Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
…tering and renaming Now that we have `XMonad.Util.ExtensibleConf`, users can comfortably use the `ewmh` combinator and still customize workspace ordering, filter out scratchpads and expose altered workspace names. To make this all work nicely, we introduce not one, but two configuration options: a sort/filter function and a rename function. This is because renaming and sorting in one go makes it hard (perhaps even impossible) to decide which workspace to switch to upon receipt of a _NET_CURRENT_DESKTOP request from a pager or wmctrl/xdotool. (The only reason this wasn't a problem before is because one could pass the renaming function to `ewmhDesktopsLogHookCustom` only, not `ewmhDesktopsEventHookCustom`, which is a confusing hack as can be seen in the related closed pull requests.) Related: xmonad#238 Related: xmonad#105 Related: xmonad#122
Related: xmonad#105 Related: xmonad#122 Related: f271d59 ("X.A.WorkspaceNames: Provide workspaceListTransform for EwmhDesktops")
This PR also fixes the issue that #105 fixed in a cleaner way.