Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Drag and drop images to set Terminal background Apps
We all know that dragging a file to an open Terminal window will paste the file's full UNIX path, but here's a little twist on that. If you're dragging an image, and hold down Option when you drop the file, that image will be set as the Terminal's background image. Small but neat!

[robg adds: If you like working with imaged Terminal windows, this is a much faster method than visiting Terminal: Preferences: Color, clicking Use an image for the background, clicking Set, and then navigating to the desired picture. Note that you'll want to drag first, then press and hold Option. If you just Option-drag, you'll find the active application goes into hiding when you Option-click in the Finder, which is another trick we all know...]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[10,464 views]  

Drag and drop images to set Terminal background | 5 comments | Create New Account
Click here to return to the 'Drag and drop images to set Terminal background' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Drag and drop images to set Terminal background
Authored by: rbenezra on Feb 02, '05 10:29:32AM

The drag-option-drop method is faster than setting it in the window setting box (not preferences, rob) but I don't think there is a way to make the background stick for following sessions unless you select "use settings as defaults" in the window setting box.



[ Reply to This | # ]
Command to set background?
Authored by: lullabud on Feb 02, '05 11:11:45AM

Wow, that's really cool! Is there a command to set the terminal background? I think it would be cool to have you .bashrc load up a random image when you open a new terminal window to help distinguish quickly between different windows when you open up several at once.



[ Reply to This | # ]
Command to set background?
Authored by: adrianm on Feb 02, '05 01:53:55PM

Sadly, Terminal's applescript dictionary doesn't permit changing the background graphic, but you can change colour and transparency.



[ Reply to This | # ]
Command to set background?
Authored by: Bemopolis on Feb 02, '05 05:10:33PM
well, I'm not sure how to pull a random image from a folder in UNIX, but you can set the background image from the Terminal with the command

defaults write com.apple.Terminal BackgroundImagePath -string path-to-file.

The next terminal that opens will use the specified background image. You can of course
undo the "damage" with

defaults delete com.apple.Terminal BackgroundImagePath

for the next terminal window.
Now, I don't think I'm comfortable monkeying around with the pref file X times a day,
though, so this may not be an optimal solution. The real trick is to find how the
option-drag assigns the picture to only that window for that session. But as a
terminal-picture-of-the-day sort of thing, sure. Maybe someone more clever than I
can figure that out, as well as the way to choose a random file from a folder.

Bemopolis

[ Reply to This | # ]
random backgrounds
Authored by: caesurae on Feb 06, '05 04:15:30PM
Considering that it's possible to create .term files to launch a session that can include a background image...

I have created a script that can be executed from a .term file or an rc file (.bashrc, .tcshrc, etc.). The script inserts the path of an image file randomly selected from ~/Library/Desktop Pictures/ into a .term file's "BackgroundImagePath" setting. This avoids "monkeying around with the pref file X times a day" as Bemopolis put it, but requires that you create the directory ~/Library/Application Support/Terminal/ to keep the .term file and script in.

You could edit the script to change ~/Library/Desktop Pictures/ to some other directory.

Get the script here.

[ Reply to This | # ]