Du ser en gammel version af denne side. Se den nuværende version.

Sammenlign med nuværende Vis sidehistorik

« Forrige Version 3 Nuværende »

This is a follow up on Random Terminal Colors

If You like randoms images on the Mac Terminal, here a way to achive it for iTerm2.

I have placed my script in ~/Dropbox/Scripts/osx/RandomImagesiTerm2.scpt - look at Random Terminal Colors for ways to run it automatically.

 

The folder where images are stored are in osx "/Users/npn/Dropbox/Wallpapers" - which in AppleScript becomes "Macintosh HD:Users:npn:Dropbox:Wallpapers" and this is hardcoded in the script. 

ITerm2.app

The script itself for "iTerm2":

on replace_chars(this_text, search_string, replacement_string)
 set AppleScript's text item delimiters to the search_string
 set the item_list to every text item of this_text
 set AppleScript's text item delimiters to the replacement_string
 set this_text to the item_list as string
 set AppleScript's text item delimiters to ""
 return this_text
end replace_chars

tell application "Finder"
  set randomImage to some file of folder "Macintosh HD:Users:npn:Dropbox:Wallpapers"
end tell

set thePath to replace_chars(randomImage as string, ":", "/")
set thePath to replace_chars(thePath,"Macintosh HD","")

tell application "iTerm2"
  tell current session of current window
    set background image to thePath
  end tell
end tell

  • Ingen etiketter