aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions
diff options
context:
space:
mode:
Diffstat (limited to 'share/functions')
-rw-r--r--share/functions/__fish_systemctl_mounts.fish5
-rw-r--r--share/functions/__fish_systemctl_service_paths.fish5
-rw-r--r--share/functions/__fish_systemctl_services.fish5
-rw-r--r--share/functions/__fish_systemctl_sockets.fish5
4 files changed, 12 insertions, 8 deletions
diff --git a/share/functions/__fish_systemctl_mounts.fish b/share/functions/__fish_systemctl_mounts.fish
index 706e6ee8..5f23bba1 100644
--- a/share/functions/__fish_systemctl_mounts.fish
+++ b/share/functions/__fish_systemctl_mounts.fish
@@ -1,4 +1,5 @@
function __fish_systemctl_mounts
- command find /etc/systemd/system -type f -name '*.mount' -printf '%f\n'
- command find /usr/lib/systemd/system -type f -name '*.mount' -printf '%f\n'
+ if type -q systemctl
+ systemctl list-unit-files --no-legend --type=mount ^/dev/null | cut -f 1 -d ' '
+ end
end
diff --git a/share/functions/__fish_systemctl_service_paths.fish b/share/functions/__fish_systemctl_service_paths.fish
index 6f8435cf..2f79ec10 100644
--- a/share/functions/__fish_systemctl_service_paths.fish
+++ b/share/functions/__fish_systemctl_service_paths.fish
@@ -1,4 +1,5 @@
function __fish_systemctl_service_paths
- command find /etc/systemd/system -type f -name '*.path' -printf '%f\n'
- command find /usr/lib/systemd/system -type f -name '*.path' -printf '%f\n'
+ if type -q systemctl
+ systemctl list-unit-files --no-legend --type=path ^/dev/null | cut -f 1 -d ' '
+ end
end
diff --git a/share/functions/__fish_systemctl_services.fish b/share/functions/__fish_systemctl_services.fish
index a9fd38ba..f48cb324 100644
--- a/share/functions/__fish_systemctl_services.fish
+++ b/share/functions/__fish_systemctl_services.fish
@@ -1,4 +1,5 @@
function __fish_systemctl_services
- command find /etc/systemd/system -type f -name '*.service' -printf '%f\n'
- command find /usr/lib/systemd/system -type f -name '*.service' -printf '%f\n'
+ if type -q systemctl
+ systemctl list-unit-files --no-legend --type=service ^/dev/null | cut -f 1 -d ' '
+ end
end
diff --git a/share/functions/__fish_systemctl_sockets.fish b/share/functions/__fish_systemctl_sockets.fish
index 0fe5b6e8..ecb61ea2 100644
--- a/share/functions/__fish_systemctl_sockets.fish
+++ b/share/functions/__fish_systemctl_sockets.fish
@@ -1,4 +1,5 @@
function __fish_systemctl_sockets
- command find /etc/systemd/system -type f -name '*.socket' -printf '%f\n'
- command find /usr/lib/systemd/system -type f -name '*.socket' -printf '%f\n'
+ if type -q systemctl
+ systemctl list-unit-files --no-legend --type=socket ^/dev/null | cut -f 1 -d ' '
+ end
end