Hardcoded Folder Icons in macOS

I saw this post on Mastodon, and it got me thinking.

Screenshot 2023 02 08 at 4 26 58 AM

Are there any other hardcoded folder names in macOS? Where would I even start looking?

Well, based on what I know, every program on macOS is a directory that ends with .app, which means all I have to do is to find Finder’s location.

That should be pretty easy!

antranigv@zvartnots:~ $ cd /System/
antranigv@zvartnots:/System $ find . -type d -name Finder.app 2>/dev/null
./Library/CoreServices/Finder.app
./Volumes/Data/System/Library/CoreServices/Finder.app

Well, that was easy to find! Don’t worry, /System/Library is the same as /System/Volumes/Data/System/Library, Apple has a weird way of doing mount points, and I’m not here to judge. Well, at least not today!

Next I have to dig into Finder.app’s content, let’s see what we have.

antranigv@zvartnots:/System $ cd Library/CoreServices/Finder.app/
antranigv@zvartnots:/System/Library/CoreServices/Finder.app $ find . -type f -name 'Developer*'

Weird. Nothing at all?

I wonder what type of files we have here? I already know that I wanna see all the file types except Mach-O.

$ find . -type f -print0 | xargs -0 -I% -L 1 file -b "%" | sort -u | grep -v 'Mach-O'
ASCII text, with no line terminators
Apple binary property list
IFF data, AIFF audio
Mac OS X Code Directory version 20100 - 203 bytes
Mac OS X Code Directory version 20100 - 213 bytes
Mac OS X Code Directory version 20100 - 215 bytes
Mac OS X Code Directory version 20100 - 217 bytes
Mac OS X Code Requirement Set - 76 bytes
Mac OS X Code Requirement Set - 84 bytes
Mac OS X Code Requirement Set - 88 bytes
Mac OS X bill of materials (BOM) file
Mac OS X icon, 114423 bytes, "ic13" type
Mac OS X icon, 1162872 bytes, "ic12" type
Mac OS X icon, 23712 bytes, "ic13" type
Mac OS X icon, 30805 bytes, "ic13" type
Mac OS X icon, 37834 bytes, "ic13" type
Mac OS X icon, 72729 bytes, "ic13" type
Mac OS X icon, 76602 bytes, "ic13" type
XML 1.0 document text, ASCII text
XML 1.0 document text, Unicode text, UTF-8 text
data

Okay! we’re getting somewhere!

According to Magic file directory on FreeBSD, the filename is usually .icns

I think the rest will be easy, let’s try this again!

$ find /System/Library -type f -name 'Developer*.icns' 2>/dev/null
/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/DeveloperFolderIcon.icns

Bingpot!

What else do we have there?

$ find . -type f -name '*Folder*.icns'
./UsersFolderIcon.icns
./DocumentsFolderIcon.icns
./SidebarHomeFolder.icns
./ApplicationsFolderIcon.icns
./PrivateFolderBadgeIcon.icns
./GenericFolderIcon.icns
./PicturesFolderIcon.icns
./SidebarDesktopFolder.icns
./PublicFolderIcon.icns
./SidebarGenericFolder.icns
./SystemFolderIcon.icns
./ServerApplicationsFolderIcon.icns
./LibraryFolderIcon.icns
./ReadOnlyFolderBadgeIcon.icns
./SidebarBurnFolder.icns
./OpenFolderIcon.icns
./SmartFolderIcon.icns
./BurnableFolderIcon.icns
./SidebarDownloadsFolder.icns
./SidebarMoviesFolder.icns
./SidebarPicturesFolder.icns
./UtilitiesFolder.icns
./SidebarSmartFolder.icns
./HomeFolderIcon.icns
./SidebarApplicationsFolder.icns
./MovieFolderIcon.icns
./SidebarDocumentsFolder.icns
./DropFolderBadgeIcon.icns
./DownloadsFolder.icns
./GroupFolder.icns
./SidebarUtilitiesFolder.icns
./SidebarMusicFolder.icns
./DeveloperFolderIcon.icns
./NewFolderBadgeIcon.icns
./MusicFolderIcon.icns
./DesktopFolderIcon.icns
./SitesFolderIcon.icns
./SidebarDropBoxFolder.icns

These are good! Let’s look at them!

