97 Commits

Author SHA1 Message Date
Tony Zorman
b1b3c4c469 ~/.xmonad/xmonad.hs -> xmonad.hs
With XDG support so firmly ingrained now, it's about time we stop
hard-coding the configuration path in the docs.
2023-12-22 18:17:17 +01:00
slotThe
feee11a0ba X.H.DynamicLog: Fix xmobarProp example
In [1] we changed the return type to not be an IO action and hence this
example can't work, even with an otherwise correct configuration.

[1]: 168cb6a6c3a774bc05032536e37b982cd6b4d7cc (Removed unnecessary IO)
2021-11-06 11:40:13 +01:00
slotThe
38c11c1e3c Add "Description" field to module headers
Fixes: https://github.com/xmonad/xmonad-contrib/issues/592
2021-09-26 14:15:54 +02:00
Tomas Janousek
07040cbd58 Use xmessage from core
Related: https://github.com/xmonad/xmonad/pull/318
2021-08-17 10:56:14 +01:00
Tomas Janousek
af2183b316 X.H.StatusBar: Simplify the fix for def as k
Fixes: 58e2b803a478 ("fix: handle `const (0,0)` from passing `def` as keybinding action")
2021-07-22 18:47:10 +01:00
brandon s allbery kf8nh
58e2b803a4 fix: handle const (0,0) from passing def as keybinding action
Before https://github.com/xmonad/xmonad/commit/383ffb7 this would
bind all unbound keys to toggle struts; after it, it would bind no
keys at all. With this commit, it will check for this case and use
the default keybinding instead.

Users who intend no key to be bound should probably use `withSB`
instead, especially in light of aforementioned commit.
2021-07-21 15:30:29 -04:00
Yecine Megdiche
168cb6a6c3 Removed unnecessary IO
This applies for withSB and withEasySB, as well as statusBarProp and
statusBarPropTo, making composability better. statusBarPipe is more
awkward to use now, but that's fine
2021-04-04 00:53:42 +02:00
Tomas Janousek
a1c2d144b3 Final touch of DynamicLog/StatusBar/PP docs 2021-04-02 21:28:41 +01:00
Yecine Megdiche
06fd90a5f8 Rename makeStatusBar to withSB, makeStatusBar' to withEasySB 2021-04-02 21:19:34 +01:00
Tomas Janousek
8e39d22cec X.H.StatusBar.PP: Move dynamicLog to DynamicLog
This function isn't useful in the new interface, ditch it.
2021-04-02 21:19:34 +01:00
Tomas Janousek
4e1b277784 X.H.StatusBar: Clean up usage documentation 2021-04-02 21:19:34 +01:00
Tomas Janousek
2865268a7a Improve descriptions of X.H.{DynamicLog,StatusBar,StatusBar.PP} 2021-04-02 21:19:34 +01:00
Yecine Megdiche
5eb3dbd61b Split XMonad.Hooks.DynamicLog
- XMonad.Hooks.DynamicLog.PP: the pretty-printing abstracion, with the
corresponding utilities
- XMonad.Hooks.StatusBar: A new module to provide a better interface to
manage external status bars.
2021-04-02 21:19:34 +01:00
Tomas Janousek
63e31ccd8d X.H.DynamicLog: Move UTF8 encoding from dynamicLogString to xmonadPropLog'
For many (10+) years, we had a cascade of ugly workarounds:

 * X.U.Run.spawnPipe returned a binary handle, so the String passed to
   it must have been encoded by C.B.UTF8.String.encodeString

 * X.H.DynamicLog.dynamicLogString therefore returned such an encoded
   String, so one could use it directly in a hPutStrLn, but literal
   Strings wouldn't work

 * xmonadPropLog' also expected an encoded String to make it easier to
   use together with dynamicLogString, again breaking usage with String
   literals and other normal unicode Strings

