Commit Graph

4122 Commits

Author SHA1 Message Date
brandon s allbery kf8nh
84f928068f versions of pass functions with user-specified prompt
By request of a user on IRC
2022-08-20 17:18:00 -04:00
Tony Zorman
40171824cd Merge pull request #742 from slotThe/sideborderdec
New module: XMonad.Layout.SideBorderDecoration
2022-08-19 09:54:03 +02:00
Tony Zorman
7185b28e09 New module: XMonad.Layout.SideBorderDecoration
New module that allows for having a configurable border position around
windows.  Originally found in a comment by L. S. Leary in [1].  Enough
people have requested this on IRC in recent memory to warrant a proper
module.

[1]: https://github.com/xmonad/xmonad/issues/152#issuecomment-362716434

Co-authored-by: L. S. Leary <LSLeary@users.noreply.github.com>
2022-08-19 09:43:02 +02:00
Tony Zorman
284463a172 X.U.Parser: Give (Parser a) an IsString instance when a ~ String
When the -XOverloadedStrings language extension is on, treat a string s
as the parser 'string' s, when appropriate.  This allows one to write
things like "a" *> otherParser instead of 'string' "a" *> otherParser.
2022-08-19 09:37:07 +02:00
Tony Zorman
df3d0aa057 X.U.Run: Use isPrefixOf in withEmacsLibs
The `lisp` and `elpa` lists will simply be the (unqualified) file names.
Thus, if we use isInfixOf and try to require a library with a very short
name (like s.el), other things may be chosen over it.  isPrefixOf,
together with the additional `-`, prevents this from happening.
2022-08-16 07:38:18 +02:00
Tony Zorman
ee97eec17d Remove all remaining occurences of defaultTConf
Data.Default deprecations were removed in
5140f5b5d0, yet some comments still refer
to defaultTConf—fix that.

Related: 6b4675e3fa
2022-08-03 10:06:23 +02:00
brandon s allbery kf8nh
6b4675e3fa fix some deprecated and removed defaultTConfs 2022-08-02 19:37:18 -04:00
Tony Zorman
0934fe5cd7 X.U.Grab: Hide mkGrabs from XMonad
With [1] merged, the XMonad module from core now exports mkGrabs and
setNumlockMask (now cacheNumlockMask).  However, since we want
xmonad-contrib 0.17.1 to compile against xmonad 0.17.0 still, hide the
function for now and continue to use the vendored copies we have in
X.U.Grab currently.  We have to ignore the dodgy-imports warning when
-fpedantic is on, but that seems like a small price to pay.

A breaking change for this is planned for 0.18.0.

[1]: https://github.com/xmonad/xmonad/pull/405
2022-08-02 09:57:32 +02:00
Tony Zorman
8268cdde26 Merge pull request #736 from geekosaur/EWMH-windowDebug
print EWMH type and state in debugWindow
2022-07-29 09:10:02 +02:00
brandon s allbery kf8nh
607fdc2a12 print EWMH type and state in debugWindow 2022-07-28 10:18:11 -04:00
Yecine Megdiche
0a3fa0c3ed Merge pull request #737 from geekosaur/bits-warning
silence warning about extraneous Data.Bits import
2022-07-26 12:39:20 +02:00
brandon s allbery kf8nh
1aad21e866 silence Data.Bits warning
I had missed that `(.&.)` was already being imported from
`XMonad.Prelude`.
2022-07-25 20:25:48 -04:00
Tomas Janousek
8da08b8848 scripts: Include xmonad{ctl,propread}.hs in the release tarball
Last year I thought a bit about making this an actual `executable` in
xmonad-contrib.cabal, but decided against it. Unfortunately I can't
remember why. So let's do the bare minimum to at least ship it now, and
if I remember or if anyone has any ideas, we can do the next step or
document why not.

Fixes: https://github.com/xmonad/xmonad-contrib/issues/734
2022-07-12 22:17:36 +01:00
Tomas Janousek
a45ecd3779 scripts: Drop obsolete grabDescriptions.hs
We haven't used this for a while, and since we dropped descriptions in
X.D.Extending in favor of the haddock-generated index in
839302533b, it's useless.
2022-07-12 22:13:31 +01:00
Tomas Janousek
820a2f75de scripts: Drop obsolete generate-configs
The last time this could work was 2007
(1e35714e1e).
2022-07-12 22:10:44 +01:00
brandon s allbery kf8nh
2a6ac58c71 change a defaultGSConfig doc to a def 2022-07-12 14:25:13 -04:00
Tomáš Janoušek
ea97c3562f Merge pull request #732 from liskin/getppidof
X.A.SpawnOn, X.H.WindowSwallowing: Fix parsing of process PPIDs
2022-07-06 09:03:20 +01:00
Tomas Janousek
fc482b8771 X.A.SpawnOn, X.H.WindowSwallowing: Fix parsing of process PPIDs
This fixes several issues related to parsing of parent PIDs:

