Skip to content

Instantly share code, notes, and snippets.

@carlzulauf
Last active May 5, 2016 15:16
Show Gist options
  • Save carlzulauf/5ada4b21dc53555196b58b83adb856fc to your computer and use it in GitHub Desktop.
Save carlzulauf/5ada4b21dc53555196b58b83adb856fc to your computer and use it in GitHub Desktop.
The nautilus uri scheme

Add the following line to ~/.local/share/applications/mimeapps.list:

x-scheme-handler/nautilus=nautilus-handler.desktop

Place nautilus-handler.desktop into ~/.local/share/applications.

Place nautilus-hander into a PATH directory. I use ~/bin. Make this executable (chmod +x nautilus-handler).

Now nautilus uri scheme (example: nautilus:/some/path) links should work.

#!/usr/bin/env ruby
path = ARGV[0].match(/\Anautilus:(.+)\Z/)[1]
exec %(nautilus --new-window "#{path}")
[Desktop Entry]
Name=Nautilus Handler
Comment=Access and organize files
Exec=nautilus-handler %u
Icon=system-file-manager
Terminal=false
Type=Application
Actions=Window;
MimeType=x-scheme-handler/nautilus;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment