From 5fcd3b82d3ebb8a7f9100f5a83d50a7043321f38 Mon Sep 17 00:00:00 2001 From: Katelyn Hamer Date: Sun, 3 Nov 2019 14:10:53 +0000 Subject: [PATCH] Added checks for wmctrl --- lfetch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lfetch b/lfetch index bc91ff5..a1c1163 100755 --- a/lfetch +++ b/lfetch @@ -16,7 +16,12 @@ ram_total() { # Get WM name (Requires wmctrl to be installed!) wm_name() { - awk '/Name:/ {print $2}' <(wmctrl -m) + if [ -x "$(command -v wmctrl)" ] + then + awk '/Name:/ {print $2}' <(wmctrl -m) + else + echo "Unknown (Is wmctrl installed?)" + fi } # Store OS info (DOES NOT WORK ON ALL SYSTEMS!)