diff options
| -rw-r--r-- | functions/_sysls.fish | 28 | ||||
| -rw-r--r-- | functions/s.fish | 1 | ||||
| -rw-r--r-- | functions/sj.fish | 1 | ||||
| -rw-r--r-- | functions/u.fish | 1 | ||||
| -rw-r--r-- | functions/uj.fish | 1 |
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' |