Commit Graph

2458 Commits

Author SHA1 Message Date
slotThe
b51ccc87b8 Fix GHC warning: -Wunused-matches
Related: https://github.com/xmonad/xmonad-contrib/issues/537
2021-05-20 17:32:02 +02:00
Yecine Megdiche
3f8c570347 X.A.DynamicWorkspaceGroups: TopicSpace support ()
* `X.A.DynamicWorkspaceGroups`: TopicSpace support

This adds `viewTopicGroup` and a corresponding prompt. This is similar
to `viewWSGroup`, but it calls `switchTopic` instead of `W.greedyView`,
inorder to run the topic action on the workspace.
2021-05-18 09:31:05 +02:00
Tomas Janousek
12b17c4935 X.D.Extending: Fix nested lists; fix StatusBar.PP placement
Fixes: 5eb3dbd61b ("Split XMonad.Hooks.DynamicLog")
2021-05-17 22:21:57 +01:00
Tomas Janousek
41ba7fd0d3 X.H.EwmhDesktops: Fix _NET_ACTIVE_WINDOW requests from pagers being ignored
This makes window switching apps like rofi and alttab able to activate
windows even if the logHook doesn't activate them (which it doesn't by
default, and that's a regression).

Fixes: 45052b984d ("X.H.EwmhDesktops. run 'logHook' for activated window.")
Related: https://github.com/xmonad/xmonad-contrib/issues/396
Related: https://github.com/xmonad/xmonad-contrib/pull/110
Related: https://github.com/xmonad/xmonad-contrib/pull/192
2021-05-16 15:02:37 +01:00
Tomas Janousek
82ecde86fe X.H.EwmhDesktops: Clean up "handle"
Related: https://github.com/xmonad/xmonad-contrib/issues/396
Related: https://github.com/xmonad/xmonad-contrib/pull/399
Related: https://github.com/xmonad/xmonad-contrib/pull/192
2021-05-16 15:02:37 +01:00
Tomas Janousek
6946bbc48b X.{H.EwmhDesktops,L.Fullscreen}: Kill a few warnings
Related: https://github.com/xmonad/xmonad-contrib/issues/396
Related: https://github.com/xmonad/xmonad-contrib/pull/399
2021-05-16 14:58:44 +01:00
Tomas Janousek
2c1c96c3e5 X.H.{EwmhDesktops,ManageDocks}: Improve the usage doc a bit
Don't assume ewmh/docks are the only xmonad config combinator out there.

Related: https://github.com/xmonad/xmonad-contrib/issues/396
Related: https://github.com/xmonad/xmonad-contrib/pull/399
2021-05-16 14:58:38 +01:00
slotThe
00e7a5c197 X.D.Developing: Add X.Prelude
Add a small note in order to aid discoverability amongst developers.
2021-05-13 17:44:50 +02:00
slotThe
2469269119 New module: XMonad.Prelude
This is a convenience module in order to have less import noise.  It
re-exports the following:

  a) Commonly used modules in full (Data.Foldable, Data.Applicative, and
     so on); though only those that play nicely with each other, so that
     XMonad.Prelude can be imported unqualified without any problems.
     This prevents things like `Prelude.(.)` and `Control.Category.(.)`
     fighting with each other.

  b) Helper functions that don't necessarily fit in any other module;
     e.g., the often used abbreviation `fi = fromIntegral`.
2021-05-13 17:44:47 +02:00
slotThe
6ece010c01 Use reverseS instead of self-defined functions 2021-05-13 17:43:32 +02:00
Yecine Megdiche
02d0b79289 Merge pull request from TheMC47/add-loggers-reference
Documentation tweaks for `X.H.StatusBar(.PP)`
2021-05-12 11:36:59 +02:00
Tomas Janousek
8cdbb5d422 X.L.SubLayouts: Fix focusWindow' being quadratic 2021-05-11 15:10:56 +01:00
Tomas Janousek
36d06c1c5d X.L.SubLayouts: Rewrite updateGroup, updateWs' using stack of stacks
A stack of stacks is a more natural representation of what SubLayouts
does: it packs information about the global focus as well as focus in
individual groups (sublayouts).

It doesn't carry information about the sublayouts themselves (but a
similar structure in X.L.Groups does), so we still use Groups and
fromGroups in some places, but future refactor can simplify that as
well, I'm sure.

My main motivation for this is that I need to expose the window groups
to the user config, and a stack of stacks seems to be a nice data
structure for that. The motivation for exposing the groups is that I
want to manipulate focus in a way that takes groups into account. As an
example, I want the following:

 * mod-1, mod-2 to mod-0 switches to n-th group if not already focused,
   and if focused, focus next in the group

 * show these numbers and window titles in xmobar (like tmux/screen/vim
   status line), like so:

     1a weechat  1b browser  2 vim  3 mutt

