aboutsummaryrefslogtreecommitdiff
path: root/dfm.c
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2026-02-28 10:12:51 +0200
committerDylan Araps <dylan.araps@gmail.com>2026-02-28 10:12:51 +0200
commit60305617a34570eb0b4118a0216278e4d3871704 (patch)
tree60b8ce282c55f9e95b6a0d8f72f9906a96058547 /dfm.c
parentaeeb1bc851b399e8acc59c180f035e9c59a3873f (diff)
dfm: add trash support
Diffstat (limited to 'dfm.c')
-rw-r--r--dfm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/dfm.c b/dfm.c
index 695b0aa..8f92f5c 100644
--- a/dfm.c
+++ b/dfm.c
@@ -97,6 +97,8 @@ static const char DFM_HELP[] =
"DFM_OPENER program used to open files (overridden by -o)\n"
"DFM_BOOKMARK_[0-9] bookmark directories\n"
"DFM_COPYER program used to copy PWD and file contents.\n"
+ "DFM_TRASH program used to trash files.\n"
+ "DFM_TRASH_DIR path to trash directory.\n"
;
enum fm_opt {
@@ -2643,6 +2645,14 @@ act_cd_mark_directory(struct fm *p)
}
static inline void
+act_cd_trash(struct fm *p)
+{
+ cut e = get_env("DFM_TRASH_DIR", DFM_TRASH_DIR);
+ if (e.l) fm_path_cd(p, e.d, e.l);
+ else fm_draw_err(p, S("DFM_TRASH_DIR not set"), 0);
+}
+
+static inline void
act_cd_last(struct fm *p)
{
fm_path_cd(p, p->ppwd.m, p->ppwd.l);