Coder Social home page Coder Social logo

mysides's Introduction

mysides

A simple CLI tool for Finder sidebar modification.

NOTE: I clobbered this together with very little experience in C/CoreFoundation, as a result the code may be horrible.

*NOTE: Using Versions 10.11 El Capitan or 10.12 Sierra, you can also use sfltool to achieve similar things. These options were removed in 10.13 High Sierra onwards *. Example:

$ sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Path/To/Sidebar/Folder

Usage

List sidebar favorites items:

mysides list

Append a new item to the end of a list:

mysides add example file:///Users/Shared/example

Insert a new item at the start of the list:

mysides insert example file:///Users/Shared/example

Remove the item (by name):

mysides remove example

Credits

portions (l) copyleft 2011 Adam Strzelecki nanoant.com without whom I would not know much about the LSSharedFileList API.

mysides's People

Contributors

benswinburne avatar clburlison avatar kaltekar avatar lazymutt avatar mosen avatar opragel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mysides's Issues

Building the project

Hi.
Do you have any instructions to build this project ?
I've downloaded it and built Products > mysides (so it is "black").
Then I launch the provided Makefile script but it fails to put the binary in a package and then in a disk image.
So I've done a Control-Click on Products > mysides, then "Show in Finder" so I can grab the binary from a Xcode debug folder.
Do you have any hints to make the building normal ?
Best regards.
Franck.

Exit Code when Adding Sidebar Item Doesn't Produce a 0 ...

I was working on scripting something for our users when they login for the first time, but for some reason even though I get an "Added sidebar item with name XXXX" message after adding a sidebar item, the resulting exit code is a 1 and not a 0 indicating success. But the item is clearly in the sidebar.

I checked doing this manually via the command line as well with the following: mysides add example file:///Volumes/example and I get the same exit code of 1.

I can confirm however that when I run a mysides remove the exit code is 0.

Add position feature

Right now if I want to change the order of some favorites I have to add and remove until I get the right order. It would be nice to be able to automate that process with a command like mysides position <position> <name> as  mysides position 2 Desktop to move my Desktop favorites from actual position to second from the top.

After Using mysides to add a sidebar item, manually removing using the Finder does not remove sidebar item

Recorded a short video outlining my script which checks for the user's mounted network volume and adds to sidebar.

However, attempting to manually remove the sidebar item by right-clicking in the Finder and removing while it removed the sidebar item from the list (mysides list), it did not actually remove it from the Finder. Only after readding the sidebar item using mysides and then doing a mysides remove actually made the sidebar item disappear in the Finder.

Issue not critical for us, just was doing some testing with the 1.0.1 update (thank you for fixing the exit code!)

Add "mysides version" as argument

Could you please add a command "mysides version" to output the version of mysides? This would be great for managing mysides versions on a machine and patch outdated versions.

Remove all option

Something that would be very useful is a remove all flag option, so if one wants to clean up the sidebar completely and re-add every item next.

adding does not work

$ mysides add test file:///Volumes/user/test/

-> click on shortcut yields

"test" can't be opened because the original item can't be found.

cd /Volumes/user/test/ works.

macOS Catalina 10.15.1
mysides list by the way yields

[1] 3951 segmentation fault mysides list
Executing the commands with sudo does not help.

Mysides Version

How to check the version of mysides?
Could you please help?

Issue with "add" in 10.13.1

/usr/local/bin/mysides add file:///Users/userx/Downloads
2017-12-08 10:56:16.000 mysides[28668:2122940] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff2cc062fb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff53573c76 objc_exception_throw + 48
2 CoreFoundation 0x00007fff2cc97d6d +[NSException raise:format:] + 205
3 Foundation 0x00007fff2ec149d1 +[NSString stringWithUTF8String:] + 78
4 mysides 0x000000010242e150 main + 319
5 libdyld.dylib 0x00007fff54162145 start + 1
6 ??? 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

Remove items via URI?

Is there a way to remove sidebar items using its explicit URI?

I often have multiple sidebar items that have the same names, but are from different folders, so I would like to be able to only remove sidebar items that exist at a specific URI, so I can write a script that clears out all items related to a specific project which I have completed.

Right now, mysides only removes the first instance of an item, and it appears that you have no control over which instances gets deleted first.

`zsh: segmentation fault mysides list` on Ventura – Workaround -> Rearrange before list

see also possible answers before my comment in similar issue #6 segmentation fault: 11

Issue:

After running mysides list the terminal output stoped after 3 item with error
zsh: segmentation fault mysides list
and a finder window stating unexpected quit of mysides (screenshot, exact message not available).

Workaround

  • I tried to rearrange the first item not listed after the error by dragging it 2 steps further down in the Favorites list.
  • After reissuing mysides list the whole list including this item was listed again.

Possible causing

  • Maybe the old stored format was rewritten on change, leading to be better accessible via a changed API.

I will come back later to add more experience if something changes

Installed version

I am using mysides installed at /usr/local/bin/mysides (creation date 26 Sep 2016, size 49.356 bytes)
Installed using brew install mysides --cask under Mojave or Catalina on an Intel Machine, migrated to Apple Silicon M1 under Monterey, now at Ventura 13.5.2 (22G91)

...
installer: Package name is mysides-1.0.1
...

not working with apple silicon

i've used mysides for my last few macs, but it failed when trying with my m1 processor mac. it may not be compatible with apple silicon as-is.

M1 Macs / Ventura

