Advertisement
  1. Computer Skills
  2. Maintenance
Computers

How to Keep a Mac Efficient and Well Maintained—Part 2

by
Difficulty:IntermediateLength:MediumLanguages:

Macs, like any machine, are prone to break down eventually. With continuous use, its efficiency can degrade and the machine may start behaving erratically. 

This could be a failing physical component such as a logic board, RAM, or an internal fan.

Files may no longer open due to errors in filesystem, search may become slower or irrelevant, apps may start misbehaving and more.

You can minimise both the number and the severity of problems with a maintenance regime. 

This tutorial shows you the maintenance steps to follow to keep a Mac efficient and well maintained. Consider these instructions as a set of guidelines to determine your own maintenance regime.

In the first part of the tutorial series, I showed you how to:

  • Keep apps up to date
  • Remove apps, junk, and unneeded files

In this, the second part of the tutorial series, I’ll show you how to:

  • Develop healthy habits while working on the Mac
  • Turn off unneeded login items

Develop Healthy Habits While Working

Mac gives you some wonderful tools to help organise your files. When you organise files, you get to your files faster, save time in finding files, and more. 

Developing healthy habits while working with a Mac can reduce the need of periodic maintenance. For instance, you can use Automator to clean your desktop or organise the Downloads folder automatically.

Empty the Trash

The Trash is just another folder residing on the Mac. Moving files or folders to the Trash doesn’t delete them automatically. 

They continue to take up space until you empty the Trash folder manually using Finder > Empty Trash. If you delete any files by accident then you can restore them, whilst they’re still located in the Trash folder.

Click the Trash icon on the Dock and scan its contents before you empty them. You can also let the Mac to automatically remove items from Trash that have been there for 30 days. Choose Apple Menu > About This Mac > Storage and click Manage.

Click Manage in the Storage tab
Click Manage in the Storage tab

In the list on the left, select Recommendations and turn on Empty Trash Automatically.

Turn on empty trash automatically
Turn on empty trash automatically

Restart the Mac

As you keep using a Mac and not turning it off you may find that, over a period of time, the performance slowly degrades. Reasons for this performance degrade could be due to:

  • Memory leaks from apps and system processes
  • Bugs leading to excess RAM and CPU usage
  • Increasing number of virtual memory swap files on hard disk, when the Mac is running low on physical RAM

Anytime you notice that the Mac is not running smoothly, then restart. Click Apple Menu and choose Restart…

Clean the Desktop and Downloads Folder

Finder brings greater organisational capabilities and has folders for different categories, yet many people keep dozens or hundreds of files on the Desktop for downloaded files, work in progress, and more. 

macOS considers every icon on the Desktop as a window ...and every window uses certain amount of RAM.

Technically Desktop is yet another folder on the Mac and you can switch off the icon preview for icons in View Options but the point is different. 

You can use Automator and third-party utilities to clean up desktop and organise the Downloads folder automatically.

Press Command-Space to launch Spotlight and type in Automator. Create a new Folder Action document to move screenshot from Desktop to a particular folder and scale it to a specific width.

Create a new folder action document in Automator
Create a new folder action document in Automator

Then, at the top of the window it says, Folder Action receives files and folders added to

Click where it says Choose Folder and select the Desktop folder. 

On the left side, there is a list of all the available actions. Look for Find Finder Items and drag it to the right side of the window to build the workflow.

Add find finder items to the right side of the window
Add find finder items to the right side of the window

Change from All to Any and choose the following parameters

  • Name begins with Screen Shot
  • File extension ends with png
Change the parameters within Find Finder Items
Change the parameters within Find Finder Items

Drag the Move Finder Items to the right side of the window. Set the To: parameter to the folder of your choice. 

Drag Scale Images to the right side of the window to conclude the workflow. This workflow will move a screenshot to the designated folder and scale it to 850px.

Final part of the folder action in automator for Mac
Final part of the folder action in automator for Mac

Using this method you can build folder folder actions to organise the Downloads folder and put files in specific folder.

Alternatives:

Unclutter—It’s a paid utility, at $6.99 to help you organise clipboard, files and notes in a single unified panel accessible from menu bar. Swipe downwards with trackpad or scroll wheel to make those panels appear. Clipboard panel shows you the list of clipboard history. Files panel shows you the list of files, drag-and drop files into it without cluttering desktop. Notes panel lets type in quick note for safe keeping.

