summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/xmonad/xmonad.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-10-22 19:33:45 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2022-10-22 19:33:45 +0200
commitddcc8c65e30a9ca3b56e25466e749cb100b28510 (patch)
tree869c782c4e5874d4d353d3cd82af5b0e2dfe9a45 /accounts/gkleen@sif/xmonad/xmonad.hs
parent0b7bd91465487426041c777a40de3be9f7407058 (diff)
downloadnixos-ddcc8c65e30a9ca3b56e25466e749cb100b28510.tar
nixos-ddcc8c65e30a9ca3b56e25466e749cb100b28510.tar.gz
nixos-ddcc8c65e30a9ca3b56e25466e749cb100b28510.tar.bz2
nixos-ddcc8c65e30a9ca3b56e25466e749cb100b28510.tar.xz
nixos-ddcc8c65e30a9ca3b56e25466e749cb100b28510.zip
...
Diffstat (limited to 'accounts/gkleen@sif/xmonad/xmonad.hs')
-rw-r--r--accounts/gkleen@sif/xmonad/xmonad.hs51
1 files changed, 25 insertions, 26 deletions
diff --git a/accounts/gkleen@sif/xmonad/xmonad.hs b/accounts/gkleen@sif/xmonad/xmonad.hs
index 830bb2dd..3dc017a9 100644
--- a/accounts/gkleen@sif/xmonad/xmonad.hs
+++ b/accounts/gkleen@sif/xmonad/xmonad.hs
@@ -340,7 +340,7 @@ hostFromName h
340 , NS "toggl" "toggldesktop" (className =? "Toggl Desktop") centerFloat 340 , NS "toggl" "toggldesktop" (className =? "Toggl Desktop") centerFloat
341 , NS "calendar" "minetime -- --force-device-scale-factor=1.6" (className =? "MineTime") centerFloat 341 , NS "calendar" "minetime -- --force-device-scale-factor=1.6" (className =? "MineTime") centerFloat
342 , NS "emacs" "emacsclient -c -F \"'(title . \\\"Scratchpad\\\")\"" (className =? "Emacs" <&&> title =? "Scratchpad") centerFloat 342 , NS "emacs" "emacsclient -c -F \"'(title . \\\"Scratchpad\\\")\"" (className =? "Emacs" <&&> title =? "Scratchpad") centerFloat
343 -- , NS "music" "google-play-music-desktop-player --force-device-scale-factor=1.6" (className =? "Google Play Music Desktop Player") centerFloat 343 , NS "music" "ytmdesktop" (className =? "youtube-music-desktop-app") centerFloat
344 ] 344 ]
345 centerFloat = customFloating $ RationalRect (1 % 16) (1 % 16) (7 % 8) (7 % 8) 345 centerFloat = customFloating $ RationalRect (1 % 16) (1 % 16) (7 % 8) (7 % 8)
346 centerFloatSmall = customFloating $ RationalRect (1 % 4) (1 % 4) (1 % 2) (1 % 2) 346 centerFloatSmall = customFloating $ RationalRect (1 % 4) (1 % 4) (1 % 2) (1 % 2)
@@ -414,10 +414,10 @@ hostFromName h
414 (first : rest) = filter (not . null) $ lines result 414 (first : rest) = filter (not . null) $ lines result
415 notification = Notify.summary first <> Notify.body (unlines rest) <> Notify.timeout Infinite <> Notify.urgency Normal <> Notify.appName "dc" 415 notification = Notify.summary first <> Notify.body (unlines rest) <> Notify.timeout Infinite <> Notify.urgency Normal <> Notify.appName "dc"
416 void $ Notify.display notification 416 void $ Notify.display notification
417 synergyCompl = mkComplFunFromList' xPConfigMonospace ["mathw86"] 417 synergyCompl = mkComplFunFromList' xPConfigMonospace ["mathw86"]
418 synergyStart host = safeSpawn "systemctl" ["--user", "start", "synergy-rtunnel@" ++ host ++ ".service"] 418 synergyStart host = safeSpawn "systemctl" ["--user", "start", "synergy-rtunnel@" ++ host ++ ".service"]
419 synergyStop host = safeSpawn "systemctl" ["--user", "stop", "synergy-rtunnel@" ++ host ++ ".service"] 419 synergyStop host = safeSpawn "systemctl" ["--user", "stop", "synergy-rtunnel@" ++ host ++ ".service"]
420 420
421hostFromName _ = defaultHost 421hostFromName _ = defaultHost
422 422
423-- muteRef :: IORef (Maybe (String, Notification)) 423-- muteRef :: IORef (Maybe (String, Notification))
@@ -530,13 +530,13 @@ main = do
530 -- We can´t define per-host layout modifiers because we lack dependent types 530 -- We can´t define per-host layout modifiers because we lack dependent types
531 layout' = onHost "skadhi" ( onWorkspace (wsp 1) (Full ||| withIM (1%5) (Title "Buddy List") tabbedLayout') $ 531 layout' = onHost "skadhi" ( onWorkspace (wsp 1) (Full ||| withIM (1%5) (Title "Buddy List") tabbedLayout') $
532 onWorkspace (wsp 10) Full $ 532 onWorkspace (wsp 10) Full $
533 onWorkspace (wsp 2) (Full ||| tabbedLayout') $ 533 onWorkspace (wsp 2) (Full ||| tabbedLayout') $
534 onWorkspace (wsp 5) tabbedLayout' $ 534 onWorkspace (wsp 5) tabbedLayout' $
535 onWorkspace (wsp 8) (withIM (1%5) (Title "Friends") tabbedLayout') $ 535 onWorkspace (wsp 8) (withIM (1%5) (Title "Friends") tabbedLayout') $
536 defaultLayouts 536 defaultLayouts
537 ) $ 537 ) $
538 onHost "vali" ( onWorkspace (wsp 2) (Full ||| tabbedLayout' ||| combineTwo (TwoPane 0.01 0.57) Full tabbedLayout') $ 538 onHost "vali" ( onWorkspace (wsp 2) (Full ||| tabbedLayout' ||| combineTwo (TwoPane 0.01 0.57) Full tabbedLayout') $
539 onWorkspace (wsp 3) workLayouts $ 539 onWorkspace (wsp 3) workLayouts $
540 defaultLayouts 540 defaultLayouts
541 ) $ 541 ) $
542 onHost "hel" ( onWorkspace (wsp 1) (withIM (1 % 8) (Title "Buddy List") $ trackFloating tabbedLayout') $ 542 onHost "hel" ( onWorkspace (wsp 1) (withIM (1 % 8) (Title "Buddy List") $ trackFloating tabbedLayout') $
@@ -565,7 +565,7 @@ main = do
565 tabbedLayoutHoriz' = tabbedLayoutHoriz tabbedLeftAlways 565 tabbedLayoutHoriz' = tabbedLayoutHoriz tabbedLeftAlways
566 defaultLayouts = {- spiralWithDir East CW (1 % 2) -} Dwindle R CW 1 (5 % 100) ||| tabbedLayout' ||| Full 566 defaultLayouts = {- spiralWithDir East CW (1 % 2) -} Dwindle R CW 1 (5 % 100) ||| tabbedLayout' ||| Full
567 -- workLayouts = {- spiralWithDir East CW (1 % 2) -} Dwindle R CW (2 % 1) (5 % 100) ||| tabbedLayout' ||| Full 567 -- workLayouts = {- spiralWithDir East CW (1 % 2) -} Dwindle R CW (2 % 1) (5 % 100) ||| tabbedLayout' ||| Full
568 workLayouts = tabbedLayout' ||| (renamed [Replace "Combined"] $ combineTwoP (TwoPane (1 % 100) (1891 % 2560)) tabbedLayout''' (Column 1.6) (ClassName "Postman" `Or` ClassName "Emacs" `Or` ClassName "jetbrains-idea-ce" `Or` (Resource "Devtools" `And` ClassName "Firefox"))) ||| Full ||| Dwindle R CW 1 (5 % 100) 568 workLayouts = tabbedLayout' ||| (renamed [Replace "Combined"] $ combineTwoP (TwoPane (1 % 100) (1891 % 2560)) tabbedLayout''' (Column 1.6) (ClassName "Postman" `Or` ClassName "Emacs" `Or` ClassName "jetbrains-idea-ce" `Or` (Resource "Devtools" `And` ClassName "Firefox"))) ||| Full ||| Dwindle R CW 1 (5 % 100)
569 sqrtTwo = approxRational (sqrt 2) (1 / 2560) 569 sqrtTwo = approxRational (sqrt 2) (1 / 2560)
570 xmobarPP' = xmobarPP { ppTitle = shorten 80 570 xmobarPP' = xmobarPP { ppTitle = shorten 80
571 , ppSort = (liftM2 (.)) getSortByIndex $ return scratchpadFilterOutWorkspace 571 , ppSort = (liftM2 (.)) getSortByIndex $ return scratchpadFilterOutWorkspace
@@ -607,7 +607,7 @@ main = do
607 | otherwise = return () 607 | otherwise = return ()
608 handle _ = return () 608 handle _ = return ()
609 handle shutdown $ launch myConfig =<< getDirectories 609 handle shutdown $ launch myConfig =<< getDirectories
610 610
611secs :: Int -> Int 611secs :: Int -> Int
612secs = (* 1000000) 612secs = (* 1000000)
613 613
@@ -651,7 +651,7 @@ isDisabled :: String -> X Bool
651isDisabled str = do 651isDisabled str = do
652 out <- runProcessWithInput "xinput" ["list", str] "" 652 out <- runProcessWithInput "xinput" ["list", str] ""
653 return $ "disabled" `isInfixOf` out 653 return $ "disabled" `isInfixOf` out
654 654
655 655
656spawnKeychain :: X () 656spawnKeychain :: X ()
657spawnKeychain = do 657spawnKeychain = do
@@ -790,7 +790,7 @@ myKeys' conf host = Map.fromList $
790 -- launch a terminal 790 -- launch a terminal
791 [ ((modm, xK_Return), spawn $ (XMonad.terminal conf) ++ " -e tmux") 791 [ ((modm, xK_Return), spawn $ (XMonad.terminal conf) ++ " -e tmux")
792 , ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf) 792 , ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
793 793
794 -- launch dmenu 794 -- launch dmenu
795 --, ((modm, xK_d ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") 795 --, ((modm, xK_d ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
796 , ((modm, xK_d ), shellPrompt "Run: " xPConfigMonospace) 796 , ((modm, xK_d ), shellPrompt "Run: " xPConfigMonospace)
@@ -800,31 +800,31 @@ myKeys' conf host = Map.fromList $
800 -- close focused window 800 -- close focused window
801 , ((modm .|. shiftMask, xK_q ), kill) 801 , ((modm .|. shiftMask, xK_q ), kill)
802 , ((modm .|. controlMask .|. shiftMask, xK_q ), spawn "xkill") 802 , ((modm .|. controlMask .|. shiftMask, xK_q ), spawn "xkill")
803 803
804 -- Rotate through the available layout algorithms 804 -- Rotate through the available layout algorithms
805 , ((modm, xK_space ), sendMessage NextLayout) 805 , ((modm, xK_space ), sendMessage NextLayout)
806 806
807 -- Reset the layouts on the current workspace to default 807 -- Reset the layouts on the current workspace to default
808 , ((modm .|. controlMask, xK_r ), (setLayout $ XMonad.layoutHook conf) >> refresh) 808 , ((modm .|. controlMask, xK_r ), (setLayout $ XMonad.layoutHook conf) >> refresh)
809 809
810 -- Resize viewed windows to the correct size 810 -- Resize viewed windows to the correct size
811 , ((modm, xK_r ), refresh) 811 , ((modm, xK_r ), refresh)
812 812
813 -- Move focus to the next window 813 -- Move focus to the next window
814 , ((modm, xK_t ), windows W.focusDown) 814 , ((modm, xK_t ), windows W.focusDown)
815 815
816 -- Move focus to the previous window 816 -- Move focus to the previous window
817 , ((modm, xK_n ), windows W.focusUp ) 817 , ((modm, xK_n ), windows W.focusUp )
818 818
819 -- Move focus to the master window 819 -- Move focus to the master window
820 , ((modm, xK_m ), windows W.focusMaster ) 820 , ((modm, xK_m ), windows W.focusMaster )
821 821
822 -- Swap the focused window and the master window 822 -- Swap the focused window and the master window
823 , ((modm .|. shiftMask, xK_m ), windows W.swapMaster) 823 , ((modm .|. shiftMask, xK_m ), windows W.swapMaster)
824 824
825 -- Swap the focused window with the next window 825 -- Swap the focused window with the next window
826 , ((modm .|. shiftMask, xK_t ), windows W.swapDown ) 826 , ((modm .|. shiftMask, xK_t ), windows W.swapDown )
827 827
828 -- Swap the focused window with the previous window 828 -- Swap the focused window with the previous window
829 , ((modm .|. shiftMask, xK_n ), windows W.swapUp ) 829 , ((modm .|. shiftMask, xK_n ), windows W.swapUp )
830 830
@@ -845,18 +845,18 @@ myKeys' conf host = Map.fromList $
845 -- , ((modm .|. controlMask, xK_Down ), withFocused $ keysMoveWindow (0, 10)) 845 -- , ((modm .|. controlMask, xK_Down ), withFocused $ keysMoveWindow (0, 10))
846 -- Shrink the master area 846 -- Shrink the master area
847 , ((modm, xK_h ), sendMessage Shrink) 847 , ((modm, xK_h ), sendMessage Shrink)
848 848
849 -- Expand the master area 849 -- Expand the master area
850 , ((modm, xK_s ), sendMessage Expand) 850 , ((modm, xK_s ), sendMessage Expand)
851 851
852 -- Push window back into tiling 852 -- Push window back into tiling
853 , ((modm .|. shiftMask, xK_space ), withFocused $ windows . W.sink) 853 , ((modm .|. shiftMask, xK_space ), withFocused $ windows . W.sink)
854 , ((modm, xK_BackSpace), focusUrgent) 854 , ((modm, xK_BackSpace), focusUrgent)
855 , ((modm .|. shiftMask, xK_BackSpace), clearUrgents) 855 , ((modm .|. shiftMask, xK_BackSpace), clearUrgents)
856 856
857 -- Increment the number of windows in the master area 857 -- Increment the number of windows in the master area
858 , ((modm , xK_comma ), sendMessage (IncMasterN 1)) 858 , ((modm , xK_comma ), sendMessage (IncMasterN 1))
859 859
860 -- Deincrement the number of windows in the master area 860 -- Deincrement the number of windows in the master area
861 , ((modm , xK_period), sendMessage (IncMasterN (-1))) 861 , ((modm , xK_period), sendMessage (IncMasterN (-1)))
862 862
@@ -875,7 +875,7 @@ myKeys' conf host = Map.fromList $
875 875
876 , ((modm , xK_Escape), cycleKbLayout (hKbLayouts host)) 876 , ((modm , xK_Escape), cycleKbLayout (hKbLayouts host))
877 , ((modm .|. controlMask, xK_Escape), safeSpawn "setxkbmap" $ fst (head $ hKbLayouts host) : maybeToList (snd . head $ hKbLayouts host)) 877 , ((modm .|. controlMask, xK_Escape), safeSpawn "setxkbmap" $ fst (head $ hKbLayouts host) : maybeToList (snd . head $ hKbLayouts host))
878 878
879 -- Toggle the status bar gap 879 -- Toggle the status bar gap
880 -- Use this binding with avoidStruts from Hooks.ManageDocks. 880 -- Use this binding with avoidStruts from Hooks.ManageDocks.
881 -- See also the statusBar function from Hooks.DynamicLog. 881 -- See also the statusBar function from Hooks.DynamicLog.
@@ -883,10 +883,10 @@ myKeys' conf host = Map.fromList $
883 , ((modm , xK_b ), sendMessage ToggleStruts) 883 , ((modm , xK_b ), sendMessage ToggleStruts)
884 884
885 , ((modm .|. shiftMask, xK_p ), safeSpawn "playerctl" ["-a", "pause"]) 885 , ((modm .|. shiftMask, xK_p ), safeSpawn "playerctl" ["-a", "pause"])
886 886
887 -- Quit xmonad 887 -- Quit xmonad
888 , ((modm .|. shiftMask, xK_e ), io (exitWith ExitSuccess)) 888 , ((modm .|. shiftMask, xK_e ), io (exitWith ExitSuccess))
889 889
890 -- Restart xmonad 890 -- Restart xmonad
891 -- , ((modm .|. shiftMask .|. controlMask, xK_r ), void . xfork $ recompile False >>= flip when (safeSpawn "xmonad" ["--restart"])) 891 -- , ((modm .|. shiftMask .|. controlMask, xK_r ), void . xfork $ recompile False >>= flip when (safeSpawn "xmonad" ["--restart"]))
892 , ((modm .|. shiftMask, xK_r ), void . liftIO $ executeFile "xmonad" True [] Nothing) 892 , ((modm .|. shiftMask, xK_r ), void . liftIO $ executeFile "xmonad" True [] Nothing)
@@ -902,7 +902,7 @@ myKeys' conf host = Map.fromList $
902 , ((modm , xK_g ), windowPrompt xPConfig Bring allWindows) 902 , ((modm , xK_g ), windowPrompt xPConfig Bring allWindows)
903 ] 903 ]
904 ++ 904 ++
905 905
906 -- 906 --
907 -- mod-[1..9], Switch to workspace N 907 -- mod-[1..9], Switch to workspace N
908 -- 908 --
@@ -924,4 +924,3 @@ myKeys' conf host = Map.fromList $
924 modm = XMonad.modMask conf 924 modm = XMonad.modMask conf
925 925
926 brCycle = [0, 1 % 100, 1 % 10, 1 % 4, 1 % 2, 3 % 4, 1] 926 brCycle = [0, 1 % 100, 1 % 10, 1 % 4, 1 % 2, 3 % 4, 1]
927