just do everything i guess
This commit is contained in:
parent
1e7b7d1614
commit
3ed9fd154f
5 changed files with 251 additions and 13 deletions
16
flake.nix
16
flake.nix
|
|
@ -84,13 +84,17 @@
|
|||
$entries
|
||||
}
|
||||
"systemctl" => {
|
||||
if ($spans | length) < 2 { null } else {
|
||||
if ($spans | length) < 3 { null } else {
|
||||
let kw = $spans | last
|
||||
^systemctl list-units --all --no-pager --plain --full $"($kw)*"
|
||||
| detect columns
|
||||
| drop 7
|
||||
| headers
|
||||
| each { |r| {value: $r.UNIT, description: ($r.DESCRIPTION | default "")} }
|
||||
let scope = if ("--user" in $spans) { [--user] } else { [] }
|
||||
^systemctl ...$scope list-units --all --no-pager --plain --full --no-legend $"($kw)*"
|
||||
| lines
|
||||
| each { |l|
|
||||
let cols = $l | split column -r '\s\s+' unit load active sub desc
|
||||
if ($cols | length) > 0 {
|
||||
{value: $cols.0.unit, description: ($cols.0.desc | default "")}
|
||||
}
|
||||
} | compact
|
||||
}
|
||||
}
|
||||
_ => { null }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue