Pagina1 van 1
Forum

Welkom bij de Tweaking4All gemeenschapsforums!
Voor je gaat deelnemen, bekijk de Forum Regels!

Specifieke onderwerpen: Start het onderwerp met de naam van het programma of systeem.
Bijvoorbeeld “MacOS X – Jouw vraag“, of bijvoorbeeld “MS Word – Jouw Tip of Truc“.

Merk op: Omschakelen naar een andere taal zal niet werken als je een post aan het lezen bent aangezien er waarschijnlijk geen vertaling beschikbaar is.



macOS - How to hide...
 
Deel:
Meldingen
Alles wissen

[Opgelost] macOS - How to hide an individual mounted network share on your Desktop

1 Berichten
1 Gebruikers
0 Reactions
610 Bekeken
 Hans
(@hans)
Famed Member Admin
Deelgenomen: 11 jaar geleden
Berichten: 2805
Topic starter  

Finder Settings

Most will know how to show or hide network shares on your Mac desktop.
Click a Finder window, select the "Finder" - "Settings" menu and under the "General" tab either check "Connected servers" to show share icons on your desktop, or uncheck this option to not show these icons.
Downside: this affects all mounted share icons.

 

Advanced options in Path Finder

Applications like Path Finder have a more advanced "Get Info" option, so when selecting the actual mount path of a share, you can right click that directory and check or uncheck the "invisible" option. But of course, not everybody has a copy of Path Finder (commercial app).

 

Terminal trick ...

Now there is a trick to do this in Terminal - which may not work in old(er) macOS versions, but so far it seems to work in Monterey, Ventura and Sonoma.

Let's say we have a share mounted in /Volumes/AllShares and the Finder option enable to show "Connected Servers" on the Desktop. This will make it that we will see an "AllShares" icon on the desktop.

 

  • List Extended attributes

When hiding the share icon from the Desktop, I did see that the extended attribute "comp.apple.FinderInfo" of the original directory (/Volumes/AllShares) was given a specific value (note that this value can hold other otpions as well, like the flag colors for example):

xattr -lx /Volumes/AllShares 

com.apple.provenance:
00000000  01 00 00 E7 84 53 71 09 CA 67 F4                 |.....Sq..g.|
0000000B
com.apple.FinderInfo:
00000000  00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
00000020

Of course the rick now ... how do we add this "weird" value as an extended attribute?

 

  • Manually set the Share icon on the Desktop to hidden

To make a specific share icon hidden (killall Finder to make it visible, and note that color tag will be unset after this):

xattr -wx com.apple.FinderInfo "0000000000000000400000000000000000000000000000000000000000000000" /Volumes/AllShares

killall Finder
  • Unhide mounted share icon from Desktop

To unhide this particular icon we will need to remove the extended attribute "com.apple.FinderInfo" from the original directory (/Volumes/AllShares). In Terminal ( "-d" = delete, and again: note that color tag will be unset after this ) :

xattr -d com.apple.FinderInfo /Volumes/AllShares

To make this visible we will need to restart Finder like so (in Terminal):

killall Finder

 Took me quite a bit of time to figure this out ,... so I hope it will be useful to someone.


   
BeantwoordenCiteren
Deel: