summaryrefslogtreecommitdiffstats
path: root/lass/5pkgs
diff options
context:
space:
mode:
authornin <nin@c-base.org>2018-02-27 22:30:49 +0100
committernin <nin@c-base.org>2018-02-27 22:30:49 +0100
commit01289f333143fa145fe585812d05672efd3f3ebe (patch)
treed6de52e9914cd6489cbad61ae7c6fb60ad472c41 /lass/5pkgs
parentf20bf1a7ba146b3ffe3f2e470614d12885cbce61 (diff)
parent9e67031cb878c0bcdcde39a7b7b746111de6719a (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'lass/5pkgs')
-rw-r--r--lass/5pkgs/xmonad-lass.nix19
1 files changed, 16 insertions, 3 deletions
diff --git a/lass/5pkgs/xmonad-lass.nix b/lass/5pkgs/xmonad-lass.nix
index 2dd352bd4..59c95cff7 100644
--- a/lass/5pkgs/xmonad-lass.nix
+++ b/lass/5pkgs/xmonad-lass.nix
@@ -23,6 +23,7 @@ import XMonad
import qualified XMonad.StackSet as W
import Control.Monad.Extra (whenJustM)
import Data.List (isInfixOf)
+import Data.Monoid (Endo)
import System.Environment (getArgs, lookupEnv)
import System.Posix.Process (executeFile)
import XMonad.Actions.CopyWindow (copy, kill1)
@@ -36,7 +37,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 +45,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 +73,7 @@ main = getArgs >>= \case
main' :: IO ()
main' = do
xmonad $ ewmh
- $ withUrgencyHook (SpawnUrgencyHook "echo emit Urgency ")
+ $ withUrgencyHook LibNotifyUrgencyHook
$ def
{ terminal = myTerm
, modMask = mod4Mask
@@ -80,11 +92,12 @@ myLayoutHook = defLayout
where
defLayout = minimize $ ((avoidStruts $ Tall 1 (3/100) (1/2) ||| Full ||| Mirror (Tall 1 (3/100) (1/2))) ||| FixedColumn 2 80 80 1 ||| simplestFloat)
+floatHooks :: Query (Endo WindowSet)
floatHooks = composeAll . concat $
[ [ title =? t --> doFloat | t <- myTitleFloats]
, [ className =? c --> doFloat | c <- myClassFloats ] ]
where
- myTitleFloats = [] -- for the KDE "open link" popup from konsole
+ myTitleFloats = []
myClassFloats = ["Pinentry"] -- for gpg passphrase entry