Browse Source

Check if DISPLAY var is set for clipboard

master
Ceda EI 3 months ago
parent
commit
7f19a6cf82
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      mbin.sh

+ 6
- 2
mbin.sh View File

@@ -23,5 +23,9 @@ if [[ $HASTEBIN == 1 ]]; then
23 23
 else
24 24
 	link=$(echo $op | cut -f2 -d'/')
25 25
 fi
26
-echo ${MKR_BIN}${link} | tee /dev/tty | xclip -selection clipboard
27
-xdg-open ${MKR_BIN}${link}
26
+if [[ -v DISPLAY ]]; then
27
+	echo ${MKR_BIN}${link} | tee /dev/tty | xclip -selection clipboard
28
+	xdg-open ${MKR_BIN}${link}
29
+else
30
+	echo ${MKR_BIN}${link}
31
+fi

Loading…
Cancel
Save