Skip to content

Commit da5566d

Browse files
committed
X.H.ManageHelpers: isNotification predicate
Very similar to `isDialog`, `isNotification` checks for the `_NET_WM_WINDOW_TYPE_NOTIFICATION` value in the `_NET_WM_WINDOW_TYPE` property.
1 parent 8219170 commit da5566d

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

Diff for: CHANGES.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
### New Modules
88

99
* `XMonad.Actions.Profiles`.
10-
10+
1111
- Group workspaces by similarity. Usefull when one has lots
1212
of workspaces and uses only a couple per unit of work.
1313

@@ -19,9 +19,14 @@
1919

2020
- Fixed `checkKeymap` warning that all keybindings are duplicates.
2121

22+
* `XMonad.Hooks.ManageHelpers`
23+
24+
- Added `isNotification` predicate to check for windows with
25+
`_NET_WM_WINDOW_TYPE` property of `_NET_WM_WINDOW_TYPE_NOTIFICATION`.
26+
2227
### Other changes
2328

24-
## 0.18.0 (February 3, 20
29+
## 0.18.0 (February 3, 2024)
2530

2631
### Breaking Changes
2732

Diff for: XMonad/Hooks/ManageHelpers.hs

+10
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module XMonad.Hooks.ManageHelpers (
5151
isFullscreen,
5252
isMinimized,
5353
isDialog,
54+
isNotification,
5455
pid,
5556
desktop,
5657
transientTo,
@@ -191,9 +192,18 @@ isMinimized :: Query Bool
191192
isMinimized = isInProperty "_NET_WM_STATE" "_NET_WM_STATE_HIDDEN"
192193

193194
-- | A predicate to check whether a window is a dialog.
195+
--
196+
-- See <https://specifications.freedesktop.org/wm-spec/wm-spec-1.5.html#idm46485863906176>.
194197
isDialog :: Query Bool
195198
isDialog = isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_DIALOG"
196199

200+
-- | A predicate to check whether a window is a notification.
201+
--
202+
-- See <https://specifications.freedesktop.org/wm-spec/wm-spec-1.5.html#idm46485863906176>.
203+
isNotification :: Query Bool
204+
isNotification =
205+
isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_NOTIFICATION"
206+
197207
-- | This function returns 'Just' the @_NET_WM_PID@ property for a
198208
-- particular window if set, 'Nothing' otherwise.
199209
--

0 commit comments

Comments
 (0)