diff --git a/share/functions/__fish_systemctl_mounts.fish b/share/functions/__fish_systemctl_mounts.fish index 5f23bba1b..b3e7dd6ab 100644 --- a/share/functions/__fish_systemctl_mounts.fish +++ b/share/functions/__fish_systemctl_mounts.fish @@ -1,5 +1,9 @@ function __fish_systemctl_mounts - if type -q systemctl - systemctl list-unit-files --no-legend --type=mount ^/dev/null | cut -f 1 -d ' ' - end + if type -q systemctl + if __fish_contains_opt user + systemctl --user list-unit-files --no-legend --type=mount ^/dev/null | cut -f 1 -d ' ' + else + systemctl list-unit-files --no-legend --type=mount ^/dev/null | cut -f 1 -d ' ' + end + end end diff --git a/share/functions/__fish_systemctl_service_paths.fish b/share/functions/__fish_systemctl_service_paths.fish index 2f79ec106..4c5d5ab51 100644 --- a/share/functions/__fish_systemctl_service_paths.fish +++ b/share/functions/__fish_systemctl_service_paths.fish @@ -1,5 +1,9 @@ function __fish_systemctl_service_paths - if type -q systemctl - systemctl list-unit-files --no-legend --type=path ^/dev/null | cut -f 1 -d ' ' - end + if type -q systemctl + if __fish_contains_opt user + systemctl --user list-unit-files --no-legend --type=path ^/dev/null | cut -f 1 -d ' ' + else + systemctl list-unit-files --no-legend --type=path ^/dev/null | cut -f 1 -d ' ' + end + end end diff --git a/share/functions/__fish_systemctl_services.fish b/share/functions/__fish_systemctl_services.fish index f48cb3249..e047e6adf 100644 --- a/share/functions/__fish_systemctl_services.fish +++ b/share/functions/__fish_systemctl_services.fish @@ -1,5 +1,9 @@ function __fish_systemctl_services - if type -q systemctl - systemctl list-unit-files --no-legend --type=service ^/dev/null | cut -f 1 -d ' ' - end + if type -q systemctl + if __fish_contains_opt user + systemctl --user list-unit-files --no-legend --type=service ^/dev/null | cut -f 1 -d ' ' + else + systemctl list-unit-files --no-legend --type=service ^/dev/null | cut -f 1 -d ' ' + end + end end diff --git a/share/functions/__fish_systemctl_sockets.fish b/share/functions/__fish_systemctl_sockets.fish index ecb61ea2d..f17541ef4 100644 --- a/share/functions/__fish_systemctl_sockets.fish +++ b/share/functions/__fish_systemctl_sockets.fish @@ -1,5 +1,9 @@ function __fish_systemctl_sockets - if type -q systemctl - systemctl list-unit-files --no-legend --type=socket ^/dev/null | cut -f 1 -d ' ' - end + if type -q systemctl + if __fish_contains_opt user + systemctl --user list-unit-files --no-legend --type=socket ^/dev/null | cut -f 1 -d ' ' + else + systemctl list-unit-files --no-legend --type=socket ^/dev/null | cut -f 1 -d ' ' + end + end end