diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-01-20 22:53:40 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-01-20 22:53:40 +0100 |
commit | 7b76723a6c33b50fffa6972b384169f11da217bd (patch) | |
tree | 37d2715af088e232a0c804594f6eab511c8772eb /accounts/gkleen@sif/xmonad/xmonad.hs | |
parent | c923294b84cdd22bc171337335735cd564f9a03c (diff) | |
download | nixos-7b76723a6c33b50fffa6972b384169f11da217bd.tar nixos-7b76723a6c33b50fffa6972b384169f11da217bd.tar.gz nixos-7b76723a6c33b50fffa6972b384169f11da217bd.tar.bz2 nixos-7b76723a6c33b50fffa6972b384169f11da217bd.tar.xz nixos-7b76723a6c33b50fffa6972b384169f11da217bd.zip |
gkleen@sif: ...
Diffstat (limited to 'accounts/gkleen@sif/xmonad/xmonad.hs')
-rw-r--r-- | accounts/gkleen@sif/xmonad/xmonad.hs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/accounts/gkleen@sif/xmonad/xmonad.hs b/accounts/gkleen@sif/xmonad/xmonad.hs index 1fb672bb..853fc47a 100644 --- a/accounts/gkleen@sif/xmonad/xmonad.hs +++ b/accounts/gkleen@sif/xmonad/xmonad.hs | |||
@@ -1,4 +1,4 @@ | |||
1 | {-# LANGUAGE TupleSections, ViewPatterns, OverloadedStrings, FlexibleInstances, UndecidableInstances, MultiWayIf #-} | 1 | {-# LANGUAGE TupleSections, ViewPatterns, OverloadedStrings, FlexibleInstances, UndecidableInstances, MultiWayIf, NumDecimals #-} |
2 | 2 | ||
3 | import XMonad | 3 | import XMonad |
4 | import XMonad.Hooks.DynamicLog | 4 | import XMonad.Hooks.DynamicLog |
@@ -215,6 +215,7 @@ hostFromName h | |||
215 | , assign "comm" $ className =? "Skype" | 215 | , assign "comm" $ className =? "Skype" |
216 | , assign "comm" $ className =? "Daily" | 216 | , assign "comm" $ className =? "Daily" |
217 | , assign "comm" $ className =? "Pidgin" | 217 | , assign "comm" $ className =? "Pidgin" |
218 | , assign "comm" $ className =? "Thunderbird" | ||
218 | , assign "comm" $ className =? "Slack" | 219 | , assign "comm" $ className =? "Slack" |
219 | , Just $ (resource =? "xvkbd") -?> doRectFloat $ RationalRect (1 % 8) (3 % 8) (6 % 8) (4 % 8) | 220 | , Just $ (resource =? "xvkbd") -?> doRectFloat $ RationalRect (1 % 8) (3 % 8) (6 % 8) (4 % 8) |
220 | , Just $ (stringProperty "_NET_WM_WINDOW_TYPE" =? "_NET_WM_WINDOW_TYPE_DIALOG") -?> doFloat | 221 | , Just $ (stringProperty "_NET_WM_WINDOW_TYPE" =? "_NET_WM_WINDOW_TYPE_DIALOG") -?> doFloat |
@@ -568,11 +569,15 @@ main = do | |||
568 | , ppSep = "\n" | 569 | , ppSep = "\n" |
569 | } | 570 | } |
570 | withHostUrgency = case hostname of | 571 | withHostUrgency = case hostname of |
571 | "hel" -> withUrgencyHookC urgencyHook' $ urgencyConfig { suppressWhen = U.Never, remindWhen = Dont } | 572 | "sif" -> withUrgencyHookC urgencyHook' $ urgencyConfig { suppressWhen = U.Never, remindWhen = Every 2 } |
572 | "sif" -> withUrgencyHookC urgencyHook' $ urgencyConfig { suppressWhen = U.Never, remindWhen = Dont } | ||
573 | _ -> id | 573 | _ -> id |
574 | urgencyHook' window = do | 574 | urgencyHook' window = do |
575 | runQuery ((resource =? "comm" <||> resource =? "Pidgin" <||> className =? "Gajim" <||> className =? "Skype") --> safeSpawn "thinklight" ["Blink", "100"]) window | 575 | let blinkLight = (lightHigh >> threadDelay 1e6) `finally` lightLow |
576 | where | ||
577 | lightHigh = | ||
578 | writeFile "/sys/class/leds/input0::capslock/brightness" =<< readFile "/sys/class/leds/input0::capslock/max_brightness" | ||
579 | lightLow = writeFile "/sys/class/leds/input0::capslock/brightness" "0" | ||
580 | runQuery ((resource =? "comm" <||> resource =? "Pidgin" <||> className =? "Gajim" <||> className =? "Skype" <||> className =? "Thunderbird") --> void (xfork blinkLight)) window | ||
576 | urgencyHook (BorderUrgencyHook { urgencyBorderColor = red }) window | 581 | urgencyHook (BorderUrgencyHook { urgencyBorderColor = red }) window |
577 | shutdown :: SomeException -> IO a | 582 | shutdown :: SomeException -> IO a |
578 | shutdown e = do | 583 | shutdown e = do |