Achieving this just using BoringWindows is quite tricky, but with the
ability to somehow (InspectLayout, which is work-in-progress, or message
with IORef) get the stack of stacks out of SubLayouts, this becomes
easy.
2021-05-11 15:10:52 +01:00
Tomas Janousek
975a99d9dd X.L.SubLayouts: Simplify updateWs' using updateGroup
Turns out similar logic is already in updateGroup, and we don't even
need to worry about extra/missing windows and we can just differentiate
the result of reordering.
2021-05-11 15:09:40 +01:00
Tomas Janousek
9c93d90970 X.L.SubLayouts: Avoid moving floats to end of window stack
This makes the following sequence of operations idempotent, as it should be:

    windows $ W.float w $ W.RationalRect 0 0 1 1
    windows $ W.sink w

Previously, any window not visible to the SubLayout modifier (xmonad
invokes runLayout with tiled windows only) would be reordered to the end
of stack. This commit changes the reordering logic to only reorder
windows in Groups and keep all other windows where they were.
2021-05-11 15:09:40 +01:00
Yecine Megdiche
644f993fef Added reference to "XMonad.Util.Loggers" 2021-05-11 12:32:12 +02:00
Tomas Janousek
57674eb545 X.A.TreeSelect: Only swap green/blue for X11-xft < 0.3.3
The issue was fixed upstream in 0.3.3:
24f6275791
24f6275791^
(it is yet to be uploaded to Hackage, Clemens lost his Hackage
credentials :-))

Related: https://github.com/xmonad/xmonad-contrib/pull/486
Related: 46f24bb27e ("X.A.TreeSelect: Fix swapped green/blue in foreground when using Xft")
2021-05-10 22:53:25 +01:00
Yecine Megdiche
0f617114c8 Updated the example usage of statusBarProp 2021-05-09 13:07:50 +02:00
slotThe
322e06eed9 X.H.SB.PP: Move ppTitleUnfocused to X.U.Loggers
This way, people not using this functionality don't get the burden of a
bunch of `getName`s that they haven't asked about.
2021-05-08 08:07:33 +02:00
oogeek
79e06cf76a update doc example for multiple monitors 2021-04-30 21:13:25 +08:00
slotThe
130e675837 Merge pull request from slotThe/ezmotion
X.A.EasyMotion: Cleanup, doc improvement
2021-04-26 08:16:05 +02:00
slotThe
226b385729 X.U.EZConfig: Simplify removeKeys, removeMouseBindings
We're not parsing anything (as opposed to the respective `P` functions)
and so there's no need to create a dummy map with units as values and
then take the difference; we can simply remove the relevant keys from
the map.
2021-04-24 09:23:02 +02:00
slotThe
1b8c3993e2 Merge pull request from slotThe/safeDirPrompt
X.P.Shell: Add `safeDirPrompt`
2021-04-23 07:45:33 +02:00
oogeek
e214c94f0d X.H.WallpaperSetter: Add defWPNamesPng, defWPNamesJpg
This also deprecates defWPNames in favour of the (equivalent)
defWPNamesJpg.
2021-04-21 20:22:48 +02:00
oogeek
1009284a03 add link to resized gifs 2021-04-20 15:27:14 +08:00
slotThe
07439cc169 X.P.Shell: add safeDirPrompt
A new prompt that works like 'safePrompt', but is optimized for the
use-case of a program that needs a file as an argument.

This is necessarily a new function and can't just be achieved by using
the old `safePrompt`, as `getShellCompl'` does not at all filter the
files (compgen already does that based on the input), but only the
available commands.  If we start the prompt with a single command then
the chosen `searchPredicate` becomes quite useless and we can't take
advantage of fuzzy matching for file finding.  This, however, is quite
useful when having a program that explicitly expects a file as one of
its arguments, e.g. dragon [1].

What we have to do instead of to generate all available files with
compgen and _then_ filter this down to what we want via a given
function.  In order to make this change backwards compatible we have to
introduce the rather ugly `shellComplImpl`, which takes a laundry list
of all of the different parameters that we need.  Since the function is
not exported, this ugliness does perhaps not matter too much.

