From ee2ab5b7f989310e234eaa3525f9ef0133c2625c Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 21 Nov 2022 17:20:11 +0100 Subject: [PATCH] [Doc] Add example run command with cgroup support (#1752) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds an example command to launch processes via systemd-run into a dedicated systemd scope within the users slice, which allows using systemd-oomd, that evaluates memory consumption on a per cgroup basis. The systemd-run arguments are chosen in alignment with systemds desktop environment integration recommendations¹. [1] https://systemd.io/DESKTOP_ENVIRONMENTS/ Co-Authored-By: Dave Davenport Co-authored-by: Dave Davenport --- doc/rofi.1 | 12 ++++++++++++ doc/rofi.1.markdown | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/doc/rofi.1 b/doc/rofi.1 index b2eb5db2..20db729f 100644 --- a/doc/rofi.1 +++ b/doc/rofi.1 @@ -901,6 +901,18 @@ See \fIPATTERN\fP\&. .PP Default: \fI{cmd}\fP +.PP +Example to run applications in a dedicated cgroup with systemd. Requires a shell to escape and interpolate the unit name correctly. + +.PP +.RS + +.nf +"bash -c 'systemd-run --user --unit=app-rofi-\\$(systemd-escape {cmd})-\\$RANDOM {cmd}'" + +.fi +.RE + .PP \fB\fC-run-shell-command\fR \fIcmd\fP diff --git a/doc/rofi.1.markdown b/doc/rofi.1.markdown index 2f8a82e4..73d94af6 100644 --- a/doc/rofi.1.markdown +++ b/doc/rofi.1.markdown @@ -543,6 +543,12 @@ See *PATTERN*. Default: *{cmd}* +Example to run applications in a dedicated cgroup with systemd. Requires a shell to escape and interpolate the unit name correctly. + +``` +"bash -c 'systemd-run --user --unit=app-rofi-\$(systemd-escape {cmd})-\$RANDOM {cmd}'" +``` + `-run-shell-command` *cmd* Set command to execute when running an application in a shell.