-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
Move ppTitleUnfocused
to X.U.Loggers
#535
Conversation
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 must confess that I'm not entirely happy that we're making dynamicLogString
more complex. This could likely be implemented as a separate thing plugged into PP
via ppExtras
, and then people who don't want to show all windows wouldn't have to pay the price of all those useless getName
calls (those weren't introduced in this PR, I know, this just reminded me of that problem), and also the code wouldn't turn dynamicLogString
into spaghetti.
I also wonder if the So my gut feeling is that it might be better to provide some helpers to make it easier for users to piece something like this together and put that into |
Well, if it's just adding the
Just plugging it into |
For clickable windows, adding the
I'd say start by factoring the code out of
I'm okay with that. Do note, however, that what you have now is not really a PP (pretty-printer) record, but more like a |
Regarding |
Oh. Stupid brain, I totally forgot that pr :) |
Okay as discussed on IRC I will use this to remove
Some of these may or may not break composition with the rest of the module—opinions? |
ppWindowTitle
to PP
recordppTitleUnfocused
to X.U.Loggers
fb806a8
to
5a71f48
Compare
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.
This makes the Loggers
module more relevant, and it's quite a good addition. We could experiment with (WindowPP -> String) -> Logger
- but I'm not sure if that's useful. This is good in its current state
LGTM.
I'd maybe consider adding a formatter for urgent windows, but I'm not sure about it really. Anyone who needs something more complex like numbered windows, per-screen window lists, custom separators, etc. will roll their own anyway. Having an This fully replaces |
This way, people not using this functionality don't get the burden of a bunch of `getName`s that they haven't asked about.
Yeah, if you get into more complicated formatters it's difficult to tell when to stop. The aim was indeed just to replace |
Description
This replaces
ppTitleUnfocused
from commita3e0668 with a more extensible version,
containing more information about the window and being able to operate
on the focused window as well.
The functionality provided is a strict superset of
ppTitle
, thoughthat function is kept for backwards compatibility.
This plays nicely with #463 for lazy people like me who want their bars to read from the same property, as showing windows only if they're on the current screen is now easily possible (see the example).
Checklist
I've read CONTRIBUTING.md
I tested my changes with xmonad-testing
I updated the
CHANGES.md
file- [ ] I updated theXMonad.Doc.Extending
file (if appropriate)