diff options
author | Andrew Cady <d@jerkface.net> | 2017-05-24 15:50:44 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2017-05-24 15:50:44 -0400 |
commit | a8101c6c111c0052d009696ac22ac9c98a6b5b3e (patch) | |
tree | 79a3f04803643087742aa8a7a925ac842e57f49d /dot/local | |
parent | 84564e32311e47e5385bb2fc1b7146e68182cb73 (diff) |
x11-ssh-host allows choice of screen over tmux on the remote side
Diffstat (limited to 'dot/local')
-rwxr-xr-x | dot/local/bin/x11-ssh-host | 6 |
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 ;; |
5 | esac | 5 | esac |
6 | 6 | ||
7 | SCRIPT="if which tmux && ! test -e .prefer-screen; then tmux attach || tmux new; else screen -xRR -e '^Zz'; fi" | ||
8 | |||
7 | if [ "$DISPLAY" -a ! -t 0 ]; then | 9 | if [ "$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 |
10 | else | 12 | else |
11 | exec \ | 13 | exec \ |
12 | autossh "$host" -- -t screen -xRR -e '^Zz' | 14 | autossh "$host" -- -t $SCRIPT |
13 | fi | 15 | fi |