Last active
February 8, 2016 11:42
-
-
Save rinx/eaa3f1455e1c092a99ec to your computer and use it in GitHub Desktop.
iTerm2 wallpaper changer
This file contains hidden or 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/sh | |
CMDNAME=`basename $0` | |
BASE_DIR=$(cd $(dirname $0);pwd) | |
image_list=(${BASE_DIR}/*.jpg) | |
numimglist=${#image_list[@]} | |
rannum=$(( $RANDOM % ${numimglist})) | |
image_path=${image_list[$rannum]} | |
osascript -e "tell application \"iTerm\" | |
set current_terminal to (current terminal) | |
tell current_terminal | |
set current_session to (current session) | |
tell current_session | |
set background image path to \"$image_path\" | |
end tell | |
end tell | |
end tell" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment