how to change all Desktop backgrounds



With Lion came the welcome ability to have individual background wallpapers for each Desktop. However, what Apple forgot to add was an option to easily make all the Desktops have the same background image when you want it that way.

There are a few workarounds, but probably the simplest – once it is setup – is to use this little script I wrote for some ASC members. It should take you about 5 to 10 minutes to set this up if you follow the procedure carefully.

1. Open TextEdit, and choose TextEdit > Preferences.
Change the settings from ‘Rich Text’ to ‘Plain text’ for New Documents. Close the Preference pane and chose File > New.

2. Copy everything in the box below and paste it into the TextEdit file you just opened:

#! /bin/bash
#script to change all desktop backgrounds

echo -n “Drag and drop an image file here then press ‘return’ or
press ‘control-c’ to cancel…”
read -e WLPR;

function change_wallpaper
{
defaults write com.apple.desktop Background “{default = {ImageFilePath=’$WLPR’; };}”; killall Dock
}
change_wallpaper

3. Save the file to

/Library/Desktop Pictures

with the name ‘ChangeAllDesktops’.

IMPORTANT: Make sure you remove the ‘.txt’ file extension in the name field AND uncheck the option at the bottom of the Save box that says ‘If no extension is provided, use .txt’.

Note that you will need to press the ‘authenticate’ button when prompted in order to save anything into the ‘Desktop Pictures’ folder. Type your password in the dialogue that pops up.

4. Open Terminal.app. 
Make the ‘ChangesAllDesktops’ file executable by copy/pasting this into the Terminal window:

sudo chmod a+x /Library/Desktop\ Pictures/ChangeAllDesktops

Press ‘return’ and type in your password. The password won’t echo to the screen, so type carefully.

5. Make Terminal the default app for the file
Open a Finder window. Click on your hard disk icon in the sidebar (if you can’t see it, go to Finder > Preferences > Sidebar and check Hard disks under the ‘Devices’ section). Navigate to the Library/Desktop Pictures folder and right-click on the ‘ChangeAllDesktops’ file.

Select Open with and then Other…. In the window, navigate to Terminal.app in /Applications/Utilities. It will be greyed out, so change “Recommended Applications” to “All Applications” in the menu at the bottom of the window. Do not check “Always Open With”. Choose ‘Terminal.app’ and ‘OK’.

6. Make a shortcut for Desktop Pictures
Drag the folder ‘Desktop Pictures’ to the Finder sidebar to make a convenient shortcut. Now when you want to change all Desktop backgrounds at the same time, click in ‘Desktop Pictures’ in the Finder sidebar, run the ‘ChangeAllDesktops’ file, and drag an image from the (already) open Finder window into the Terminal window that appears.

Press ‘return’ and your desktops are all changed! 🙂



Related Posts
learning the Terminal — Part One
learning the Terminal — Part Two

change Flag names in Mail

‘Red’, ‘Green’ and ‘Yellow’ aren’t particularly meaningful ways to categorise messages, but changing the names to something more useful can make the ‘Flags’ feature a handy tool.

The procedure is quite simple, but the first thing you have to do is actually flag a couple of messages:

1. Flag some messages (one of each colour if you want seven categories):



2. Next, go into the sidebar in Mail. Click the little disclosure triangle:




3. Click on one of the names and press ‘return’ on the keyboard:

4. Type in a new name and press ‘return’ again:

5. Of course, you can change the flag names at any time:

mac keeps starting in Safe mode



If you see a screen with a progress bar (something like the shot above), your Mac is starting up in Safe Mode. This shouldn’t happen unless the user intentionally wants to do so for troubleshooting purposes. However, if you find that your Mac is defaulting to Safe Mode when you try to start up normally, try the following tips.

1. Stuck Shift key
Check that the Shift key is not accidentally being pressed down or stuck. If you suspect the keyboard may be faulty, plug in a different keyboard.

