update lservices function

This commit is contained in:
Tomasz Kapias 2023-03-19 23:20:29 +07:00
parent c4ff5771dc
commit ccf2fdf0d7
Signed by: tkapias
SSH key fingerprint: SHA256:bsmasrX7y0xxAHa/x1x8zAgHInO4nPpKMk5JIQ0Vsbw

View file

@ -140,11 +140,11 @@ lservices() {
fi
if [[ "$_UID" == "0" ]]; then
local _OUT=$(sudo systemctl list-units --system -q --plain --full --no-pager -t service,scope | sort)
local _OUT=$(sudo systemctl list-units --system -q --plain --full --no-pager -t service,scope | grep -E '.scope|.service' | sort)
elif [[ "$_UID" == "$(id -u)" ]]; then
local _OUT=$(systemctl list-units --user -q --plain --full --no-pager -t service,scope | sort)
local _OUT=$(systemctl list-units --user -q --plain --full --no-pager -t service,scope | grep -E '.scope|.service' | sort)
else
local _OUT=$(sudo machinectl -q shell --uid="$_UID" .host /usr/bin/systemctl list-units --user -q --plain --full --no-pager -t service,scope | sort)
local _OUT=$(sudo machinectl -q shell --uid="$_UID" .host /usr/bin/systemctl list-units --user -q --plain --full --no-pager -t service,scope | grep -E '.scope|.service' | sort)
fi
if [[ $_XCLIP == 1 ]]; then