From 79eb4385bd34e8ee06b35637f092ee45dc3e3706 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 14 Mar 2026 09:31:51 +0200 Subject: dfm: Add privilege escalation. Pressing 'Z' (default) will spawn a nested dfm by escalating privileges using the value of DFM_SU (default 'sudo'). Pressing 'Z' again inside of this escalated mode returns to the original dfm. --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index aa537c7..9563d24 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Initial Announcement: https://dylan.gr/1772192922 * [Searching](#searching) * [Marking](#marking) * [Commands](#commands) + * [Privilege Escalation](#privilege-escalation) * [Bound Commands](#bound-commands) * [Design Considerations](#design-considerations) * [Conclusion](#conclusion) @@ -190,6 +191,8 @@ environment, default values are derived from the `config.h.in` file. - DFM_TRASH_DIR (Path to trash directory) - DFM_IMG_MODE (Image mode to use: 'chafa' (default), 'kitty') + +- DFM_SU (Privilege escalation tool to use: 'sudo' (default)) ``` ### CD On Exit @@ -386,6 +389,19 @@ and sends it all to the shell. ``` +### Privilege Escalation + +Commands can be run as root by prepending `sudo` or a similar tool on the +command-line. For more complex situations, pressing `Z` by default will use +`DFM_SU` (default `sudo`) to spawn another `dfm` as `root`. The statusline will +be a different color, show the nest level and display an `R` indicator to make +the escalation obvious. Pressing `Z` again inside of this escalated mode quits +and returns to the original `dfm`. + +This can be configured at runtime using the environment variable `DFM_SU` and +at compile time via the `config.h.in` file. + + ### Bound Commands Commands can be bound to keys. When a command is bound it can either run -- cgit v1.2.3