From 908909c704ababe808fc6fb014180a4436c62c29 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Wed, 3 Jun 2020 21:07:57 +0100 Subject: [PATCH] Checks that notify-send is available before running it --- examples/stty-resize-copy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/stty-resize-copy b/examples/stty-resize-copy index 58f37ed..cd0fd06 100755 --- a/examples/stty-resize-copy +++ b/examples/stty-resize-copy @@ -5,5 +5,5 @@ columns=$(stty -a < /dev/stdin | grep -oE 'columns [0-9]+' | cut -d' ' -f2) rows=$(stty -a < /dev/stdin | grep -oE 'rows [0-9]+' | cut -d' ' -f2) -notify-send "Terminal dimensions" "Rows: $rows\nColumns: $columns\nstty command on clipboard" +type notify-send > /dev/null 2>&1 && notify-send "Terminal dimensions" "Rows: $rows\nColumns: $columns\nstty command on clipboard" echo "stty rows $rows cols $columns" | xclip -i -selection clipboard