add dragon script

This commit is contained in:
sudacode 2025-03-12 15:36:48 -07:00
parent 6b4b3c8351
commit db2dacd9d8
Signed by: sudacode
SSH Key Fingerprint: SHA256:lT5C2bB398DcX6daCF/gYFNSTK3y+Du3oTGUnYzfTEw

14
dragon.sh Executable file
View File

@ -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