From 12736c81110c07c7005b2a13f591f8089d9e246c Mon Sep 17 00:00:00 2001 From: Icy-Thought Date: Thu, 6 Jul 2023 07:50:00 +0200 Subject: [PATCH] =?UTF-8?q?[=F0=9D=9A=AB]=20(XMonad):=20`emacs-everywhere`?= =?UTF-8?q?=20binding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/xmonad/xmonad.hs | 39 ++++++++++++++++++----------- flake.lock | 8 +++--- modules/desktop/skeleton/xmonad.nix | 1 + 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/config/xmonad/xmonad.hs b/config/xmonad/xmonad.hs index 34c1f63f..ad70393c 100644 --- a/config/xmonad/xmonad.hs +++ b/config/xmonad/xmonad.hs @@ -733,28 +733,33 @@ swapMinimizeStateAfter action = withFocused $ \originalWindow -> do -- :NOTE| Introduction of our namedScratchpads myScratchpads :: X [NamedScratchpad] myScratchpads = do + -- | A system monitor to track the madness in our conf btopLaunch <- getInput $ - inTerm >-> setXClass sysMonClass + inTerm >-> setXClass sysMonID >-> execute "btop" + -- | E-Mail session managed by Emacs, because why not? :P mailSession <- getInput $ - inEditor >-> setFrameName mailInst + inEditor >-> setFrameName mailSessionID >-> eval (elispFun "notmuch") - pure [ NS "Discord" "discordcanary" (className =? "discord") nearFullFloat - , NS "EasyEffects" "easyeffects" (title =? "Easy Effects") nearFullFloat - , NS "Emacs" "emacsclient -c" (className =? "Emacs") nearFullFloat - , NS "Mail" mailSession (appName =? mailInst) nearFullFloat - , NS "Matrix" "element-desktop" (className =? "Element") nearFullFloat - , NS "Spotify" "spotify" (className =? "Spotify") nearFullFloat - , NS "System Monitor" btopLaunch (appName =? sysMonClass) nearFullFloat - , NS "Telegram" "telegram-desktop" (className =? "TelegramDesktop") nearFullFloat - , NS "Transmission" "transmission-gtk" (className =? "Transmission-gtk") nearFullFloat + pure [ NS "Discord" "discordcanary" (className =? "discord") floatCenter + , NS "EasyEffects" "easyeffects" (title =? "Easy Effects") floatCenter + , NS "Emacs" "emacsclient -c" (className =? "Emacs") floatCenter + , NS "Mail" mailSession (appName =? mailSessionID) floatCenter + , NS "Matrix" "element-desktop" (className =? "Element") floatCenter + , NS "Spotify" "spotify" (className =? "Spotify") floatCenter + , NS "System Monitor" btopLaunch (appName =? sysMonID) floatCenter + , NS "Telegram" "telegram-desktop" (className =? "TelegramDesktop") floatCenter + , NS "Transmission" "transmission-gtk" (className =? "Transmission-gtk") floatCenter ] where - mailInst = "notmuch-scratch" - sysMonClass = "system-monitor" - nearFullFloat = customFloating $ W.RationalRect 0.02 0.02 0.95 0.95 + mailSessionID = "notmuch-scratch" + sysMonID = "system-monitor" + + -- | Defining our custom floats + floatCenter = customFloating $ W.RationalRect (1/50) (1/50) (19/20) (19/20) + floatTopLeft = customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3) myScratchPadManageHook = namedScratchpadManageHook =<< liftX myScratchpads @@ -909,11 +914,17 @@ addKeys conf@XConfig { modMask = modm } = , ((modalt, xK_e), doScratchpad "Emacs") , ((modalt, xK_l), doScratchpad "Telegram") , ((modalt, xK_m), doScratchpad "mailSession") + , ((modalt, xK_r), doScratchpad "PlanetEmacs") , ((modalt, xK_s), doScratchpad "Spotify") , ((modalt, xK_t), doScratchpad "Transmission") , ((modalt, xK_v), doScratchpad "EasyEffects") -- :NOTE| Program-specific launches + , ((hyper, xK_r), do + planetEmacs <- getInput $ + inEditor >-> setFrameName "planetEmacs" + >-> eval (elispFun "emacs-everywhere") + spawn planetEmacs) -- Rofi(s) , ((modm, xK_p), spawn "rofi -show power-menu") , ((modalt, xK_p), spawn "rofi -show drun") diff --git a/flake.lock b/flake.lock index 4e51b88b..d78172d3 100644 --- a/flake.lock +++ b/flake.lock @@ -174,11 +174,11 @@ "emacs-dir": { "flake": false, "locked": { - "lastModified": 1688514036, - "narHash": "sha256-36LecRwEFc0ZwdMJO3g0VfSCVmiJyLOWW9lYu9GkzLI=", + "lastModified": 1688622517, + "narHash": "sha256-abXa73Nq7kSD+Mvzj+WkT53q4EzVR54WARk2Yrdguys=", "ref": "refs/heads/main", - "rev": "69d3597e14317ff5cf2303f4630374c08f719408", - "revCount": 179, + "rev": "5b68774783e15b748f0b830f25812fc95490057a", + "revCount": 180, "submodules": true, "type": "git", "url": "https://github.com/Icy-Thought/emacs.d.git" diff --git a/modules/desktop/skeleton/xmonad.nix b/modules/desktop/skeleton/xmonad.nix index eb2ec53a..d326381f 100644 --- a/modules/desktop/skeleton/xmonad.nix +++ b/modules/desktop/skeleton/xmonad.nix @@ -46,6 +46,7 @@ in { environment.systemPackages = attrValues { inherit (pkgs) libnotify playerctl gxmessage xdotool feh; + inherit (pkgs.xorg) xwininfo; }; services.greetd = {