Then in 1d0eaddc2530 Sibi fixed spawnPipe to return a handle usable with
normal Strings, which then obviously broke the entire cascade. But,
instead of using the opportunity to remove all the ugly workarounds, he
decided to add some more on top, so now spawnPipe with dynamicLogString
outputs doubly encoded UTF-8 and xmobar has a hack to strip this double
encoding (https://github.com/jaor/xmobar/pull/482), which only works
when XFT is in use and breaks on some long unicode codepoints. :-(

There is a better way: make everything just use normal Strings and only
encode when it goes out the wire. This means dynamicLogString can be
freely mixed with String literals, manual uses of xmonadPropLog' don't
need encodeString, and everything just works nicely.

This obviously breaks configs that used some of these pieces in
isolation (like mine), but that's a small price to pay. After all, right
now all users of spawnPipe/dynamicLogString are getting doubly encoded
UTF-8 which might or might not work in xmobar and probably breaks
horribly everywhere else, so this fix should be a clear improvement. :-)

Fixes: 1d0eaddc2530 ("Make spawnPipe to use system's locale encoding")
Fixes: https://github.com/xmonad/xmonad-contrib/issues/377
Fixes: https://github.com/jaor/xmobar/issues/476
Related: https://github.com/xmonad/xmonad-contrib/pull/334
Related: https://github.com/jaor/xmobar/pull/482
2021-03-20 18:11:33 +01:00
Tomas Janousek
91010f6eb9 X.H.DynamicLog: Add ppRename (composable tag augmentation)
This one is a Reader in WindowSpace, and therefore significantly
simplifies the composition of WorkspaceNames, IndependentScreens,
ClickableWorkspaces and possibly other similar modules.

Related: https://github.com/xmonad/xmonad-contrib/pull/390
Related: https://github.com/xmonad/xmonad-contrib/pull/462
2021-03-16 18:45:19 +00:00
Tomas Janousek
fc7ea97582 X.H.DynamicLog: Reindent pprWindowSet 2021-03-16 18:23:28 +00:00
Tomas Janousek
ccebeb675d scripts/xmonadpropread: Document and support custom props 2021-02-11 15:53:17 +00:00
Yecine Megdiche
44c575930a Added StatusBarConfig and multiple loggers support
- StatusBarConfig serves as an abstraction over status bars. This
enables users to customize their status bars without having to do
the plumbing themselves.
- Multiple status bars can be used directly thanks to the
StatusBarConfig, which provides a way to compose status bars
2021-02-10 21:05:23 +00:00
Yecine Megdiche
67341e30a2 Cleanup: hlint hints 2021-01-24 17:20:50 +01:00
slotThe
a3e06685ef X.H.DynamicLog: Add ppTitleUnfocused 2021-01-07 10:23:53 +01:00
Yecine Megdiche
6c83af1c69 Added cleanupStatusBars to the startup-hook 2021-01-01 21:08:51 +01:00
Yecine Megdiche
78df487e4c Added spawnStatusBarAndRemember and cleanupStatusBars
In order to effectively restart status bars without relying
on pipes, spawnStatusBarAndRemember saves the PID of status
bars to kill them with cleanupStatusBars.

Removed checking for docks

Cleaned imports

Use signalProcesGroup instead of inverting the PID

Updated the documentation

Updated the documentation
2020-12-29 21:45:33 +01:00
Tomas Janousek
555cd7c596 X.H.DynamicLog: Minor doc tweaks 2020-12-19 18:27:19 +00:00
slotThe
6977d0cdfb X.H.DynamicLog: Update documentation
Stop recommending pipes as the best/first thing to do and instead
recommend property based logging for all bars that support it.  Also
strongly recommend users to use the already pre-made functions that do
all of the plumbing.

Add comments for the arguments of the most important user-facing
functions.
2020-12-18 21:10:44 +01:00
slotThe
9b6c098c9c Add xmobarProp, statusBarProp, and statusBarPropTo
In an effort to modernize XMonad.Hooks.DynamicLog (and thus to stop
recommending pipes as the best way to interface with xmobar), implement
property log based solutions for the most important functions.  Sadly
dzen does not seem to support this kind of interfacing with xmonad.

The descriptions of xmobar, statusBar, and statusBar' have been updated
to reflect that they should be seen as secondary choices.
2020-12-18 13:54:22 +01:00
Tomas Janousek
89646d75fd X.H.DynamicLog: Add shorten' and shortenLeft' (customizable end) 2020-12-13 21:38:35 +00:00
slotThe
0cbee237c7 Add filterOutWs and filterOutWsPP
These are more generic versions of the respective functions in
XMonad.Util.NamedScratchpad.
2020-12-11 18:54:11 +01:00
Brent Yorgey
317eb23654
Merge branch 'master' into dzen-dock 2020-12-02 13:15:01 -06:00
slotThe
5140f5b5d0 Remove things deprecated by Data.Default 2020-11-16 10:31:02 +01:00
Tomas Janousek
0996e71c7e X.H.DynamicLog: Add shortenLeft
This can be sometimes useful, e.g. when showing a directory.
2020-11-04 16:17:32 +00:00
ivanbrennan
ebfc068b99
DynamicLog: statusBar'
Add a statusBar' function that accepts pretty printing options embedded
in the X monad, so users can leverage dynamic printing modifiers, such
as workspaceNamesPP.
2020-09-19 15:12:40 -04:00
Yecine Megdiche
ab04e29e42 added xmobarBorder 2020-08-29 19:44:01 +02:00
slotThe
30d45f8993 Clean up Control.Monad imports 2019-10-08 11:27:30 +02:00
slotThe
0b26ddf489 Replace liftM2 with liftA2 2019-10-08 10:41:14 +02:00
Brent Yorgey
d3d0818e9b
Merge pull request #246 from orbisvicis/xmobar
Xmobar
2018-05-17 16:47:19 -05:00
Yclept Nemo
348861da00 'XMonad.Hooks.DynamicLog': xmobar tags
Support xmobar's <action> and <raw> tags.
2018-04-20 12:52:22 -04:00
Miguel
670eb3bc60 Added pretty printer for empty visible workspaces
Simple extensions of the pretty printer to differentiate between empty
and non-empty visible workspaces. Analogical to the existing
functionality for hidden workspaces. Particularly useful if some
displays managed by xmonad are turned off temporarily.

The new 'ppVisibleNoWindows' function was wrapped in a Maybe data type.
Its value dafaults to 'Nothing' and 'ppVisible' is used as fallback.
2018-04-18 11:36:46 +02:00
Venkateswara Rao Mandela
82aba52541 DynamicLog: add dzenWithFlags function
This commit adds `dzenWithFlags` function for users who wish to change the
command line arguments passed to `dzen`. The behaviour of `dzen` function is
kept the same.
2018-03-27 20:09:34 +05:30
Markus Ongyerth
b1f28e64d7 Add -dock to dzen command 2017-07-08 08:37:35 +02:00
Tomas Janousek
e38fb3bdb8 Make usage of ManageDocks simpler and more robust
As it now consists of a startup hook, a manage hook, an event hook and
a layout modifier, and behaves erratically when any one component is not
included in a user's config (which happens to be the case for all
configs from xmonad-contrib 0.12 since the startup hook is a new
inclusion), it's probably wise to have a single function that adds
all the hooks to the config instead.

