aboutsummaryrefslogtreecommitdiff
path: root/dfm.c
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2026-02-28 10:13:04 +0200
committerDylan Araps <dylan.araps@gmail.com>2026-02-28 10:13:04 +0200
commitfe79d85e1767cd9095b1139aa22460ca2d1dde8c (patch)
tree4fe39f4024478f8b6fdf7c4c4b0029235efb8bc2 /dfm.c
parent6d0c06793dd933ea5156090a65e4f9117d9ccc8e (diff)
parent60305617a34570eb0b4118a0216278e4d3871704 (diff)
Merge branch 'trash'
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 6df8da8..c2fa0d5 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 {
@@ -2645,6 +2647,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);