Last active
August 29, 2015 13:58
-
-
Save harada4atsushi/10001208 to your computer and use it in GitHub Desktop.
SSH接続時にiTermの背景画像を動的に変更するシェルスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set_bg_image() { | |
/usr/bin/osascript <<EOF | |
tell application "iTerm" | |
tell the current terminal | |
tell the current session | |
set background image path to "$1" | |
end tell | |
end tell | |
end tell | |
EOF | |
} | |
case "$@" in | |
sakura* ) set_bg_image ~/bin/ssh_bg_image/sakura.jpg;; | |
my_server* ) set_bg_image ~/bin/ssh_bg_image/my_server.png;; | |
esac | |
ssh $@ | |
# disconnect local iterm bgimage | |
set_bg_image ~/bin/ssh_bg_imgge/black.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment