From 7f19a6cf82942c1b96f498e02830595040269883 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sun, 12 May 2019 16:47:42 +0530 Subject: [PATCH] Check if DISPLAY var is set for clipboard --- mbin.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mbin.sh b/mbin.sh index 869821a..d3a1920 100755 --- a/mbin.sh +++ b/mbin.sh @@ -23,5 +23,9 @@ if [[ $HASTEBIN == 1 ]]; then else link=$(echo $op | cut -f2 -d'/') fi -echo ${MKR_BIN}${link} | tee /dev/tty | xclip -selection clipboard -xdg-open ${MKR_BIN}${link} +if [[ -v DISPLAY ]]; then + echo ${MKR_BIN}${link} | tee /dev/tty | xclip -selection clipboard + xdg-open ${MKR_BIN}${link} +else + echo ${MKR_BIN}${link} +fi