HACKER Q&A
📣 behnamoh

Can we mount macOS clipboard as a filesystem?


In the spirit of this [0] post on HN, I'm wondering if we can mount the clipboard contents as a drive on macOS. This can be super helpful when a website/application doesn't support drag-n-drop, but you want to select a screenshot as its input. Normally, you'd have to take the screenshot, then go to the website/app. It'll then open the file selector box/dialog where you can select the screenshot file. But if the clipboard was mounted as a drive, you wouldn't need to save the screenshot anymore—just take it and have it in the clipboard, then go to the website/app and select the image in the clipboard drive.

0: https://news.ycombinator.com/item?id=34847611


  👤 behnamoh Accepted Answer ✓
Update: I asked this question from ChatGPT and it gave me the most convincing hallucination I've ever seen:

``` Yes, it is possible to mount the contents of macOS's clipboard as a filesystem drive using a third-party application called "ClipFS". ClipFS is a FUSE-based file system that allows you to mount the contents of your clipboard as a virtual file system in macOS.

To use ClipFS, you'll need to install it on your Mac. Here's how:

Open Terminal on your Mac. Install Homebrew if you haven't already by running the following command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/inst...)" Install FUSE for macOS by running the following command: brew install --cask osxfuse Install ClipFS by running the following command: brew install clipfs Once you've installed ClipFS, you can mount your clipboard as a virtual file system by running the following command in Terminal:

clipfs mountpoint Replace "mountpoint" with the path where you want to mount the clipboard. For example, if you want to mount the clipboard as a drive called "ClipDrive" in your home directory, run the following command:

clipfs ~/ClipDrive You should now see a new drive called "ClipDrive" in Finder. Any files or text you copy to your clipboard will be available in this virtual drive.

To unmount the virtual drive, run the following command in Terminal:

clipfs -u mountpoint Replace "mountpoint" with the path to the mount point you specified earlier. For example, if you mounted the clipboard as "ClipDrive" in your home directory, run the following command to unmount it:

clipfs -u ~/ClipDrive Note that ClipFS is a third-party application and may not work perfectly in all situations. Use it at your own risk and be sure to backup any important data before trying it out. ```

Googling ClipFS returned nothing!


👤 smoldesu
Probably, but I bet you'd end up mounting it with FUSE. If you're going to do that, I don't see why you wouldn't just write a userspace clipboard manager instead.