Skip to content

Instantly share code, notes, and snippets.

@harada4atsushi

harada4atsushi/ssh_chbg.sh

Last active Aug 29, 2015
Embed
What would you like to do?
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