Integrating git-annex and your file manager provides an easy way to select
annexed files to get or drop.
[[!toc]]
## GNOME (nautilus)
Recent git-annex comes with built-in nautilus integration. Just pick the
action from the menu.
[[!img assistant/nautilusmenu.png]]
[[!img assistant/downloadnotification.png]]
This is set up by making simple scripts in
`~/.local/share/nautilus/scripts`, with names like "git-annex get"
## KDE (Dolphin/Konqueror)
Create a file `~/.kde4/share/kde4/services/ServiceMenus/git-annex.desktop` with the following contents:
[Desktop Entry]
Type=Service
ServiceTypes=all/allfiles
MimeType=all/all;
Actions=GitAnnexGet;GitAnnexDrop;
X-KDE-Priority=TopLevel
X-KDE-Submenu=Git-Annex
X-KDE-Icon=git-annex
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
[Desktop Action GitAnnexGet]
Name=Get
Icon=git-annex
Exec=git-annex get --notify-start --notify-finish -- %U
[Desktop Action GitAnnexDrop]
Name=Drop
Icon=git-annex
Exec=git-annex drop --notify-start --notify-finish -- %U
## XFCE (Thunar)
XFCE uses the Thunar file manager, which can also be easily configured to allow for custom actions. Just go to the "Configure custom actions..." item in the "Edit" menu, and create a custom action for get and drop with the following commands:
git-annex drop --notify-start --notify-finish -- %F
for drop, and for get:
git-annex drop --notify-start --notify-finish -- %F
This gives me the resulting config on disk, in `.config/Thunar/uca.xml`:
git-annex
git-annex get
1396278104182858-3
git-annex get --notify-start --notify-finish -- %F
get the files from a remote git annex repository
*
git-annex
git-annex drop
1396278093174843-2
git-annex drop --notify-start --notify-finish -- %F
drop the files from the local repository
*
The complete instructions on how to setup actions is [in the XFCE documentation](http://docs.xfce.org/xfce/thunar/custom-actions).
## OS X (Finder)
For OS X, it is possible to get context menus in Finder. Due to how OS X deals with sym links, one needs to operate on folders if using indirect mode. Direct mode operation has not been tested.
1. Open Automator and create a new Service.
2. Using the Drop down menus in the top create the sentence "Service receives selected folders in Finder.app" to have it work on folders. For direct mode operation it is probably reasonable to select "files or folders".
3. Add a "Run shell script" element and fill in line with the following script:
#!/usr/bin/bash
source ~/.bash_profile
for f in "$@"
do
cd "$(dirname "$f")" && git-annex get "$f"
done
The purpose of the first line is there to get git-annex on to the path. The reason for the for loop is in case multiple files or folders are marked when running the context menu command.
Finally save the the workflow under the name for which it should be listed in the context menu.
## your file manager here
Edit this page and add instructions!
## general
If your file manager can run a command on a file, it should be easy to
integrate git-annex with it. A simple script will suffice:
#!/bin/sh
git-annex get --notify-start --notify-finish -- "$@"
The --notify-start and --notify-stop options make git-annex display a
desktop notification. This is useful to give the user an indication that
their action took effect. Desktop notifications are currently only
implemented for Linux.