Skip to content

Instantly share code, notes, and snippets.

@rinx
Created January 9, 2017 06:21
Show Gist options
  • Save rinx/009184a2549f15d20c7ea123c507bca1 to your computer and use it in GitHub Desktop.
Save rinx/009184a2549f15d20c7ea123c507bca1 to your computer and use it in GitHub Desktop.
wpchange.sh for iterm2 version3
#!/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