core-system-scripts

Scripts submodule for the core-system repository
git clone https://ccx.te2000.cz/git/core-system-scripts
Log | Files | Refs

commit 98fabf6dffa7a3a7850f1797f557e181b7e8460f
parent 540815c826497ed6eee568db74ffbe89aa96fb98
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Fri, 29 Jul 2022 02:59:01 +0200

Align oneshots and longruns, move desired state indicator.

Diffstat:
Mcommand/s | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/command/s b/command/s @@ -100,15 +100,15 @@ show_oneshots() { local -a fmt_active=( '%F{yellow}%BA%b%f' '%F{cyan}I%f' ) local s pre post='%s' for s in $oneshots; do - pre='' + pre=' ' if (($+service_active[$s] ^^ $+service_in_bundle[$s//$default_bundle])); then if (($+service_active[$s])); then - pre='_%S' + pre=' _%S' else - pre='^%S' + pre=' ^%S' fi fi - printf "%s %s" ${(%)fmt_active[${service_active[$s]:-2}]} ${(%)pre}$s${(%)post} + printf "%s" ${(%)fmt_active[${service_active[$s]:-2}]} ${(%)pre} $s ${(%)post} print_service_bundles $s done } @@ -124,7 +124,7 @@ show_longruns() { else active=3 fi - pre='' + pre=' ' if (($+service_active[$s] ^^ $+service_in_bundle[$s//$default_bundle])); then if (($+service_active[$s])); then pre='_%S' @@ -132,7 +132,7 @@ show_longruns() { pre='^%S' fi fi - printf "%s %s" ${(%)fmt_up[$state]}${(%)fmt_active[$active]} ${(%)pre}$s${(%)post} + printf "%s" ${(%)fmt_active[$active]} ${(%)fmt_up[$state]} ${(%)pre} $s ${(%)post} print_service_bundles $s done }