2. Use Terminal to reset boot-args
Allow the machine to finish booting into Safe Mode, then open Terminal (Applications/Utilities/Terminal.app) and copy this command into the Terminal window:

sudo nvram boot-args=""

press ‘return’ on your keyboard. Enter an Admin password (type carefully as it will not be echoed to the screen) and restart the Mac.

3. Do a PRAM reset. 
In this case, a PRAM reset effectively does the same as No.2 above. However, if No.2 didn’t work, it’s worth trying this way of doing it in case for some reason the boot memory failed to hold the preference setting. You can also do this step instead of Step 2 if you are not comfortable with using the Terminal.

The PRAM reset is done like this:

1. Power down the machine.

2. Locate the following keys on your keyboard in preparation for Step 4:

command–option–P–R

3. Press the ‘power on’ button.

4. Immediately – and before the grey screen appears – hold down ‘command-option-P-R’ all together.

5. Keep them held down until you’ve heard the start-up chime twice. After you release them you should hear it again, and hopefully your Mac will boot up as it should normally.

how to get Spaces and Expose on Lion

(Note: If you’ve just installed Mountain Lion, be sure to run ‘Check for Updates’ by clicking on the Total Spaces icon in the menubar)

Yes, it’s possible to bring back most of those beloved Snow Leopard features that Apple unwisely did away with in Lion, and – if you get them now – for free with 3rd-party apps. I’ve been hunting down a way to get rid of all the Mission Control behaviour on my trackpad, to return the app-switcher trackpad gesture, the 2-dimensional Spaces grid and, of course, Expose.

OK, so here’s how I finally got all those lovely Snow features back to Lion. You’re going to need two free tools (free for now, so don’t hang around…), namely:

Total Spaces from http://totalspaces.binaryage.com
Better Touch Tool from http://blog.boastr.net

Once you’ve downloaded these you’re half way there, but you’ve got to complete the job by setting them up properly. In the remainder of this post, I’ll walk you through how I’ve got them set up. Try it this way first, then once you’ve got the hang of it, you can tweak it to your own style. 🙂

1. Total Spaces > Preferences:

</p?

In BetterTouchTool Preferences:





In  > System Preferences > Trackpad:

Finally, disable the Mission Control hotkeys in  > System Preferences > Keyboard | Keyboard Shortcuts:

With this configuration, you change spaces by holding down ‘option’ and any of the arrow keys to move round a grid of 9 spaces (you can have more or less if you want in TotalSpaces prefs).

You see all spaces (like the screenshot at the top of the page) by holding down ‘command-option-left_arrow’.

You bring up Expose with a 4-finger downward swipe on the trackpad (note: Expose is unavailable while an app is in Full Screen mode), and the App Switcher with a 3-finger tap.

Oh, and Mission Control? Drag it off the Dock to about centre screen and release. Should you ever need it you can always go and double-click on it in your Applications folder, but otherwise you’ll soon forget it ever existed.

And that’s it — proper Spaces, Expose, and Trackpad functionality restored! 🙂

QuickTime won’t play my video



With the announcement that the developers of Perian are to discontinue their QuickTime plug in, it’s probably time you switched to using the open-source video player VLC.

Not only does VLC play video files that QuickTime can’t play even with Perian, it will also attempt (and often succeed) to play files that suffer from minor corruptions.

If you’re having problems playing a video file in QuickTime, chances are VLC is the answer.

🙂

Direct Download: http://sourceforge.net/projects/vlc/files/2.0.1/macosx/vlc-2.0.1.dmg/download
Project Site: http://www.videolan.org/vlc/index.html

restore tab & spacebar keys in logout window

Image

If you did a clean install of Lion at any point you might have noticed that the spacebar won’t toggle the checkbox and tab won’t cycle through the options in the Logout window.

To resolve this, open Terminal.app (Applications > Utilities > Terminal.app) and copy/paste this command

sudo defaults write NSGlobalDomain AppleKeyboardUIMode -int 3

