summaryrefslogtreecommitdiffstats
path: root/lass/5pkgs
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-02-13 17:37:48 +0100
committerlassulus <lassulus@lassul.us>2018-02-13 17:37:48 +0100
commit75eaf9cf08e6f19d287c0b3aec16663b47f7e367 (patch)
tree81f11fc2b1900419fce5f51d63cac7421efe6bab /lass/5pkgs
parentdc2b6931ebfb775f715bc1c3837c20463bcb2418 (diff)
l xmonad: send urgency to dbus
Diffstat (limited to 'lass/5pkgs')
-rw-r--r--lass/5pkgs/xmonad-lass.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/lass/5pkgs/xmonad-lass.nix b/lass/5pkgs/xmonad-lass.nix
index 2dd352bd4..f6e916104 100644
--- a/lass/5pkgs/xmonad-lass.nix
+++ b/lass/5pkgs/xmonad-lass.nix
@@ -36,7 +36,7 @@ import XMonad.Hooks.FloatNext (floatNextHook)
import XMonad.Hooks.ManageDocks (avoidStruts, ToggleStruts(ToggleStruts))
import XMonad.Hooks.Place (placeHook, smart)
import XMonad.Hooks.UrgencyHook (focusUrgent)
-import XMonad.Hooks.UrgencyHook (SpawnUrgencyHook(..), withUrgencyHook)
+import XMonad.Hooks.UrgencyHook (withUrgencyHook, UrgencyHook(..))
import XMonad.Layout.FixedColumn (FixedColumn(..))
import XMonad.Layout.Minimize (minimize, minimizeWindow, MinimizeMsg(RestoreNextMinimizedWin))
import XMonad.Layout.NoBorders (smartBorders)
@@ -44,9 +44,20 @@ import XMonad.Layout.SimplestFloat (simplestFloat)
import XMonad.Prompt (autoComplete, font, searchPredicate, XPConfig)
import XMonad.Prompt.Window (windowPromptGoto, windowPromptBringCopy)
import XMonad.Util.EZConfig (additionalKeysP)
+import XMonad.Util.NamedWindows (getName)
+import XMonad.Util.Run (safeSpawn)
import XMonad.Stockholm.Shutdown
+data LibNotifyUrgencyHook = LibNotifyUrgencyHook deriving (Read, Show)
+
+instance UrgencyHook LibNotifyUrgencyHook where
+ urgencyHook LibNotifyUrgencyHook w = do
+ name <- getName w
+ Just idx <- fmap (W.findTag w) $ gets windowset
+
+ safeSpawn "${pkgs.libnotify}/bin/notify-send" [show name, "workspace " ++ idx]
+
myTerm :: FilePath
myTerm = "${pkgs.rxvt_unicode_with-plugins}/bin/urxvtc"
@@ -61,7 +72,7 @@ main = getArgs >>= \case
main' :: IO ()
main' = do
xmonad $ ewmh
- $ withUrgencyHook (SpawnUrgencyHook "echo emit Urgency ")
+ $ withUrgencyHook LibNotifyUrgencyHook
$ def
{ terminal = myTerm
, modMask = mod4Mask