aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_systemctl_scopes.fish
diff options
context:
space:
mode:
Diffstat (limited to 'share/functions/__fish_systemctl_scopes.fish')
-rw-r--r--share/functions/__fish_systemctl_scopes.fish11
1 files changed, 11 insertions, 0 deletions
diff --git a/share/functions/__fish_systemctl_scopes.fish b/share/functions/__fish_systemctl_scopes.fish
new file mode 100644
index 00000000..f2f5cbcc
--- /dev/null
+++ b/share/functions/__fish_systemctl_scopes.fish
@@ -0,0 +1,11 @@
+function __fish_systemctl_scopes
+ if type -q systemctl
+ if __fish_contains_opt user
+ # Scopes are usually generated at runtime
+ # Therefore show known _units_, not unit-files
+ systemctl --user list-units --no-legend --type=scope ^/dev/null | cut -f 1 -d ' '
+ else
+ systemctl list-units --no-legend --type=scope ^/dev/null | cut -f 1 -d ' '
+ end
+ end
+end