From db2dacd9d838201b1cff7675db0fbd47bcc54224 Mon Sep 17 00:00:00 2001 From: sudacode Date: Wed, 12 Mar 2025 15:36:48 -0700 Subject: [PATCH] add dragon script --- dragon.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 dragon.sh diff --git a/dragon.sh b/dragon.sh new file mode 100755 index 0000000..f2035ed --- /dev/null +++ b/dragon.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -Eeuo pipefail +HOME="/home/$(whoami)" +clip="$(wl-paste)" +if [[ -z "$clip" ]]; then + notify-send "Dragon" "Clipboard is empty" + exit 1 +fi +DIR="$(hyprctl activeworkspace | grep -i lastwindowtitle | sed 's/\slastwindowtitle: //')" +DIR="${DIR//\~/$HOME}" +PTH="$DIR/$(basename "$clip")" +if [[ -e "$PTH" ]]; then + dragon-drop "$PTH" +fi