If it isn't too difficult, would you mind rebuilding this for M1 Macs? Right now, running it generates this error:
/usr/local/bin/mysides: Bad CPU type in executable

license?

I'm new to using github so my answer might be staring me in the face.

Is there any sort of license attached to mysides? I do tech support at a community college and for a project I needed to create a solution that would mount a network drive and then place the mounted drive in the finder sidebar. Your mysides command worked perfect. To use it though means us distributing it to our endusers which would include a few home systems connected via vpn.

Can we legally do this? It won't be of much use if the user has to come to github to get this as for most of our users, that'll be too complex of a process. The method I'm looking at is it being packaged with our application which is nothing more than a script that does the mounting and makes use of mysides.

Thanks!

Segmentation fault: 11, when running mysides

When running the following script, I get a series of "Segmentation faults: 11". (Each of these is also accompanied by "neq all".) That doesn't mean anything to me. Any idea what I should do next?

`#!/usr/bin/env bash
echo "Define address for MYSIDES and get name of current user."

MYSIDES=/usr/local/bin/mysides

dir=$(whoami)

echo "I have determined the current user to be $dir ."

echo "Remove All My Files entry."

$MYSIDES remove All\ My\ Files file:///System/Library/CoreServices/Finder.app/Contents/Resources/MyLibraries/myDocuments.cannedSearch/

echo "Remove iCloud Drive entry."

$MYSIDES remove iCloud x-apple-finder:icloud

echo "Remove Desktop entry."

$MYSIDES remove Desktop file:///Users/${dir}/Desktop

echo "Remove Documents entry."

$MYSIDES remove Documents file:///Users/${dir}/Documents

echo "======================= I have completed my task"`

Here is the output from Terminal:

Redux:~ admin$ su - remotetarget2 -c /Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh

Password:

Entering script /Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh .

Define address for MYSIDES and get name of current user.

I have determined the current user to be remotetarget2 .

Remove All My Files entry.

neq all

/Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh: line 40: 7269 Segmentation fault: 11 $MYSIDES remove All\ My\ Files file:///System/Library/CoreServices/Finder.app/Contents/Resources/MyLibraries/myDocuments.cannedSearch/

Remove iCloud Drive entry.

neq all

/Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh: line 44: 7271 Segmentation fault: 11 $MYSIDES remove iCloud x-apple-finder:icloud

Remove Desktop entry.

neq all

/Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh: line 52: 7272 Segmentation fault: 11 $MYSIDES remove Desktop file:///Users/${dir}/Desktop

Remove Documents entry.

neq all

/Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh: line 56: 7273 Segmentation fault: 11 $MYSIDES remove Documents file:///Users/${dir}/Documents

======================= I have completed my task

Thanks in advance if you have some time to give this some thought!

Removing the „AirDrop“-Entry in macOS High Sierra

On macOS Sierra the AirDrop-Entry in the Finder SideBar can be removed with the following line:
mysides remove domain-AirDrop nwnode://domain-AirDrop

On macOS High Sierra this is no longer possible. It seams that the AirDrop Entry has no name on High Sierra:
mysides list
-> nwnode://domain-AirDrop

I've tried to simply omit the name:
mysides remove nwnode://domain-AirDrop

but this doesn't work:
neq all
Could not find sidebar item with display name: nwnode://domain-AirDrop

am i missing something? how could this be accomplished?

Rebuild for Apple Silicon

It seems the version of MySides available on Homebrew does not support Apple Silicon. I have two Macs. It works fine on the Intel Mac, but on the Apple Silicon Mac I get the following error when trying to run add:

zsh: bad CPU type in executable: mysides

This is an amazingly helpful project, but seeing the way Apple is moving it would be really nice if it were republished supporting the latest processors.

Thank you!

mysides assertion failed

I've been using mysides to automatically place the user's network home directory in the sidebar during login via LoginHook. This worked perfectly in 10.10, but doesn't seem to work in 10.11.

The machine hangs during login and if I look in the log, I see these error messages appearing countless times:

3/4/16 11:47:41.199 AM mysides[310] assertion failed: 15D21: libxpc.dylib + 24227 [61AB4610-9304-354C-9E9B-D57198AE9866]: 0x97
3/4/16 11:47:43.678 AM mysides[310] assertion failed: 15D21: libxpc.dylib + 24227 [61AB4610-9304-354C-9E9B-D57198AE9866]: 0x97
3/4/16 11:47:47.174 AM mysides[310] assertion failed: 15D21: libxpc.dylib + 24227 [61AB4610-9304-354C-9E9B-D57198AE9866]: 0x97
3/4/16 11:47:51.627 AM mysides[310] assertion failed: 15D21: libxpc.dylib + 24227 [61AB4610-9304-354C-9E9B-D57198AE9866]: 0x97
3/4/16 11:47:57.109 AM mysides[310] assertion failed: 15D21: libxpc.dylib + 24227 [61AB4610-9304-354C-9E9B-D57198AE9866]: 0x97
3/4/16 11:48:03.550 AM mysides[310] assertion failed: 15D21: libxpc.dylib + 24227 [61AB4610-9304-354C-9E9B-D57198AE9866]: 0x97

The command I'm using, that used to work on 10.10, but no longer works on 10.11 is:

sudo -u <USERNAME_HERE> /path/to/mysides add <USERNAME_HERE> file:///path/to/network/home/on/disk

Is this something you've come across or understand the error? My original thought before posting this was that there was an issue with using sudo -u, but there are many other commands in the LoginHook that use sudo -u that work perfectly.

Thanks for all of your hard work on mysides!
Morgan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.