I wrote a script that converts all these .icns files to proper PNGs using the iconutil program.

#!/bin/sh

for icns in *.icns;
do
  iconutil -c iconset "${icns}"
done

for iconset in *.iconset;
do
  cp "${iconset}/icon_512x512@2x.png" "${iconset}-icon_512x512@2x.png" ||
    cp "${iconset}/icon_32x32.png" "${iconset}-icon_32x32.png"
done

Here are the ones that we see basically every day!

Here are some of the exotic ones that we don’t always notice, in an alphabetical order.

The Burnable folder! Still supported even on macOS Ventura!

BurnableFolderIcon iconset icon 512x512 2x

The Developer folder! If you don’t know where you should put your code, this is the right place for it!

DeveloperFolderIcon iconset icon 512x512 2x

The Group folder!

GroupFolder iconset icon 512x512 2x

The Library!

LibraryFolderIcon iconset icon 512x512 2x

The Public folder! Want to share something with your local network? Put it here!

PublicFolderIcon iconset icon 512x512 2x

The Server Applications Folder! Wait, what? I’ve never seen this before. If you know what this is, please leave a reply 🙂

ServerApplicationsFolderIcon iconset icon 512x512 2x

The Sites folder! If you’re new to macOS, this is a kindly reminder that macOS ships with Apache2. Yes, and ~/Sites is the default UserDir, i.e. http://localhost/~yourusername

$ grep '^UserDir' /etc/apache2/extra/httpd-userdir.conf 
UserDir Sites

SitesFolderIcon iconset icon 512x512 2x

The System folder!

SystemFolderIcon iconset icon 512x512 2x

The User folder!

UsersFolderIcon iconset icon 512x512 2x

And finally… the Utilities folder which lives inside the Application folder!

UtilitiesFolder iconset icon 512x512 2x

As sad as it is, these are the old icons, i.e. pre-Ventura (I think). I wish if there was a way to click on a switch and change it back, since it’s all here anyway!

That’s all folks…

Reply via email.

Antranig Vartanian

February 8, 2023

Turns out when you start MariaDB for the first time it prints technical messages and theeen it says:

Please report any problems at https://mariadb.org/jira

The latest information about MariaDB is available at https://mariadb.org/.

Consider joining MariaDB's strong and vibrant community:
⠀https://mariadb.org/get-involved/

Starting mysql.

I love this!

I think we should add something similar to FreeBSD, where after the installation is done it says something like:

Please report any problems at https://bugs.freebsd.org/
The latest Handbook is available at https://freebsd.org/handbook/

Consider joining FreeBSD’s worldwide community:
https://docs.freebsd.org/en/articles/contributing/

Thank you for choosing FreeBSD!

Wait, maybe we have such a message? I have to check and then patch if we don’t 🙂

That’s all folks…

Reply via email.

Antranig Vartanian

February 3, 2023

Turns out this is what happens when you leave me alone at a supermarket.

Basically I start playing with all the electronics I find.

I found this Barcode scanner with Windows 8 (for some reason) and the browser was open.

I was thinking of idling it at my Armenian blog, but I think this was better!

It’s showing the “Get Blogging!” website 🙂

That’s a all folks…

Reply via email.

“You try, you fail, you try, you fail, but the only true failure is when you stop trying.”

Madame Leota, Haunted Mansion

Reply via email.

iPad with Magic Keyboard

When I was cleaning our office couple of days ago I found a Magic Keyboard. I always liked these, I had one years ago when I had a very old iMac (which was running OpenBSD at the time!)

I brought it home and connected it to my iPad. Looks like I have a new blogging station.

I’ve seen people who walk around with their iPads connected to a keyboard case. Some of these cases are very expensive.

While this is a very cheap solution, I would not recommend it to anyone, because you’d need a proper desk.

Unlike a laptop, which can be used while sitting in a corner of a hotel, even without a desk/table/chair. Just put it on your lap.

But then again, this might be a nice setup while on the move.

Actually, I’m writing this from my iPad+MagicKeyboard right now 🙂

And just like, see you all next year 😉

That’s all folks…

Reply via email.

Apple updated macOS’s date(1)!

In 2020 I blogged that

[…] macOS is becoming less Unix-y every year, date(1) is outdated […]

