Created
January 9, 2017 06:21
-
-
Save rinx/009184a2549f15d20c7ea123c507bca1 to your computer and use it in GitHub Desktop.
wpchange.sh for iterm2 version3
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" | |
osascript -e "tell application \"iTerm\" | |
set current_session to (current session of first window) | |
tell current_session | |
set background image to \"$image_path\" | |
end tell | |
end tell" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment