summaryrefslogtreecommitdiff
path: root/dot/local
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2017-05-24 15:50:44 -0400
committerAndrew Cady <d@jerkface.net>2017-05-24 15:50:44 -0400
commita8101c6c111c0052d009696ac22ac9c98a6b5b3e (patch)
tree79a3f04803643087742aa8a7a925ac842e57f49d /dot/local
parent84564e32311e47e5385bb2fc1b7146e68182cb73 (diff)
x11-ssh-host allows choice of screen over tmux on the remote side
Diffstat (limited to 'dot/local')
-rwxr-xr-xdot/local/bin/x11-ssh-host6
1 files changed, 4 insertions, 2 deletions
diff --git a/dot/local/bin/x11-ssh-host b/dot/local/bin/x11-ssh-host
index 7eb05ab..166f491 100755
--- a/dot/local/bin/x11-ssh-host
+++ b/dot/local/bin/x11-ssh-host
@@ -4,10 +4,12 @@ case "$host" in
4 x11-ssh-host) host=$1 ;; 4 x11-ssh-host) host=$1 ;;
5esac 5esac
6 6
7SCRIPT="if which tmux && ! test -e .prefer-screen; then tmux attach || tmux new; else screen -xRR -e '^Zz'; fi"
8
7if [ "$DISPLAY" -a ! -t 0 ]; then 9if [ "$DISPLAY" -a ! -t 0 ]; then
8 exec xterm -T "$host" -e \ 10 exec xterm -T "$host" -e \
9 autossh "$host" -- -t screen -xRR -e '^Zz' 11 autossh "$host" -- -t $SCRIPT
10else 12else
11 exec \ 13 exec \
12 autossh "$host" -- -t screen -xRR -e '^Zz' 14 autossh "$host" -- -t $SCRIPT
13fi 15fi