Abstract
- This script hides litter selectively, preserving important objects like related drives and volumes in your Mac desktop.
- Customise the script with variable arrays to specify which objects to at all times present or disguise, relying in your preferences.
- Set off the script by way of Apple Shortcuts or use it as a standalone executable for simple desktop decluttering.
The macOS desktop can flip right into a chaotic digital junk drawer, cluttered with recordsdata, folders, and screenshots. However what if you happen to may tidy it up whereas maintaining its performance intact? Right here’s a wiser technique to reclaim your desktop.
The Nuclear Choice for Cleansing Up Your Mac Desktop
The commonest approach for instant Desktop decluttering is to run the next Terminal command:
defaults write com.apple.finder CreateDesktop -bool false && killall Finder
Whereas the above is efficient at wiping the slate clear, I’d classify it as a little bit of a nuclear choice. It is because it hides helpful objects like related drives and exterior volumes alongside the litter.
After operating into this downside myself, I made a decision to jot down a greater answer: a script that hides desktop litter whereas maintaining the necessities seen.
Why Disguise Your Desktop Icons?
There are many good causes to declutter your desktop. For one, it makes your workspace look cleaner, which might increase focus and productiveness. However there are sensible causes too.
Display sharing throughout conferences or livestreaming typically reveals extra of your private workspace than you could be comfy with. Hiding these desktop icons protects your privateness. It’s additionally a technique to reclaim the desktop as a spot for important shortcuts relatively than a dumping floor for each file you obtain or screenshot you’re taking.
The normal technique of hiding desktop icons utilizing the CreateDesktop setting above is okay for some conditions, but it surely has vital downsides. When you flip it off, your desktop turns into utterly inaccessible. It’s like locking a messy room however dropping entry to all the things inside, even the issues you may very well want.
That’s the place my script is available in.
Why This Script Is Higher
As an alternative of hiding all the things indiscriminately, my script makes use of file attributes to selectively disguise non-essential objects. This strategy is cleaner, safer, and extra versatile than the normal technique.
First, it doesn’t rename your recordsdata by including a dot (.) initially of their names. This avoids breaking automations or scripts that reference desktop objects. The recordsdata aren’t renamed; they’re simply given a “hidden” attribute, making them invisible on the desktop and in Finder except you’ve configured Finder to indicate hidden recordsdata.
Second, the script ensures that related drives and mounted volumes stay seen on the Desktop. It is a huge win for aesthetics and performance. Volumes are a core a part of the macOS desktop, and maintaining them seen reduces the possibilities of by accident disconnecting an external drive with out ejecting it correctly. It’s additionally simply good to look at your desktop and see what’s plugged in with out having to open a Finder window.
Lastly, the script is customizable. Customers with primary shell scripting familiarity can specify exceptions by means of variable arrays close to the highest of the script—recordsdata or folders that ought to at all times stay seen or at all times hidden. That is helpful for maintaining sure objects accessible whereas cleansing up the remainder of the litter.
As a bonus and in contrast to the normal strategy, my script doesn’t require restarting Finder, which means no interruptions to your workflow or misplaced Finder home windows when the appliance re-initializes.
Easy methods to Use the Script in Apple Shortcuts
The Apple Shortcuts app is an effective way to combine this script into your workflow and make it “moveable”, so to talk.
Begin by opening the Shortcuts app and creating a brand new clean shortcut.
Add a “Run Shell Script” motion, delete the default “Hey World” configuration within the physique and substitute it with the whole script under.
Now, go forward and check it out by clicking the play button close to the highest or with the hotkey Command+R when the Shortcut window is targeted.
The primary time you run the shortcut, macOS could immediate you to permit Shortcut.app to execute scripts. When you grant permission, run the shortcut once more, and it ought to work flawlessly. You possibly can change these underneath Shortcuts > Settings > Superior too.
For simple entry, why not pin the shortcut to your Mac menu bar?
For superior customers, the script consists of arrays close to the highest for customizing which recordsdata or folders ought to at all times be hidden or proven. By including the names of particular objects to those arrays, you possibly can tailor the script to fit your preferences. The one script works as a toggle, so that you solely want one to each disguise and present non-volume desktop objects (simply run it agan to place all the things again).
When you’d relatively run the script immediately, that’s straightforward too. Save the script to a file in your most well-liked listing. For instance, create a file named hide_desktop.sh, reserve it in a handy location, and make it executable with the next command:
chmod +x /path/to/hide_desktop.sh
From there, you possibly can run the script manually within the terminal emulator of your selecting or configure it to run utilizing your favourite software. When you use Alfred, you possibly can set off the script with a configured hotkey or key phrase. Alternatively, you possibly can flip it right into a double-clickable app utilizing Automator.
These choices make it straightforward to cover and unhide your desktop icons with minimal effort. You possibly can even mix methodologies by operating Apple Shortcuts immediately out of your terminal as proven under (I named my Shortcut “Declutter Desktop”).
This script doesn’t simply tidy up your desktop—it provides you management. It hides the litter with out taking away the performance of your desktop, making certain that essential objects like mounted drives keep seen.
Whether or not you’re livestreaming, display screen sharing, or simply attempting to beautify your workspace, it’s a versatile and chic answer that works the best way macOS ought to. So, give it a attempt. With slightly setup, you possibly can declutter your desktop with out burning all of it down.
Source link