Hazel—It’s a paid utility, at $32, to monitor folders on a Mac for events that you define—a file you add or modify and initiates actions based on the rules you set, such as moving or renaming a file, adding a label and more. If you’ve just started using Hazel, then we have a number of tutorials on Hazel on Envato Tuts+.

Turn Off Login Items

Login items are apps, documents, shared network volumes or other items you wish to automatically open when you start a Mac. 

When you install an app, it might ask your permission or offer an option Open at Login. Login items removes the friction as it launch your favourite items automatically, but they also make your Mac startup slow, and this is more pronounced with a mechanical hard drive than it is a solid state drive.

Open the Users & Groups pane of System Preferences. Select the user account from the left sidebar and click the Login Items tab. You’ll see the list of items that open every time you log in, and it varies for each individual user account.

Login items tab in System Preference
Login items tab in System Preference

To add the item, drag and drop them into the list or click the plus symbol icon to select an item using the file browser. 

Click the minus symbol icon to remove an item from the startup or check the Hide box to make the application hidden in the foreground—the item will minimise into the dock.

Add and remove login items in System Preference for Mac
Add and remove login items in System Preference for Mac

Although this is a simple way to remove login items, it only does half a job and the reality is much more complicated. 

Since OS X 10.4, Apple has developed a unique mechanism to launch items automatically: Launch Agents and Daemons controlled by the launchd process.

launchd runs other processes in response to condition—on startup, on a fixed schedule or if a certain event occurs. Launchd learns what do by reading .plist files in these locations

  • /Library/LaunchDaemons/ for installed applications
  • /System/Library/LaunchDaemons for macOS native processes
Launch Daemons folder in your Mac
Launch Daemons folder in your Mac
  • /Library/LaunchAgents/ for all users
  • ~/Library/LaunchAgents/ for a specific user
  • /System/Library/LaunchAgents/ for macOS only
LaunchAgents folder on your Mac
LaunchAgents folder on your Mac

Items in LaunchDaemons load when the Mac startup and run as the root user. They run in the background without requiring user input and affects the whole system. For example Scripts for performing maintenance tasks, cupsd for printing and blued for interacting with Bluetooth.

Items in LaunchAgents load when any or particular user logs in and run as that user. They access the graphical user interface and display information which may be useful to you. For example—A calendar app monitors the user calendar and can launch itself when certain events occurs.

In many cases, those items run constantly in the background, sometimes they run at scheduled intervals, and sometimes they run as needed. For instance—a launchd item associated with Time Machine tells it to run once an hour. Until then, the backupd process use no CPU or RAM but when it runs the process can use both.

Like this, you may have some items that you know you don’t need anymore. Perhaps some items get left behind predominantly apps you no longer use or have even uninstalled. You can safely delete those .plist files. Always make a backup before deleting anything. Every item removed from these folders may not make a huge difference in startup, but every little bit helps.

Note, don’t delete any items from System LaunchAgents or LaunchDaemons folders. They can make the Mac unstable or lead to system crashes. It usually begins with com.apple...

You can monitor these folders automatically with Folder Actions. It link applescripts to folders on the system so if they change, then scripts will run to notify you.

Open the AppleScript Editor app. Click Preferences… and check General > Show script menu in menu bar.

Enable script menu in the menu bar
Enable script menu in the menu bar

Click the Script Menu and choose Folder Actions > Enable Folder Actions. Then from the same submenu choose Attach Script to Folder.

Attach script to folder by first enabling folder actions
Attach script to folder by first enabling folder actions

A dialog box will pop-up. Choose add - new item alert option

Attach script to launchdaemon folder As any new item gets added an alert will be displayed in the notification
Attach script to launchdaemon folder. As any new item gets added an alert will be displayed in the notification

Click OK and file browser window will open. 

Go to username/Library/LaunchAgents folder and click the Open button.

enable-folder-in-launchagents-applescriptChoose LaunchAgents folder if any plist file gets added then youll see a notification in Finder
Choose LaunchAgents folder, if any .plist file gets added then you'll see a notification in Finder

Add other LaunchDaemon and LaunchAgents folders wherein you want to apply the action. Now whenever any .plist file gets added to these folders, you will see an alert prompt in the Finder.

Conclusion

In this second tutorial, I've shown you some of the ways to maintain a Mac. It's not necessary to follow all the steps. Consider these instructions as a starting point to make your own maintenance regimen. In the next part of the tutorial series I'll continue to guide you to make a Mac efficient and well maintained. 

Advertisement
Advertisement
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.