* A process with lines or spaces or parentheses in its process name
  would confuse the code in X.A.SpawnOn and possibly lead to a
  `Prelude.read: no parse` exception.

* `X.H.WindowSwallowing.isChildOf` looked for the parent PID anywhere in
  the output of pstree, so single-digit parent PIDs would be considered
  as parents of any process with that digit anywhere in its chain of
  parent PIDs. (Note that apps in PID namespaces like in Flatpak often
  have single-digit PIDs.)

* `pstree` is no longer required in `$PATH`.

Fixes: https://github.com/xmonad/xmonad-contrib/issues/726
2022-07-06 09:00:35 +01:00
brandon s allbery kf8nh
5557944fb6 Proper fix for alpha channel mishandling
X11 only handles alpha channels in a restricted set of APIs (such as
setting `border_color`); most others throw undocumented errors and/or
produce black pixels. Document this, and mask out alpha where it
matters.

Fixes xmonad/xmonad#395, xmonad/xmonad#398.
2022-07-05 17:34:49 -04:00
Tony Zorman
ebdb079a94 Merge pull request #727 from ilya-bobyr/master
X.H.UrgencyHook: Default for DzenUrgencyHook and UrgencyConfig
2022-07-05 08:32:35 +02:00
Illia Bobyr
3e7b22fe9b X.H.UrgencyHook: Default for DzenUrgencyHook and UrgencyConfig
As the XMonad config is commonly customized by saying

    def { startupHook = ...
        , manageHook = ...
        , ...
        }

It seems consistent to allow the same for an individual hook config:

    let urgencyHook = def { suppressWhen = ...
                          , remindWhen = ...
                          }
2022-07-05 08:28:59 +02:00
Tony Zorman
839bc907ba Merge pull request #730 from slotThe/nsp-fix
X.U.NamedScratchpad: Initialise if necessary
2022-07-03 13:32:20 +02:00
Tony Zorman
7a33639aaa X.U.NamedScratchpads: Fill NSPState when necessary
Since 3fc830aa09, scratchpads are now
added in namedScratchpadManageHook.  This, however, means that we need
some kind of MapRequestEvent to happen before processing scratchpads,
otherwise the manageHook didn't run yet and our extensible state is
being left empty.  When trying to open a scratchpad right after starting
xmonad—i.e., before having opened a window—this may not be the case.

Fixes: https://github.com/xmonad/xmonad-contrib/issues/728
2022-07-03 12:24:44 +02:00
Tony Zorman
a4c73ad090 Merge pull request #729 from slotThe/modal-fixups
X.H.Modal: Add EZConfig support
2022-07-02 17:28:00 +02:00
Tony Zorman
8ddc1f48e2 X.H.Modal: Update documentation
Now that we use a slightly different setup, as well as EZConfig support,
rewrite the introduction to the module a little.
2022-07-02 17:27:33 +02:00
Tony Zorman
fe337dc6b0 X.H.Modal: Add support for EZConfig-style bindings
Add support for EZConfig-style bindings while also maintaining some
guarantees as to which type of representation we will store in the
extensible state.  This means that parsing of the keys will happen no
later than the call to `modal`.

Users can choose to use `mkKeysEz` or `mkKeysFun` to create a new
collection of keys to bind for a mode.  This is deemed more ergonomic
than exporting the respective constructors directly.
2022-07-02 17:27:33 +02:00
Tony Zorman
87a36d7d31 X.H.Modal: Cleanup
Mostly small things, like making imports line up with the provided
comments.  Also:

+ Rename mode' -> modeWithExit.  This seems like a better name for
  discoverability reasons.

+ Make the fields of Mode strict, because they have no reason not to,
  really.
