From 1514c30e46768eb978996660ad46ca8e48cef5b7 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 15 May 2021 15:27:19 +0200 Subject: ... --- accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs | 5 ++++- accounts/gkleen@sif/xmonad/xmonad.hs | 14 +++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'accounts/gkleen@sif/xmonad') 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 , " -- " , cCommand c ] -inTmux c +inTmux Nothing c | null $ cCommand c = c { cCommand = "tmux new-session" } | otherwise = c { cCommand = "tmux new-session \"" ++ (cCommand c) ++ "\"" } +inTmux (Just h) c + | null $ cCommand c = c { cCommand = "tmux new-session -As " <> h } + | otherwise = c { cCommand = "tmux new-session \"" ++ (cCommand c) ++ "\"" } withEnv :: [(String, String)] -> Conn -> Conn withEnv envs c = c { cCommand = "env" ++ (concat $ map (\(n, v) -> ' ' : (n ++ "=" ++ v)) envs) ++ " " ++ (cCommand c) } 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 , position = Top } -sshOverrides = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux } ) +sshOverrides host = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux host} ) [ "odin", "odin.asgard.yggdrasil" , "ymir", "ymir.yggdrasil.li", "ymir.niflheim.yggdrasil" @@ -691,13 +691,17 @@ sshOverrides = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux } , "testworx" ] ++ - map (\h -> mkOverride { oHost = h, oCommand = moshCmd' "/run/current-system/sw/bin/mosh-server" . withEnv [("TERM", "xterm")] . inTmux} ) + map (\h -> mkOverride { oHost = h, oCommand = moshCmd' "/run/current-system/sw/bin/mosh-server" . withEnv [("TERM", "xterm")] . inTmux host} ) [ "bragi", "bragi.asgard.yggdrasil" ] ++ - map (\h -> mkOverride { oHost = h, oCommand = sshCmd . withEnv [("TERM", "xterm")] . inTmux } ) + map (\h -> mkOverride { oHost = h, oCommand = sshCmd . inTmux host } ) + [ "uni2work-dev1" + ] + ++ + map (\h -> mkOverride { oHost = h, oCommand = sshCmd . withEnv [("TERM", "xterm")] . inTmux host } ) [ "remote.cip.ifi.lmu.de" - , "uniworx3", "uniworx4", "uniworxdb" + , "uniworx3", "uniworx4", "uniworx5", "uniworxdb2" ] backlight :: (Rational -> Rational) -> X () @@ -769,7 +773,7 @@ myKeys' conf host = Map.fromList $ --, ((modm, xK_d ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") , ((modm, xK_d ), shellPrompt "Run: " xPConfig) , ((modm .|. shiftMask, xK_d ), prompt "Run in Terminal: " ("urxvtc" ++ " -e") xPConfig) - , ((modm, xK_at ), sshPrompt sshOverrides xPConfig) + , ((modm, xK_at ), sshPrompt (sshOverrides . Just $ hName host) xPConfig) -- close focused window , ((modm .|. shiftMask, xK_q ), kill) -- cgit v1.2.3