From 7b76723a6c33b50fffa6972b384169f11da217bd Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 20 Jan 2022 22:53:40 +0100 Subject: gkleen@sif: ... --- accounts/gkleen@sif/taffybar/src/taffybar.hs | 1 + accounts/gkleen@sif/xmonad/xmonad.hs | 13 +++++++++---- overlays/pidgin.nix | 23 ++++++++++++++++++++++- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/accounts/gkleen@sif/taffybar/src/taffybar.hs b/accounts/gkleen@sif/taffybar/src/taffybar.hs index 728ccf2e..7dbb5c8e 100644 --- a/accounts/gkleen@sif/taffybar/src/taffybar.hs +++ b/accounts/gkleen@sif/taffybar/src/taffybar.hs @@ -39,6 +39,7 @@ exampleTaffybarConfig = Workspace{ workspaceName } | workspaceName == "NSP" -> False _other -> True , getWindowIconPixbuf = \i d -> either (\(_ :: SomeException) -> Nothing) id <$> mapReaderT try (defaultGetWindowIconPixbuf i d) + , urgentWorkspaceState = True } workspaces = workspacesNew myWorkspacesConfig clock = MyClock.textClockNewWith MyClock.defaultClockConfig 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 @@ -{-# LANGUAGE TupleSections, ViewPatterns, OverloadedStrings, FlexibleInstances, UndecidableInstances, MultiWayIf #-} +{-# LANGUAGE TupleSections, ViewPatterns, OverloadedStrings, FlexibleInstances, UndecidableInstances, MultiWayIf, NumDecimals #-} import XMonad import XMonad.Hooks.DynamicLog @@ -215,6 +215,7 @@ hostFromName h , assign "comm" $ className =? "Skype" , assign "comm" $ className =? "Daily" , assign "comm" $ className =? "Pidgin" + , assign "comm" $ className =? "Thunderbird" , assign "comm" $ className =? "Slack" , Just $ (resource =? "xvkbd") -?> doRectFloat $ RationalRect (1 % 8) (3 % 8) (6 % 8) (4 % 8) , Just $ (stringProperty "_NET_WM_WINDOW_TYPE" =? "_NET_WM_WINDOW_TYPE_DIALOG") -?> doFloat @@ -568,11 +569,15 @@ main = do , ppSep = "\n" } withHostUrgency = case hostname of - "hel" -> withUrgencyHookC urgencyHook' $ urgencyConfig { suppressWhen = U.Never, remindWhen = Dont } - "sif" -> withUrgencyHookC urgencyHook' $ urgencyConfig { suppressWhen = U.Never, remindWhen = Dont } + "sif" -> withUrgencyHookC urgencyHook' $ urgencyConfig { suppressWhen = U.Never, remindWhen = Every 2 } _ -> id urgencyHook' window = do - runQuery ((resource =? "comm" <||> resource =? "Pidgin" <||> className =? "Gajim" <||> className =? "Skype") --> safeSpawn "thinklight" ["Blink", "100"]) window + let blinkLight = (lightHigh >> threadDelay 1e6) `finally` lightLow + where + lightHigh = + writeFile "/sys/class/leds/input0::capslock/brightness" =<< readFile "/sys/class/leds/input0::capslock/max_brightness" + lightLow = writeFile "/sys/class/leds/input0::capslock/brightness" "0" + runQuery ((resource =? "comm" <||> resource =? "Pidgin" <||> className =? "Gajim" <||> className =? "Skype" <||> className =? "Thunderbird") --> void (xfork blinkLight)) window urgencyHook (BorderUrgencyHook { urgencyBorderColor = red }) window shutdown :: SomeException -> IO a shutdown e = do diff --git a/overlays/pidgin.nix b/overlays/pidgin.nix index 3c9fb93c..4c315f55 100644 --- a/overlays/pidgin.nix +++ b/overlays/pidgin.nix @@ -26,9 +26,30 @@ let ''; }; in { + pidgin-rocketchat = let + rev = "5c08ad0eacd39914d27b692d7eb42a94a991fb4c"; + in prev.stdenv.mkDerivation { + pname = "pidgin-rocketchat"; + version = builtins.substring 0 8 rev; + + src = prev.fetchFromGitHub { + owner = "EionRobb"; + repo = "purple-rocketchat"; + inherit rev; + hash = "sha256-UBIp5tpj4Xfo+mPhY51+rzs+ojKr90zWK+XLiK7XvWM="; + }; + + nativeBuildInputs = with final; [ pidgin json-glib glib discount ]; + + installFlags = [ + "ROCKETCHAT_DEST=$(out)/lib/purple-2" + "ROCKETCHAT_ICONS_DEST=$(out)/share/pixmaps/pidgin/protocols" + ]; + }; + pidgin-with-plugins = pidginWrapper { inherit (prev) makeWrapper symlinkJoin; - plugins = with final; [ purple-lurch pidgin-carbons pidgin-opensteamworks pidgin-xmpp-receipts ]; + plugins = with final; [ purple-lurch pidgin-carbons pidgin-opensteamworks pidgin-xmpp-receipts pidgin-rocketchat ]; pidgin = prev.pidgin.overrideAttrs (oldAttrs: { patches = (oldAttrs.patches or []) ++ [mucHistory]; }); -- cgit v1.2.3