While I was coding, I thought that I’m (SSH’d to) on my FreeBSD machine but I was on macOS, I noticed that the -I flag suddenly works.

I wondered if Apple has updated the date(1) command in macOS Ventura.

Luckily, I have macOS Monterey at home as well.

Here’s the date(1) command on macOS Monterey

Screen Shot 2022 12 29 at 4 14 21 PM

Here it is on macOS Ventura

Screenshot 2022 12 29 at 4 22 45 PM

Ah, so it works!

Did Apple update something? I’m pretty sure it’s mentioned in the history section of the man page.

Here’s the man page of date(1) on macOS Monterey

Screen Shot 2022 12 29 at 4 25 18 PM

Wait, what?

What about the man page on macOS Ventura?

SCR 20221229 mr9

Well… Either someone forgot to update the man page on macOS Ventura, or someone forgot to merge the code properly on macOS Monterey

In either cases, I’m happy that Apple noticed the change and pulled the updated code from FreeBSD!

That’s all folks…

Reply via email.

Antranig Vartanian

December 22, 2022

I’m trying to migrate my life to Obsidian, turns out they have Vim key bindings for the editor. As soon as you enable it, it asks you a question.

Screenshot 2022 12 22 at 6 29 21 PM cropped

Nice!

Reply via email.

Antranig Vartanian

December 22, 2022

Screenshot 2022 12 22 at 3 30 47 PM

Could this be a timezone math issue? No wait, I think it’s just bad written software issue!

Personally, I would prefer if it said “Currently doing XYZ” and ideally if it just printed the output of ^T (SIGINFO) somewhere in the window.

Reply via email.

Software Review: #MarsEdit version 5

I haven’t done anything like this before, so please, be gentle 🙂

I first heard of MarsEdit when I was browsing Gruber’s website and I saw it listed in his Essential Apps. At the time I was using Hugo as my “content manager” for my blog, so I moved on. Fast forward a year-or-two, I migrated to WordPress.

A week-or-so ago Gruber blogged about MarsEdit 5.0, so I decided to give it a go.

After 10 days of using it, here is my feedback.

First Impressions

I downloaded the app from Red Sweater Software’s website, at the time I didn’t know that it was also available on the App Store. A simple Zip file which contained the App, I moved it to the application folder and I started it.

Right from the start, it asks you two simple questions: Your blog’s name and the address.

I entered my Armenian blog’s name “Ազատութիւն Ամենեցուն” and address “անդրանիկ.հայ”. As you have noticed, it’s a unicode domain 🙂 This info will be important later.

MarsEdit automatically figured that I’m running WordPress and that it should use the WordPress API!

The interface is nice and intuitive. At first, you will see information about your blog, It’s made of two “parts”

SCR 20221219 kng

At the top is list of your posts and pages
At the bottom is a live preview of your selected page/post

The live preview doesn’t actually fetch things from your server, instead, you can have a template. Luckily, you can edit the preview settings and download your template. Unfortunately, there was (is?) a bug and MarsEdit was not able to download the template of my blog. First thing that came to my mind “I’m using a unicode domain, that might be the issue!” and turns out I was right. As soon as I added my English blog with its domain (the one that you’re reading right now!) the “Download Template…” button worked like a charm!

Screenshot 2022 12 19 at 3 09 40 PM

The Editor

This is, easily, the best editor I’ve seen for blogging.

SCR 20221219 lbx

You start with selecting your blog (1) and the post type (2), you can give your post a title (3), but turns out that’s not mandatory at all. As you start typing in the input box (4), you will notice the toolbar at the top (5), which has the basic formatting buttons such as Bold, Italic, Underline. There’s “adding a link” and paragraph formatting. For example —

This is a plain paragraph style

This is a quoted paragraph style

And this is a preformatted paragraph style

Depending on your theme, it will look different in preview/website and in the editor.

You can (and should!) also add tags (6), which MarsEdit will autocomplete while typing and select Categories (7). There is also the option to specify a “Featured Image”, I’ve never used this in MarsEdit nor in the WordPress editor, so no comments from me!

Finally, you can specify the server settings (9), such as the status of the post (Published, Draft, etc), Password protection, author (I actually DO run a multi-author blog!), comments and TraceBacks!

