diff options
Diffstat (limited to 'accounts/gkleen@sif/xmonad')
-rw-r--r-- | accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs | 5 | ||||
-rw-r--r-- | accounts/gkleen@sif/xmonad/xmonad.hs | 14 |
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 | ] |
83 | inTmux c | 83 | inTmux 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) ++ "\"" } |
86 | inTmux (Just h) c | ||
87 | | null $ cCommand c = c { cCommand = "tmux new-session -As " <> h } | ||
88 | | otherwise = c { cCommand = "tmux new-session \"" ++ (cCommand c) ++ "\"" } | ||
86 | withEnv :: [(String, String)] -> Conn -> Conn | 89 | withEnv :: [(String, String)] -> Conn -> Conn |
87 | withEnv envs c = c { cCommand = "env" ++ (concat $ map (\(n, v) -> ' ' : (n ++ "=" ++ v)) envs) ++ " " ++ (cCommand c) } | 90 | withEnv 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 | ||
683 | sshOverrides = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux } ) | 683 | sshOverrides 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 | ||
703 | backlight :: (Rational -> Rational) -> X () | 707 | backlight :: (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) |