refanurse.blogg.se

Launchbar eject all volumes
Launchbar eject all volumes










This took way too many hours of my life I will never get back.

Launchbar eject all volumes mac#

I upgraded my late 2014 Mac Mini withĪ shiny new 1TB SSD. You will see the same starting piece which nets the list of drives/volumes and these are then passed via xargs to the diskutil eject command which does the work.Today I wanted to move existing APFS-resident macOS Catalina installation to a new disk. Yes, I used a CD emoji, because that's the best I could do at a glance.ĭf | egrep '^/dev.+\s/Volumes.+' | sed -E 's|.+/(.+)|\1|' | xargs -n 1 diskutil eject The rest of the command is just manipulating it for display - put it on one line, add spaces, and an emoji.

launchbar eject all volumes

If it lists what you expect, then this should be a safe widget for you. You can run this command in Terminal on your Mac and see what pops out.

  • Are mounted as a volume (show a mount point inside /Volumes).
  • The meat of this is df | egrep '^/dev.+\s/Volumes.+' which lists all filesystems and matches only those which: There are two variations on the same command one to generate the text for the button and one to action the ejects.ĭf | egrep '^/dev.+\s/Volumes.+' | sed -E 's|.+/(.+)|\1|' | sort | tr '\n' ' ' | sed -E 's|(.+) |💿 \1\n|' "BTTTouchBarAppleScriptString" : "let url = '' \n\nfetch(url)\n. "BTTTouchBarButtonName" : "Drive Ejector", "BTTTouchBarAppleScriptStringRunOnInit" : true, "BTTShellScriptWidgetGestureConfig" : "/bin/zsh:::-c:::-:::", "BTTShellTaskActionScript" : "df | egrep '^/dev.+\s/Volumes.+' | sed -E 's|.+/(.+)|\1|' | xargs -n 1 diskutil eject", "BTTPredefinedActionName" : "Execute Shell Script / Task", "BTTTriggerClass" : "BTTTriggerTypeTouchBar", "BTTTriggerTypeDescription" : "Shell Script / Task Widget", The widget updates every 5 seconds and disappears if no external drives are attached. Tapping the button ejects them one by one. Three mounted volumes are shown: Fencurch, Rupert, and Vogon. There are likely many improvements/optimisations possible, but it gets the job done in this form. This widget shows you that this needs doing, provides the tap target to action the ejects, and feeds back that the ejects have been effective.

    launchbar eject all volumes

    The intended use case is when undocking your Mac laptop from a Thunderbolt hub/display and you need to eject all of the drives first.

    launchbar eject all volumes

    I have, however, provided a run-down of my commands below if you want to explore the results before committing to use the widget. There may be factors I have not taken care of, so use at your own risk! A very simple TouchBar widget I whipped up to both see and eject removable drives.ĭisclaimer: I worked this out from various online posts regarding the commands used, and by testing it out on my Mac.










    Launchbar eject all volumes