about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2019-10-02 01:28:35 +0200
committertoonn <toonn@toonn.io>2019-10-02 01:39:41 +0200
commitff2a00f2abc2c3205d5fc9fd71f3244e084020d5 (patch)
treee94fc1c36147489a8f9f6655b0156c2b07171418 /ranger
parent0364edc90e750a6ad6317bd12276d7d04e3f5b86 (diff)
downloadranger-ff2a00f2abc2c3205d5fc9fd71f3244e084020d5.tar.gz
Add "trash" label to rifle rules for convenience
Also add a generic rule that should serve a similar function to
`trash-cli`, i.e., move the files somewhere so they're marked for
deletion without actually deleting them. Should be fairly simple to
delete the trash by `rm -r`ing the trash directory.
Diffstat (limited to 'ranger')
-rw-r--r--ranger/config/rifle.conf3
1 files changed, 2 insertions, 1 deletions
diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf
index ed99a387..c26b66b5 100644
--- a/ranger/config/rifle.conf
+++ b/ranger/config/rifle.conf
@@ -274,4 +274,5 @@ label pager,  !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php  = "$PAGER"
 mime application/x-executable = "$1"
 
 # Move the file to trash using trash-cli.
-has trash-put = trash-put -- "$@"
+label trash, has trash-put = trash-put -- "$@"
+label trash = mkdir -p -- ${"$XDG_DATA_DIR"/ranger-trash:-~/.ranger/trash}; mv -- "$@" ${"$XDG_DATA_DIR"/ranger-trash:-~/.ranger/trash}