summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/xmonad
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-05-15 15:27:19 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2021-05-15 15:27:19 +0200
commit1514c30e46768eb978996660ad46ca8e48cef5b7 (patch)
treec27da4992f00b4c7372020c367e8560d2355cfc7 /accounts/gkleen@sif/xmonad
parent9dddbe15c421b9f62cddee6f8cc4147f9d40cd86 (diff)
downloadnixos-1514c30e46768eb978996660ad46ca8e48cef5b7.tar
nixos-1514c30e46768eb978996660ad46ca8e48cef5b7.tar.gz
nixos-1514c30e46768eb978996660ad46ca8e48cef5b7.tar.bz2
nixos-1514c30e46768eb978996660ad46ca8e48cef5b7.tar.xz
nixos-1514c30e46768eb978996660ad46ca8e48cef5b7.zip
...
Diffstat (limited to 'accounts/gkleen@sif/xmonad')
-rw-r--r--accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs5
-rw-r--r--accounts/gkleen@sif/xmonad/xmonad.hs14
2 files changed, 13 insertions, 6 deletions
diff --git a/accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs b/accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs
index c85d0f92..729941aa 100644
--- a/accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs
+++ b/accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs
@@ -80,9 +80,12 @@ moshCmd' p c = concat
80 , " -- " 80 , " -- "
81 , cCommand c 81 , cCommand c
82 ] 82 ]
83inTmux c 83inTmux Nothing c
84 | null $ cCommand c = c { cCommand = "tmux new-session" } 84 | null $ cCommand c = c { cCommand = "tmux new-session" }
85 | otherwise = c { cCommand = "tmux new-session \"" ++ (cCommand c) ++ "\"" } 85 | otherwise = c { cCommand = "tmux new-session \"" ++ (cCommand c) ++ "\"" }
86inTmux (Just h) c
87 | null $ cCommand c = c { cCommand = "tmux new-session -As " <> h }
88 | otherwise = c { cCommand = "tmux new-session \"" ++ (cCommand c) ++ "\"" }
86withEnv :: [(String, String)] -> Conn -> Conn 89withEnv :: [(String, String)] -> Conn -> Conn
87withEnv envs c = c { cCommand = "env" ++ (concat $ map (\(n, v) -> ' ' : (n ++ "=" ++ v)) envs) ++ " " ++ (cCommand c) } 90withEnv envs c = c { cCommand = "env" ++ (concat $ map (\(n, v) -> ' ' : (n ++ "=" ++ v)) envs) ++ " " ++ (cCommand c) }
88 91
diff --git a/accounts/gkleen@sif/xmonad/xmonad.hs b/accounts/gkleen@sif/xmonad/xmonad.hs
index 8282ed3f..3bf930c0 100644
--- a/accounts/gkleen@sif/xmonad/xmonad.hs
+++ b/accounts/gkleen@sif/xmonad/xmonad.hs
@@ -680,7 +680,7 @@ xPConfig = def
680 , position = Top 680 , position = Top
681 } 681 }
682 682
683sshOverrides = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux } ) 683sshOverrides host = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux host} )
684 [ 684 [
685 "odin", "odin.asgard.yggdrasil" 685 "odin", "odin.asgard.yggdrasil"
686 , "ymir", "ymir.yggdrasil.li", "ymir.niflheim.yggdrasil" 686 , "ymir", "ymir.yggdrasil.li", "ymir.niflheim.yggdrasil"
@@ -691,13 +691,17 @@ sshOverrides = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux }
691 , "testworx" 691 , "testworx"
692 ] 692 ]
693 ++ 693 ++
694 map (\h -> mkOverride { oHost = h, oCommand = moshCmd' "/run/current-system/sw/bin/mosh-server" . withEnv [("TERM", "xterm")] . inTmux} ) 694 map (\h -> mkOverride { oHost = h, oCommand = moshCmd' "/run/current-system/sw/bin/mosh-server" . withEnv [("TERM", "xterm")] . inTmux host} )
695 [ "bragi", "bragi.asgard.yggdrasil" 695 [ "bragi", "bragi.asgard.yggdrasil"
696 ] 696 ]
697 ++ 697 ++
698 map (\h -> mkOverride { oHost = h, oCommand = sshCmd . withEnv [("TERM", "xterm")] . inTmux } ) 698 map (\h -> mkOverride { oHost = h, oCommand = sshCmd . inTmux host } )
699 [ "uni2work-dev1"
700 ]
701 ++
702 map (\h -> mkOverride { oHost = h, oCommand = sshCmd . withEnv [("TERM", "xterm")] . inTmux host } )
699 [ "remote.cip.ifi.lmu.de" 703 [ "remote.cip.ifi.lmu.de"
700 , "uniworx3", "uniworx4", "uniworxdb" 704 , "uniworx3", "uniworx4", "uniworx5", "uniworxdb2"
701 ] 705 ]
702 706
703backlight :: (Rational -> Rational) -> X () 707backlight :: (Rational -> Rational) -> X ()
@@ -769,7 +773,7 @@ myKeys' conf host = Map.fromList $
769 --, ((modm, xK_d ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") 773 --, ((modm, xK_d ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
770 , ((modm, xK_d ), shellPrompt "Run: " xPConfig) 774 , ((modm, xK_d ), shellPrompt "Run: " xPConfig)
771 , ((modm .|. shiftMask, xK_d ), prompt "Run in Terminal: " ("urxvtc" ++ " -e") xPConfig) 775 , ((modm .|. shiftMask, xK_d ), prompt "Run in Terminal: " ("urxvtc" ++ " -e") xPConfig)
772 , ((modm, xK_at ), sshPrompt sshOverrides xPConfig) 776 , ((modm, xK_at ), sshPrompt (sshOverrides . Just $ hName host) xPConfig)
773 777
774 -- close focused window 778 -- close focused window
775 , ((modm .|. shiftMask, xK_q ), kill) 779 , ((modm .|. shiftMask, xK_q ), kill)