KISS 🇺🇦

Stop the war!

Stop the war in Ukraine! Fuck putin!

More information is at: https://war.ukraine.ua/.

There is a fund to support the Ukrainian Army: https://savelife.in.ua/en/donate/, and there is a special bank account that accepts funds in multiple currencies: https://bank.gov.ua/en/about/support-the-armed-forces. I donated to them. Please donate if you can!

Killer putin

Killer putin. Source: politico.eu.

Arrested putin

"It hasn't happened yet, but it will happen sooner or later. Beautiful photo, isn't it?" Source: twitter.

Segregating useless built-in OS X applications

| comments

OS X is a nice and (mostly) stable operating system overall. However Apple puts so much crap and junk that may not be for everyone and that cannot be officially uninstalled. There is a bunch of standard applications and there is also a lot of standard daemons, some of which are trying to get network access to contact Apple (keyboardservicesd, studentd, seriously?!).

I don’t like having unnecessary stuff in my system and would prefer to get rid of it. I’m not sure about removing built-in applications completely, unfortunately that may have bad consequences to the stability of the system. But at least when I open the /Applications/ directory, I don’t want to see them. So a simple solution is to move them to /Applications/junk/.

The set of applications that are useless (junk) for you is your personal choice. For example: FaceTime, Home, Messages, News, Photo Booth, Siri, Stickies, Stocks. This post is how to move them away.

Note: this guide is for OS X 10.14 because 10.15 has changed the system layout and the process is more involved now. There will be another post on that.

A friendly reminder: Make a backup before doing these changes.

Initial move

Create /Applications/junk:

1
2
$ cd /Applications
$ sudo mkdir junk

Simple moving doesn’t work, even as root (of course Apple doesn’t like us moving their precious useless apps):

1
2
3
$ sudo mv Chess.app/ Contacts.app/ Dashboard.app/ FaceTime.app/ Home.app/ Launchpad.app/ Maps.app/ Messages.app/ News.app/ Photo\ Booth.app/ Photos.app/ Siri.app/ Stickies.app/ Stocks.app/ VoiceMemos.app/ junk/
mv: rename Chess.app/ to junk/Chess.app/: Operation not permitted

You need to disable SIP first. After that, the move worked without a hitch:

1
$ sudo mv Chess.app/ Contacts.app/ Dashboard.app/ FaceTime.app/ Home.app/ Launchpad.app/ Maps.app/ Messages.app/ News.app/ Photo\ Booth.app/ Photos.app/ Siri.app/ Stickies.app/ Stocks.app/ VoiceMemos.app/ junk/

If for some reason you have those apps in the Dock, they will be displayed as question marks after this, so remove them from the Dock.

If you don’t want to do any other system modification at this time, it’s a good idea to reenable SIP.

Upgrades

System upgrades, including security updates, often bring changes to some files of these applications, so you’ll get the old version in junk/ and a partial application in /Applications/, which will very likely not work. You need to remember to move all those new files to the corresponding directories in junk/. I’ll show you one command to do that, after an example upgrade from 10.14 build 18G103 to 18G8022.

To go step by step, first we can find all the applications that have new files and should be moved:

1
2
3
4
5
6
$ comm -12 <( \ls -1 /Applications/junk/ ) <( \ls -1 /Applications/ )
Maps.app
Messages.app
News.app
Photo Booth.app
Photos.app

The comm command compares all applications in /Applications/junk/ and /Applications/ and prints only those which are present in both directories. The \ls uses a backslash prefix to use the standard ls command without any aliases.

Then we need to iterate over the list properly because applications can have spaces in the filenames (sigh), which can be done by setting the input fields separator to \n:

1
2
3
4
5
6
$ ( IFS=$'\n'; for a in $( comm -12 <( \ls -1 /Applications/junk/ ) <( \ls -1 /Applications/ ) ); do echo "$a"; done )
Maps.app
Messages.app
News.app
Photo Booth.app
Photos.app

And finally we arrive at the command to copy the new files and remove the applications:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$ ( IFS=$'\n'; for a in $( comm -12 <( \ls -1 /Applications/junk/ ) <( \ls -1 /Applications/ ) ); do sudo rsync -av /Applications/{,junk/}"$a"/ && sudo rm -rf "/Applications/${a}"; done )
building file list ... done
./
Contents/
Contents/Frameworks/AppleConnectClient.framework/
Contents/Frameworks/AppleConnectClient.framework/Versions/
Contents/Frameworks/AppleConnectClient.framework/Versions/A/
Contents/Frameworks/AppleConnectClient.framework/Versions/A/AppleConnectClient
Contents/Frameworks/AppleConnectClient.framework/Versions/A/Resources/
Contents/Frameworks/AppleConnectClient.framework/Versions/A/Resources/AC2Bridge.bundle/Contents/
Contents/Frameworks/AppleConnectClient.framework/Versions/A/Resources/AC2Bridge.bundle/Contents/MacOS/
Contents/Frameworks/AppleConnectClient.framework/Versions/A/Resources/AC2Bridge.bundle/Contents/MacOS/AC2Bridge
Contents/Frameworks/AppleConnectClient.framework/Versions/A/Resources/AC2Bridge.bundle/Contents/_CodeSignature/CodeResources
Contents/Frameworks/AppleConnectClient.framework/Versions/A/_CodeSignature/CodeResources
Contents/MacOS/
Contents/MacOS/Maps
Contents/Resources/
Contents/Resources/pt.lproj/
Contents/Resources/pt.lproj/Localizable.strings
Contents/Resources/tr.lproj/
Contents/Resources/tr.lproj/MainMenu.nib
Contents/_CodeSignature/CodeResources

sent 4861111 bytes  received 268 bytes  9722758.00 bytes/sec
total size is 4859274  speedup is 1.00
building file list ... done
./
Contents/
Contents/Info.plist
Contents/version.plist
Contents/MacOS/
Contents/MacOS/Messages
Contents/_CodeSignature/
Contents/_CodeSignature/CodeResources

sent 29174967 bytes  received 2946 bytes  19451942.00 bytes/sec
total size is 29160169  speedup is 1.00

That’s it! You need just this one command after an upgrade. We don’t have any junk in /Applications/ again:

1
$ comm -12 <( \ls -1 /Applications/junk/ ) <( \ls -1 /Applications/ )

Comments