2022-06-29 15:00:40 +02:00
Yecine Megdiche
0891575518 New module: XMonad.Hooks.Modal
Based on the draft by L. S.
Leary.  (https://gist.github.com/LSLeary/6741b0572d62db3f0cea8e6618141b2f).
2022-06-28 22:27:29 +02:00
Yecine Megdiche
8b2594a526 New Module: XMonad.Util.Grab
Based on the draft by L. S.
Leary.  (https://gist.github.com/LSLeary/6741b0572d62db3f0cea8e6618141b2f).
2022-06-28 22:27:29 +02:00
brandon s allbery kf8nh
6e1a1fe0df Stray def in additionalNav2DKeysP documentation 2022-06-24 19:47:14 -04:00
Tony Zorman
4287bab252 XMonad.Util.Run: Add quote
This is quite convenient in arguments; e.g.,

    progn [ "fun1" <> asString "string"
          , "fun2" <> quote "symbol"
          ]
2022-06-22 17:23:45 +02:00
Tony Zorman
2643528945 Merge pull request #725 from emptyflask/emptyflask/centered-if-single
CenteredIfSingle allow resizing in both dimensions
2022-06-21 13:22:29 +02:00
Jon Roberts
accea5b1d8 X.L.CenteredIfSingle: Allow specifying ratio in both dimensions
While monitors are, more often than not, wider than they are high,
specifying a ratio in the vertical direction can also make sense; e.g.,
when flipping a monitor by 90 degrees.  Thus, we should definitely
support both.
2022-06-21 13:16:50 +02:00
Tomas Janousek
0d5a952035 ci: Prevent scheduled workflows from being auto-disabled by GitHub 2022-06-19 17:14:24 +01:00
brandon s allbery kf8nh
f998cc2d2e Complete #708 by updating _NET_SUPPORTED. 2022-05-29 20:24:47 -04:00
Tony Zorman
a88d6328fe Merge pull request #718 from slotThe/spawn-external
Extend X.U.Run with an EDSL for spawning processes
2022-05-24 08:18:57 +02:00
Tony Zorman
b6be0dca40 X.U.Run: Add examples to Haddocks 2022-05-23 20:12:57 +02:00
Tony Zorman
e466d9b1dc X.Prelude: Add mkAbsolutePath 2022-05-23 20:12:57 +02:00
Tony Zorman
473dc41afb X.U.Run: Improve and add documentation
This adds documentation for the new EDSL, as well as small fixes to
existing docs.

Importantly, I've added myself as a maintainer of the file (even though
we don't really care about this at this point) and updated the
copyright; the changes seem large enough to warrant this.
2022-05-23 20:12:57 +02:00
Tony Zorman
2b48f3ff09 X.U.Run: Add an EDSL to spawn external programs
Extend X.U.Run with an EDSL for spawning (external) processes.  For
example:

    do url <- getSelection  -- from XMonad.Util.XSelection
       proc $ inEmacs
          >-> withEmacsLibs [ElpaLib "dash", ElpaLib "s", OwnFile "arXiv-citation"]
          >-> asBatch
          >-> execute (elispFun $ "arXiv-citation" <> asString url)

is essentially equivalent to (line breaks mine)

    /usr/bin/sh -c "emacs -L /home/slot/.config/emacs/elpa/dash-20220417.2250
                          -L /home/slot/.config/emacs/elpa/s-20210616.619
                          -l /home/slot/.config/emacs/lisp/arXiv-citation.el
                          --batch
                          -e '(arXiv-citation \"<url-in-the-primary-selection>\")'"
2022-05-23 20:11:29 +02:00
brandon s allbery kf8nh
67243cbf7c the rest of the fix for #719
It's just two more exports.
2022-05-08 09:27:56 -04:00
brandon s allbery kf8nh
41674386a6 Export shrinkText
Closes #719.
(This being a trivial one-line change and the description being already bigger than the change, I'm committing it directly.)
2022-05-08 09:06:18 -04:00
Tony Zorman
616222c9f0 stack: Bump default resolver to 19.6
No impact on CI, just makes it easier for contributors to use the latest
9.0 GHC.
2022-05-07 09:39:19 +02:00
Tony Zorman
21e613e242 Merge pull request #717 from Pachin0/desktop-viewport
X.H.EwmhDesktops: Add `_NET_DESKTOP_VIEWPORT` support
2022-05-06 08:51:33 +02:00
Jose Antonio Martinez Vidaurre
2291d3a009 X.H.EwmhDesktops: Add _NET_DESKTOP_VIEWPORT support
Some panels—such as polybar—require _NET_DESKTOP_VIEWPORT support in
order to know which workspace is on which monitor.  They are then able
to only show workspaces defined on the same output as the bar with just
X11 properties.

Fixes: https://github.com/xmonad/xmonad-contrib/issues/708
2022-05-06 08:12:13 +02:00
Tony Zorman
6c787204aa Update my name 2022-05-05 21:07:27 +02:00
Tony Zorman
4a982e54c9 Merge pull request #711 from LSLeary/flake-module
Apply Patch in Nix Flake; Enable Configuration (Contrib Edition)
2022-05-04 20:53:31 +02:00
L. S. Leary
6ab69e97d3 NIX.md: Document the NixOS modules provided by the core and contrib flakes.
flake.nix: Assume maintainership.
2022-05-04 19:20:13 +12:00
Tony Zorman
0e14e13845 Merge pull request #716 from johnli360/master
Replace <+> with <>
2022-05-02 17:52:01 +02:00
John Lind
a7fd31d233 Replace <+> with <> 2022-05-02 08:28:36 +02:00