[1]: https://github.com/mwh/dragon
2021-04-20 07:57:40 +02:00
nikshalark
f49e7d653a Redefined ComplCaseSensitivity as a proper sum type. () 2021-04-17 02:19:16 -04:00
Tomas Janousek
336afc82ca X.U.ClickableWorkspaces: Fix typo 2021-04-15 10:51:32 +01:00
Tomas Janousek
52bb28824d X.U.ClickableWorkspaces: Improve getWsIndex doc 2021-04-15 08:48:40 +01:00
slotThe
1d7abb102f Merge pull request from oogeek/ClickableWorkspace-Improve
X.U.ClickableWorkspaces: Fix integration with X.A.DynamicWorkspaces
2021-04-15 08:44:10 +02:00
slotThe
ad1e858bac Merge pull request from slotThe/prompt-ah-immediate
X.Prompt: fix selection not entering history
2021-04-14 08:12:23 +02:00
slotThe
83aaf0414b X.A.EasyMotion: Update documentation 2021-04-13 19:16:31 +02:00
slotThe
c649d314fa X.A.EasyMotion: Small nits
Superficial simplifications for certain functions
2021-04-13 19:16:16 +02:00
slotThe
78f3ad26ed X.A.EasyMotion: Strictify records
There is no reason for these not to be strict.
2021-04-13 19:16:08 +02:00
slotThe
827ea89b6b X.A.EasyMotion: Add Haddock headings
These are generally very useful for users in order to get a quick
overview of what the module offers them.
2021-04-13 19:16:03 +02:00
oogeek
a33de7f73a ClickableWorkspace Improvement for X.A.DynamicWorkspaces 2021-04-13 20:38:54 +08:00
Joan MIlev
f5464224e2 X.A.EasyMotion: export proportional () 2021-04-12 19:14:19 +02:00
slotThe
563aa08fae X.A.EasyMotion: font -> emFont
the `font` field is already exported by X.Prompt and so there is a
conflict when importing both modules unqualified (as many people do).
2021-04-12 09:16:46 +02:00
slotThe
a05128359a X.A.EasyMotion: consistent indentation, hlint nits 2021-04-12 08:28:19 +02:00
Matt Kingston
99ea4c23e8 New module: Actions.EasyMotion () 2021-04-12 08:12:42 +02:00
Tomáš Janoušek
0ebd3a0534 Merge pull request from slotThe/minimal-pragmas
Add `MINIMAL` pragmas to `HasName` and `XPrompt`
2021-04-10 09:29:09 +01:00
slotThe
8aefbf8883 Add MINIMAL for HasName 2021-04-10 08:32:32 +02:00
slotThe
7702fa052b Add MINIMAL for XPrompt 2021-04-10 08:32:32 +02:00
slotThe
828983060d X.Prompt: fix selection not entering history
When `alwaysHighlight` is enabled and one immediately presses (by
default) Return after opening the prompt (because the highlighted
completion is what one wants) then the selection will not enter the
prompt history.  Instead, an empty string will be entered because there
hasn't been any input yet and hence the `highlightedCompl` field has not
yet been filled in.

The fix is simply checking whether `alwaysHighlight` is set during
startup and, if yes, already setting the highlighted completion to the
first suggestion.
2021-04-09 15:29:51 +02:00
slotThe
d7ad486a6e X.Prompt: get rid of MultiWayIf
Not needed anymore
2021-04-08 14:47:59 +02:00
slotThe
344ace492b X.Prompt: Properly handle one completion in hlComplete
This builds upon the idea of 780360abf0
but it fixes the issue in a bit of a nicer way; instead of throwing an
exception and closing the prompt, we simply check if there is only a
single completion available inside `hlComplete` directly.

While what 780360abf0 said is true insofar
that we have incomplete information when inside `hlComplete`, this does
not actually matter in this case.  We have access to the complete user
input (possibly consisting of things not from this round of completion),
which is enough here.
2021-04-08 14:47:39 +02:00
Tomáš Janoušek
72548b9206 Merge pull request from liskin/pr/dynamicicons-changes
X.H.DynamicIcons: Cleanups, docs improvements, composability with other *PPs
2021-04-08 09:26:48 +01:00
slotThe
780360abf0 X.Prompt: Special handling of one highlighted item
Fixes a bug introduced in f2cfaa3398.

The changes there allowed the prompt to cycle through its input; it now
becomes necessary to single out the case of only having a single
suggestion that's also highlighted.  Otherwise, `hlComplete` (condition:
`alwaysHighlight` is enabled) will loop forever.  This case can't be
handled from within hlComplete, as we are giving it incomplete
information to start with (by only calling it with the last word of the
current completion in `handleCompletion`), which is necessary for things
like completing arguments.
2021-04-06 19:46:21 +02:00
Tomas Janousek
78b6df0e69 Drop some recently added trailing whitespace 2021-04-05 21:24:43 +01:00
Yecine Megdiche
a668b0f13a Merge pull request from oogeek/X.L.Rename-KeepWordsLR
add KeepWordsLeft and KeepWordsRight for X.L.Renamed
2021-04-05 18:46:02 +01:00