Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In OSX I have it setup so that the wallpaper is set to a directory with various images and it changes automatically. Sometimes an image will come up and it's one that I'd like to delete. What's a quick way to delete it without having to try to find out which image it is?

share|improve this question
add comment

1 Answer

The Dock process is responsible for changing the desktop wallpaper based on the settings in ~/Library/Preferences/com.apple.desktop.plist among these the key ChangePath (or NewChangePath) used to determine from which folder to take the image.

But there is no persistent copy made of that image file, or a reference to it, you could use.


Your only option then is to rely on the file system metadata: Since the Dock process needs to access the files that are to be displayed, you can pick the N most recently accessed files from that folder.

A command-line call that accomplished this would be e.g.

stat -f "%a:%N" /Library/Desktop\ Pictures/Nature/* | sort | tail -n3 | cut -d: -f2

Change the argument to tail to however many most recently accessed images you want listed. The most recently (i.e. hopefully current) image is the last one listed.

Since your filesystem records accesses of any program, this will probably start failing as soon as you e.g. view the folder in Finder, have it open in iPhoto, or use QuickLook to view some of the images.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.