commit 72a69063933a5fa836c6ac71417a21b6f423b5b6 parent 16c462398afee4caebd8bd665fe6131a3ea81d0e Author: Wim Dupont <wim@wimdupont.com> Date: Mon, 10 Jun 2024 08:16:19 +0200 updated adoc Diffstat:
M | bin/adoc | | | 9 | ++++----- |
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/bin/adoc b/bin/adoc @@ -10,17 +10,16 @@ readonly BROWSER=$(xdg-settings get default-web-browser | xargs echo `sed 's/.de readonly ADOC_FILE="$filename.adoc" readonly OUTPUT_FILE="$filename.html" +test ! -f "$ADOC_FILE" && echo "\"$ADOC_FILE\" not found." >&2 && exit 1 + asciidoctor -o "$OUTPUT_FILE" "$ADOC_FILE" window_id=$(xdotool search --onlyvisible --class "$BROWSER") if [ -n "$window_id" ]; then xdotool key --window $window_id ctrl+l ctrl+c Escape - clipboard=$(xclip -o -selection clipboard) - name=$(echo "$clipboard") - if [[ $name == *"$filename"* ]]; then - xdotool key --window $window_id F5 && exit 0 - fi + name=$(xclip -o -selection clipboard) + [[ $name == *"$OUTPUT_FILE" ]] && xdotool key --window $window_id F5 && exit 0 fi $BROWSER $OUTPUT_FILE &