NB: This will need a release notes entry anyway!
2016-09-07 13:26:58 +03:00
vrs
0a7ae19f90 X.H.DynamicLog: make xmobarStrip actually strip xmobar tags
consider the old implementation:
> xmobarStrip "<<fc=#f00>fc=#f00>foo</</fc>fc>"
"<fc=#f00>foo</fc>"
2015-09-07 22:59:38 +02:00
Adam Vogt
d3b2a01e3d Escape dzen markup and remove xmobar tags from window titles by default.
The issue was that window titles, such as those set by, for example a browser,
could set the window title to display something like

   <action=malicious shell command>normal title</action>

Which could be executed by xmobar (or dzen).

This adds a ppTitleSanitize which does the above functions. This way when users
override ppTitle, the benefits are not lost.

Thanks to Raúl Benencia and Joachim Breitner for bringing this to my attention.
2013-07-08 14:48:13 +00:00
Daniel Wagner
0f1b6fb772 use Data.Default wherever possible, and deprecate the things it replaces 2013-05-28 01:39:09 +00:00
Daniel Wagner
daa2731d3d eliminate references to defaultConfig 2013-05-28 00:58:25 +00:00
Adam Vogt
1364a00c84 Correct H.DynamicLog.dynamicLogXinerama comment. Wuzzeb's patch at issue 466.
Slight changes to the patch to 1. work with haddock, and 2. remove ppOutput
which distracts from the formatting and is covered elsewhere.
2011-07-14 23:17:41 +00:00
gwern0
6472683476 remove decodeInput/encodeOutput
see http://code.google.com/p/xmonad/issues/detail?id=348
they are just synonyms for 2 utf8-string functions, and don't really help
2010-06-14 23:23:00 +00:00
Tomas Janousek
21526d1532 X.H.DynamicLog: let the user of xmonadPropLog choose property name 2010-03-19 21:46:31 +00:00
Daniel Wagner
0909472d54 minor style changes 2009-12-28 17:30:16 +00:00
Tomas Janousek
e2c5fa876a X.H.DynamicLog: fix xmonadPropLog double-encoding of UTF-8
dynamicLogString utf-8 encodes its output, xmonadPropLog shouldn't do that
again.
2009-11-21 00:48:29 +00:00
Brent Yorgey
70d5cedcc5 X.H.DynamicLog: make documentation for 'dzen' and 'xmobar' slightly more clear 2009-11-21 17:07:39 +00:00