But the most impressive feature for me is the ability to save things locally, hence the Edited (10) at the title bar! I’m mostly on the move (well, not these day, it’s cold outside), while I don’t travel a lot, I do have daily work-things, such as going to a government office, a bank, a notary office, etc., which means I’m either commuting or waiting for my turn. While I have a mobile internet with me, we all know how old buildings are not built for the wireless era, so it amazes for me that I can just ⌘S and save my post locally to continue later.

All the local drafts are available in the… Local Drafts 😅

SCR 20221219 o9p

Amazing Niceties

The first nicety that I noticed was in the editor and it’s called “Typewriter Scrolling”. It does exactly what it says. The input box’s cursor will always be at the middle of the editor.

Screenshot 2022 12 19 at 5 33 31 PM

The second nicety is that everything is customizable, and I mean everything! For example, I blog a lot with coding samples, so I need a code tag. All I had to do was to go to Format → Customize… and I was able to create a new HTML tag for my code formatted text. Like this:
uname -a

And the final nicety that I noticed was the editor’s integration with TimeMachine-style restore points. I wish if every software had a feature like this!

Screenshot 2022 12 19 at 5 51 33 PM

Common (Personal?) Issues

I wasn’t planning on writing this review, at all, but since I wanted to try out MarsEdit before purchasing it, I wanted to use it intensively. In the last two weeks we had a Capture The Flag hacking competition and an Armenian InfoSec conference, so I blogged every details of these two events using MarsEdit. Actually, I was an organizer of the CTF competition, so I used MarsEdit to blog about everything from server installation, platform setup to “the food is here!” status updates 😄

That’s where I had my first issue! I set the Paragraph Style to Preformatted and I pasted some code, here’s how it looked like, if the code was multi-line;

Screenshot 2022 12 19 at 5 59 09 PM

It took me a while to realize, that I had to 1) set the Paragraph Style to Preformatted 2) Paste the code by doing Edit → Paste HTML Source. I’m not sure if this is an issue with my theme or not, but in case you get a similar issue, that’s how to solve it! Now, the code looks perfect 😇

Screenshot 2022 12 19 at 6 02 30 PM

The only other issue that I had was with the microposting feature, which is new in MarsEdit 5. It looks like a “status update” on Twitter or Mastodon.

Screenshot 2022 12 19 at 6 05 42 PM

When I first used this on MarsEdit 5, MarsEdit crashed. So finally, I’d like to talk about how

Daniel Jalkut is Amazing!

Like I said, I used MarsEdit 5 as soon as it came out, and the “New Micropost” feature crashed every time. Just 6 days after its initial release, Daniel released MarsEdit 5.0.1 which fixes the Micropost issue that I was having.

Finally, I send an email to Daniel saying

Greetings Daniel! how are you?

Looks like that MarsEdit is not crashing after upgrading to Version 5.0.1 (10611), however, a small question (feature request?):

In MarsEdit -> File -> New Post, I can set the Kind (Post Format) to Post, Aside, Status, etc.

I was wondering if there was a built-in way to make sure that my micro-posts are always set to Status? Microposts with no title look silly on WordPress, but in Status mode they look like a twitter/social-media status update!

I was wondering if I can implement that by using the Custom Fields tab in Blog Preferences.

Let me know!

Daniel replied to me just an hour later saying

Hi Antranig – this is a great idea and I’ll try to get it added as a preference ASAP. I’ll let you know when I have it in there!

Daniel

Conclusion

MarsEdit 5 is amazing. Currently it costs $59.95 for a Single User license and $89.95 for a Family Pack license (5 people in a private household), and let me tell you, it’s totally worth it!

MarsEdit 5 is my Christmas gift to myself.

If you are also a blogger who uses one of the platforms that MarsEdit supports (WordPress, Micro.blog, Tumblr, TypePad, Movable Type, and any blog that supports a standard MetaWeblog or AtomPub interface) and don’t want to open your browser every time an idea comes to your mind, then MarsEdit is for you.

P.S. WordPress’s Block Editor is also amazing. The WordPress team has done an amazing work with Gutenberg. And while I’ll be using MarsEdit for my personal blogs while writing from my Mac, Gutenberg has been amazing with my other WordPress blogs while writing from my FreeBSD laptop! Give that a try too! 😉

Reply via email.