From 9dbfb53327548ccc246f1d025aa935be2b4c821c Mon Sep 17 00:00:00 2001 From: Gal Szkolnik Date: Fri, 26 Aug 2022 14:13:42 -0400 Subject: [PATCH] =Better systemctl handling --- _home/dot_sz.shrc.d/10_path.env | 18 ------------------ _home/private_dot_poshtheme.omp.json | 2 +- 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 _home/dot_sz.shrc.d/10_path.env diff --git a/_home/dot_sz.shrc.d/10_path.env b/_home/dot_sz.shrc.d/10_path.env deleted file mode 100644 index 6f95470..0000000 --- a/_home/dot_sz.shrc.d/10_path.env +++ /dev/null @@ -1,18 +0,0 @@ -get_clean_path() { - sed 's/ *:\?$//g;s/`/``/g;s/:/`:`/g;s/\\`:`/\\:/g;' <<< $1 | \ - awk -v RS='`:`' -v ORS='`:`' '!arr[$0]++' | \ - sed 's/`:`/:/g;s/:$//g' -} - -# set PATH so it includes user's private bin if it exists -if [[ -d "$HOME/bin" ]] ; then - export PATH="$HOME/bin:$PATH" -fi - -# set PATH so it includes user's private bin if it exists -if [[ -d "$HOME/.local/bin" ]] ; then - export PATH="$HOME/.local/bin:$PATH" -fi - -PATH=$( get_clean_path $PATH ) - diff --git a/_home/private_dot_poshtheme.omp.json b/_home/private_dot_poshtheme.omp.json index 4423f0b..d0fc154 100644 --- a/_home/private_dot_poshtheme.omp.json +++ b/_home/private_dot_poshtheme.omp.json @@ -63,7 +63,7 @@ "style": "powerline", "properties": { "shell": "bash", - "command": "systemctl is-system-running || true" + "command": "'[[ -n \"$(type -t systemctl)\" ]] && systemctl is-system-running || true'" }, "template": "{{ if not (contains \"running\" .Output) }} {{ .Output }} {{ end }}" },