aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-11-14 14:55:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-11-14 14:55:21 -0400
commitcc7caaa6f1035b3a38966534b3d9c7b8db25fdb9 (patch)
treebf9165fe08e1ba70d0754d63d94043a3948ccc79
parenta471f380bd56373bf9613c3b4bfe7448318a0619 (diff)
Add undo action to nautilus and konqueror integration.
-rw-r--r--Assistant/Install.hs8
-rw-r--r--debian/changelog1
-rw-r--r--doc/tips/file_manager_integration.mdwn20
3 files changed, 22 insertions, 7 deletions
diff --git a/Assistant/Install.hs b/Assistant/Install.hs
index bba1c5d62..2e57bd38a 100644
--- a/Assistant/Install.hs
+++ b/Assistant/Install.hs
@@ -92,18 +92,20 @@ installWrapper file content = do
installFileManagerHooks :: FilePath -> IO ()
#ifdef linux_HOST_OS
installFileManagerHooks program = do
+ let actions = ["get", "drop", "undo"]
+
-- Gnome
nautilusScriptdir <- (\d -> d </> "nautilus" </> "scripts") <$> userDataDir
createDirectoryIfMissing True nautilusScriptdir
- genNautilusScript nautilusScriptdir "get"
- genNautilusScript nautilusScriptdir "drop"
+ forM_ actions $
+ genNautilusScript nautilusScriptdir
-- KDE
home <- myHomeDir
let kdeServiceMenusdir = home </> ".kde" </> "share" </> "kde4" </> "services" </> "ServiceMenus"
createDirectoryIfMissing True kdeServiceMenusdir
writeFile (kdeServiceMenusdir </> "git-annex.desktop")
- (kdeDesktopFile ["get", "drop"])
+ (kdeDesktopFile actions)
where
genNautilusScript scriptdir action =
installscript (scriptdir </> scriptname action) $ unlines
diff --git a/debian/changelog b/debian/changelog
index aebcab67b..cc5e33a1d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ git-annex (5.20141126) UNRELEASED; urgency=medium
including git revert, git mv, git checkout ...
* undo: New command to undo the most recent change to a file
or to the contents of a directory.
+ * Add undo action to nautilus and konqueror integration.
* Work around behavior change in lsof 4.88's -F output format.
* Debian package is now maintained by Gergely Nagy.
diff --git a/doc/tips/file_manager_integration.mdwn b/doc/tips/file_manager_integration.mdwn
index 8f47a3d68..4429b9093 100644
--- a/doc/tips/file_manager_integration.mdwn
+++ b/doc/tips/file_manager_integration.mdwn
@@ -1,5 +1,6 @@
Integrating git-annex and your file manager provides an easy way to select
-annexed files to get or drop.
+annexed files to get or drop. The file manager can also be used to undo
+changes to file managed by git-annex.
[[!toc]]
@@ -25,13 +26,20 @@ This is set up by git-annex creating a
## 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:
+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, drop, and undo with the
+following commands:
git-annex drop --notify-start --notify-finish -- %F
for drop, and for get:
git-annex get --notify-start --notify-finish -- %F
+
+and for undo:
+
+ git-annex undo --notify-start --notify-finish -- %F
This gives me the resulting config on disk, in `.config/Thunar/uca.xml`:
@@ -68,7 +76,9 @@ The complete instructions on how to setup actions is [in the XFCE documentation]
## 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.
+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".
@@ -81,7 +91,9 @@ For OS X, it is possible to get context menus in Finder. Due to how OS X deals w
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.
+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.