summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2026-10-27 17:54:18 +0100
committerache <ache@ache.one>2026-10-27 17:54:18 +0100
commit38b33c850bd461c3f8b768ef989fa006131b5f12 (patch)
treefb3adee0bfb2ebf88661a87bc03ce0b1b042e8cd
parentAdd sql_info (diff)
Ajout des fonctions racoursis systemctlHEADmaster
-rw-r--r--functions/_sysls.fish28
-rw-r--r--functions/s.fish1
-rw-r--r--functions/sj.fish1
-rw-r--r--functions/u.fish1
-rw-r--r--functions/uj.fish1
5 files changed, 32 insertions, 0 deletions
diff --git a/functions/_sysls.fish b/functions/_sysls.fish
new file mode 100644
index 0000000..156a293
--- /dev/null
+++ b/functions/_sysls.fish
@@ -0,0 +1,28 @@
+function _sysls --argument-names WIDE STATE
+ begin
+ systemctl $WIDE list-units --quiet $STATE
+ systemctl $WIDE list-unit-files --quiet $STATE
+ end | sed 's/●/ /' \
+ | grep . \
+ | column --table --table-columns-limit=5 \
+ | fzf --header-lines=1 \
+ --accept-nth=1 \
+ --no-hscroll \
+ --preview "SYSTEMD_COLORS=1 systemctl $WIDE status {1}" \
+ --preview-window=down
+ # sed: To strip the dot which takes a column
+ # grep: To strip empty line
+ # column: To present the data as a table. Timit to 5 is to get the DESCRIPTION column
+end
+
+# function _sysls --argument-names WIDE STATE
+# cat (echo 'UNIT/FILE LOAD/STATE ACTIVE/PRESET SUB DESCRIPTION' | psub) (systemctl $WIDE list-units --quiet $STATE | psub) (systemctl $WIDE list-unit-files --quiet $STATE | psub) \
+# | sed 's/●/ /' \
+# | grep . \
+# | column --table --table-columns-limit=5 \
+# | fzf --header-lines=1 \
+# --accept-nth=1 \
+# --no-hscroll \
+# --preview="SYSTEMD_COLORS=1 systemctl $WIDE status {1}" \
+# --preview-window=down
+# end
diff --git a/functions/s.fish b/functions/s.fish
new file mode 100644
index 0000000..7cc5e9e
--- /dev/null
+++ b/functions/s.fish
@@ -0,0 +1 @@
+abbr --add s 'sudo systemctl'
diff --git a/functions/sj.fish b/functions/sj.fish
new file mode 100644
index 0000000..11b72dc
--- /dev/null
+++ b/functions/sj.fish
@@ -0,0 +1 @@
+abbr --add sj journalctl
diff --git a/functions/u.fish b/functions/u.fish
new file mode 100644
index 0000000..aa90185
--- /dev/null
+++ b/functions/u.fish
@@ -0,0 +1 @@
+abbr --add u 'systemctl --user'
diff --git a/functions/uj.fish b/functions/uj.fish
new file mode 100644
index 0000000..e5a1517
--- /dev/null
+++ b/functions/uj.fish
@@ -0,0 +1 @@
+abbr --add uj 'journalctl --user'