Press ‘return’ and type in your Admin password. Restart your computer and your tab and spacebar keys should be back to normal!

🙂

how to make your battery last a bit longer

Here’s a couple of tricks you can use to eek a bit more life out of your old battery between recharges.

1. Turn off the keyboard backlights by pressing F5.

2. Turn off Bluetooth in the menu bar.

3. If you’re not using the Internet, turn off Wifi in the menu bar.

4. If you are using the internet, but you’re not expecting or bothered about receiving mail for a time, quit Mail or any other email client app. If you still want to check your email and you use a web-based mail service like GMail, you’ll use less battery power if you quit Mail, and open GMail directly in your browser window.

5. Reduce the hard disk drive sleep time (formerly known as ‘spindown’). By default, your Mac will power down the hard disk after 10 minutes inactivity on battery power. You could try setting that to 5 minutes (any less, and you’ll probably lose what you gain as the the HD will end up having to power up more often than necessary).

To do so, open Terminal, and copy/paste this command:

sudo pmset -b disksleep 5

After pressing ‘Return’ on your keyboard, you will need to enter your password, which will be invisible when you type it (so type carefully).

If you want to change it back to its default anytime in the future, just use the same command but change the ‘5’ to ’10’.

 This doesn’t affect the spindown time when you’re on mains power.

‘delete’ doesn’t send files to Trash

Image

If you find deleting a file deletes it immediately without sending it to the Trash first, you may need to fix permisssions on your Trash folder.

Open Terminal (Applications > Utilities > Terminal.app) and type

ls -alF

Scroll up if necessary to the beginning of the list and you should see a couple of folders whose names begin with a dot.

.Trash
.Trashes

Ignore .Trashes, but look at the permissions on .Trash, they should read like this (also see the pic above):

drwx- – – – – – <your_username> staff (size) (date) .Trash/

Ignore the numbers, but if the permissions are different or the username is not your account username, then do the following:

At the Terminal command prompt, type the following, replacing ‘your_username’ with (yep, you guessed it…) your username.

sudo chown -R your_username .Trash

For example, if my user name is ‘SnowLpd’ I would type
sudo chown -R SnowLpd .Trash

Then press ‘Return’. You will need to enter your password, which will be invisible when you type it (so type carefully). Now go and test your ‘delete’ function to see if the problem is cured. 🙂 

Related Posts

why does Trash ask for a password? (Permissions Part 1)

flush DNS Cache in Lion

If you need to flush the DNS cache in Mac OS X, be aware that the commands for this have changed through successive OSs, including Lion.

Flushing the cache is sometimes a good idea if you are unable to reach a site that you know is live but keeps returning an error (you can check whether a site is live for others by typing its address here: Down for everyone or just me?).

You can download my free app FastTasks that will do this (and a whole lot more! 🙂 ) for you without you needing to mess around on the command line. However, if you want to do it manually, then open Terminal (Applications > Utilities > Terminal.app) and use the appropriate command for your operating system:

In Tiger
lookupd -flushcache

In Leopard / Snow Leopard
dscacheutil -flushcache

In Lion and Mountain Lion
sudo killall -HUP mDNSResponder

With Lion, you’ll have to follow the command with your Admin password, which will be invisible when you type it.

Related Posts
FastTasks – a utility for common terminal tasks

block MacKeeper and other browser ads



Generally, I like to keep browser extensions down to a minimum, but here’s an essential one if you are tired of all those ‘Clean your mac’ / ‘Speed up your mac’ ads on every website you visit. Download and install the Safari adblock extension from here:

http://safariadblock.com/

What I like about this particular adblocker is that, if you go with the default filters, not only does it load your pages faster but it also reformats the page as if the ads were never even there, rather than leaving unsightly, blank placeholders in the page as some other ad filtering services do.

The extension is free, though you’re encouraged to donate if you appreciate the work done by the developer. 

🙂

Related Posts
how to uninstall MacKeeper