From 6a1d4dcbc56d9de5ae32ee75a5be6c454fe9d569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Tue, 26 Jun 2018 21:38:39 +0200 Subject: [PATCH] Fix debug/log-viewer for non-nixos systems + show more initial lines --- debug | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/debug b/debug index 49a99e4..a632426 100755 --- a/debug +++ b/debug @@ -1,5 +1,6 @@ #!/usr/bin/env zsh +# Ref: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1 function skip-crap { local crap_start=".*: Object [^ ]+ \(.*\), has been already finalized. Impossible to \w* any property \w* it.*" @@ -45,14 +46,20 @@ function date-on-separate-line { stdbuf -oL sed -e 's|\]:|]:\n |' } +# We use non-breaking space to encode newlines in multiline messages function decode-multiline-message { stdbuf -oL sed -e 's| |\n |g' } -# We use non-breaking space to encode newlines in multiline messages +function gnome-shell-exe-path { + if uname -a | grep --silent "NixOS"; then + echo $(dirname =gnome-shell(:A))/.gnome-shell-wrapped + else + echo =gnome-shell + fi +} -journalctl --follow \ - $(dirname =gnome-shell(:A))/.gnome-shell-wrapped \ +journalctl --follow --lines 400 $(gnome-shell-exe-path) \ | skip-crap \ | date-on-separate-line \ | decode-multiline-message