From cecf7f31f48da205e46025f6d790d5a3126b34f4 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 2 Mar 2025 15:31:14 +0100 Subject: [PATCH] Added colored journal and tail output on follow --- fish_cfg/functions/journalctl.fish | 8 ++++++++ fish_cfg/functions/tail.fish | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 fish_cfg/functions/journalctl.fish create mode 100644 fish_cfg/functions/tail.fish diff --git a/fish_cfg/functions/journalctl.fish b/fish_cfg/functions/journalctl.fish new file mode 100644 index 0000000..c33a0a3 --- /dev/null +++ b/fish_cfg/functions/journalctl.fish @@ -0,0 +1,8 @@ +function journalctl --wraps='`which journalctl` | ccze -A' --description 'alias journalctl=journalctl | ccze -A' + if string match -qr -- ".*-f.*" "$argv" + command journalctl $argv | ccze -A + else + command journalctl $argv + end + +end diff --git a/fish_cfg/functions/tail.fish b/fish_cfg/functions/tail.fish new file mode 100644 index 0000000..7b45f54 --- /dev/null +++ b/fish_cfg/functions/tail.fish @@ -0,0 +1,8 @@ +function tail --wraps='journalctl' --description 'journalctl $argv | ccze -A' + if string match -qir -- ".*-f.*" "$argv" + command tail $argv | ccze -A + else + command tail $argv + end + +end