Skip to content

Instantly share code, notes, and snippets.

@harada4atsushi
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harada4atsushi/10001208 to your computer and use it in GitHub Desktop.
Save harada4atsushi/10001208 to your computer and use it in GitHub Desktop.
SSH接続時にiTermの背景画像を動的に変更するシェルスクリプト
#!/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