From 6cea771c91fa1c67e7abbd5ee9c80121e99a893d Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 16 Sep 2022 03:35:35 +0100 Subject: updates for latest emacs interface --- xmonad.hs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/xmonad.hs b/xmonad.hs index b9d98e3..2fa418c 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -1,6 +1,8 @@ {-# LANGUAGE FlexibleContexts #-} import qualified Data.Map as M +import Data.List (stripPrefix) +import Data.Maybe (fromMaybe) import System.Environment (lookupEnv) import XMonad hiding ( (|||) ) @@ -88,7 +90,7 @@ lightPopConfig = popConfig { P.fgColor = "grey10" , P.borderColor = "grey70" } -defWorkspaces = ["E", "F", "D"] +defWorkspaces = ["e", "f", "d"] isEmacs = className =? "Emacs" <||> title =? "emacsclient" isntEmacs = not `fmap` isEmacs @@ -103,8 +105,6 @@ isMusic = className =? "Tidal" runOrRaiseFirefox = runOrRaise "firefox" $ className =? "Firefox" --- runOrRiseMusic = raiseMaybe (spawn openMusicWindow) isMusic - toggleEmacs other = do ems <- mapM (WP.focusedHasProperty . WP.ClassName) ["Emacs"] ems' <- WP.focusedHasProperty (WP.Title "emacsclient") @@ -116,7 +116,7 @@ zathuraToEmacs = do z <- WP.focusedHasProperty (WP.ClassName "Zathura") tl <- if z then currentWindowName else return Nothing case tl of - Just fn -> emacsclient ("jao-zathura-goto-org \"" ++ fn ++ "\"") + Just fn -> emacsclient ("jao-x11-zathura-goto-org \"" ++ fn ++ "\"") Nothing -> return () keyDefs conf = @@ -147,14 +147,14 @@ keyDefs conf = , ("M-a", scratch "aptitude") , ("M-b", sendMessage $ MD.ToggleStruts) , ("M-S-d", scratch "tidal") - , ("M-d", toggleEmacs $ windows (W.greedyView "D")) + , ("M-d", toggleEmacs $ windows (W.greedyView "d")) , ("M-e", toggleEmacs runOrRaiseFirefox) , ("M-C-e", spawn "emacsclient -c") , ("M-S-e", spawn (jaoscript "eterm")) , ("M-p", zathuraToEmacs >> raiseEmacs) , ("M-m", raiseEmacs >> emacsclient "jao-transient-media") , ("M-r", bindFirst [(isntEmacs, runCmd), - (pure True, emacsclient "jao-recoll-transient")]) + (pure True, emacsclient "jao-transient-recoll")]) , ("M-S-r", runCmd) , ("M-s", raiseEmacs >> emacsclient "jao-transient-streaming") , ("M-S-s", withFocused $ windows . W.sink) @@ -169,12 +169,14 @@ keyDefs conf = , ("M-x S-g", GS.bringSelected GS.def) , ("M-x f", jumpToL "F") , ("M-x l", jumpToLE "L") + , ("M-x n", CWS.nextWS) + , ("M-x S-n", CWS.shiftToNext) , ("M-x r", jumpToLE "R") , ("M-x t", jumpToLE "T") , ("M-x w", PW.windowPrompt conf { P.autoComplete = Just 500000 } PW.Bring PW.allWindows) - , ("M-x n", sendMessage NextLayout) + -- , ("M-x n", sendMessage NextLayout) , ("M-S-x", XmP.xmonadPrompt $ conf {P.position = P.Top}) , ("M-z l", xdgscr "activate") , ("M-z u", spawn "toggle-screensaver.sh") @@ -184,7 +186,7 @@ keyDefs conf = , ("M-z l", i3lock) ] where jumpToL x = sendMessage (LJ.JumpToLayout x) >> return () withEmacs x = jumpToL "F" >> raiseEmacs >> emacsclient x - emacsAfio f = withEmacs $ "jao-afio--goto-" ++ f + emacsAfio f = withEmacs $ "jao-afio-goto-" ++ f -- sendCtrlC = sendKey controlMask xK_c jumpToLE x = emacsAfio "scratch-1" >> jumpToL x backlight x = spawn $ "brightnessctl -q s " ++ x @@ -196,7 +198,7 @@ keyDefs conf = resize a b = withFocused $ keysResizeWindow a b scratch = NS.namedScratchpadAction scratchpads -layouts = PW.onWorkspace "D" lytTall lytFullTall +layouts = PW.onWorkspace "d" lytTall lytFullTall where spacing n = SP.spacingRaw False (SP.Border n 0 n 0) True (SP.Border 0 n 0 n) True @@ -233,12 +235,13 @@ mHook = MH.composeOne dlgs <+> composeAll (emf:cl) simplePP = SBP.def { SBP.ppLayout = const "" , SBP.ppHidden = const "" , SBP.ppCurrent = SBP.xmobarColor "gray40" "" - , SBP.ppTitle = ellipsis 25 - , SBP.ppSep = " " + , SBP.ppTitle = ellipsis 35 . stripOrg + , SBP.ppSep = ":" , SBP.ppUrgent = const (SBP.xmobarColor "orangered3" "" "*") } where ellipsis n s | length s > n = take (n - 3) s ++ " ..." | otherwise = s + stripOrg s = fromMaybe s (stripPrefix "~/org/doc/" s) main = do scheme <- lookupEnv "JAO_COLOR_SCHEME" -- cgit v1.2.3