From bd20e1c71fc834bc3f19468b96aa284b3e54169a Mon Sep 17 00:00:00 2001 From: Ihar Hancharenka Date: Wed, 13 Sep 2023 13:47:59 +0300 Subject: [PATCH] m --- .../wm/tiling/i3/tools/notification-dunst.txt | 6 ++++ .../bars/xmobar/features/tray/resize.txt | 34 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/os/x-ui/wm/tiling/i3/tools/notification-dunst.txt b/os/x-ui/wm/tiling/i3/tools/notification-dunst.txt index c1e8a9c5b..beac278c7 100644 --- a/os/x-ui/wm/tiling/i3/tools/notification-dunst.txt +++ b/os/x-ui/wm/tiling/i3/tools/notification-dunst.txt @@ -1 +1,7 @@ +https://dunst-project.org/ + +https://github.com/dunst-project/dunst +https://gist.github.com/NNBnh/5f6e601a6a82a6ed43b1959698758141 + https://github.com/NNBnh/dotfiles + https://wiki.archlinux.org/index.php/Dunst diff --git a/os/x-ui/wm/tiling/xmonad/bars/xmobar/features/tray/resize.txt b/os/x-ui/wm/tiling/xmonad/bars/xmobar/features/tray/resize.txt index 7f40beac3..7686ab807 100644 --- a/os/x-ui/wm/tiling/xmonad/bars/xmobar/features/tray/resize.txt +++ b/os/x-ui/wm/tiling/xmonad/bars/xmobar/features/tray/resize.txt @@ -35,3 +35,37 @@ kmonad https://github.com/kmonad/kmonad https://www.youtube.com/watch?v=Dhj1eauljwU https://github.com/kmonad/kmonad/blob/master/keymap/tutorial.kbd + +my code + +-- from upstream Hacks + +-- | A fully generic tray resize hook that invokes a callback whenever a +-- tray-like window changes width. +trayPaddingEventHook + :: Query Bool -- ^ query to identify the tray window + -> (Int -> X ()) -- ^ action to perform when tray width changes + -> Event -> X All -- ^ resulting event hook +trayPaddingEventHook trayQ widthChanged ConfigureEvent{ ev_window = w, ev_width = wa } = do + whenX (runQuery trayQ w) $ widthChanged (fi wa) + mempty +trayPaddingEventHook _ _ _ = mempty + + +-- | A generic version of 'trayerPaddingXmobarEventHook' that +-- allows the user to specify how to identify a tray window and the property +-- to use with 'xmonadPropLog''. This is useful for other trays like +-- stalonetray and also when space for more than one tray-like window needs to +-- be reserved. +trayPaddingXmobarEventHook + :: Query Bool -- ^ query to identify the tray window + -> String -- ^ 'xmonadPropLog'' property to use + -> Event -> X All -- ^ resulting event hook +trayPaddingXmobarEventHook trayQ prop = trayPaddingEventHook trayQ hspaceLog + where hspaceLog width = xmonadPropLog' prop ("") + +-- | A simple trayer/xmobar-specific event hook that watches for trayer window +-- resize changes and updates the _XMONAD_TRAYPAD property with xmobar markup +-- that leaves a gap for the myTray. +myTrayPaddingXmobarEventHook :: Event -> X All -- ^ event hook +myTrayPaddingXmobarEventHook = trayPaddingXmobarEventHook (className =? myTray) "_XMONAD_TRAYPAD"