Set Desktop Wallpaper from Command Line on Mac
Whenever I need to accomplish a basic task that typically calls for interacting with a UI, I challenge myself to complete the task from command line. After all, most UIs are simply a mask over basic commands, especially when it comes to the operating system. Suddenly I feel like an automation or systems engineer!
One task I can imagine an IT administrator would need to automate is setting the desktop wallpaper via a script, remotely, or simply by providing the command to do so:
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Users/davidwalsh/Downloads/pubg-background.jpg"'
It's important to note that you must provide the absolute path to the image, and not a path that begins with a user path (i.e. ~/Downloads/my-image.jpg)
Beyond the general nerdiness of knowing how to change desktop wallpaper via command line, it could be useful to change your background based on a service being down or other event.
I challenge you to think more like a remote IT administrator or automator when you need to accomplish your next simple task!
![CSS vs. JS Animation: Which is Faster?]()
How is it possible that JavaScript-based animation has secretly always been as fast — or faster — than CSS transitions? And, how is it possible that Adobe and Google consistently release media-rich mobile sites that rival the performance of native apps?
This article serves as a point-by-point...
![Introducing MooTools Templated]()
One major problem with creating UI components with the MooTools JavaScript framework is that there isn't a great way of allowing customization of template and ease of node creation. As of today, there are two ways of creating:
new Element Madness
The first way to create UI-driven...
![Retrieve Google Analytics Visits and PageViews with PHP]()
Google Analytics is an outstanding website analytics tool that gives you way more information about your website than you probably need. Better to get more than you want than not enough, right? Anyways I check my website statistics more often than I should and...
![pointer Media Query]()
As more devices emerge and differences in device interaction are implemented, the more important good CSS code will become. In order to write good CSS, we need some indicator about device capabilities. We've used CSS media queries thus far, with checks for max-width and pixel ratios.