diff --git a/CHANGELOG.md b/CHANGELOG.md index 416e049bd..453d1e570 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,7 @@ Life is tight as of the moment. Any help will do. 💓 - Hyprland: Drop of hyprlang support - GTK: Have a separate 'DCONF_PROFILE' for GTK apps! For QT, twas always handled by qt6ct and should not mangle with QT. But KDE apps uses ~/.config/kdeglobals which might break KDE apps for multi DE. (No fix for now) +- Clipboard: `ydotool` is preferred over `wtype` for auto-pasting selected entry from clipboard ### Fixed diff --git a/Configs/.local/lib/hyde/globalcontrol.sh b/Configs/.local/lib/hyde/globalcontrol.sh index a6143d6fe..8896fe657 100755 --- a/Configs/.local/lib/hyde/globalcontrol.sh +++ b/Configs/.local/lib/hyde/globalcontrol.sh @@ -373,8 +373,17 @@ get_rofi_pos() { } paste_string() { - if ! command -v wtype >/dev/null; then exit 0; fi + local paste_cmd="" + if command -v ydotool >/dev/null; then + paste_cmd="ydotool key 29:1 && sleep 0.01 && ydotool key 47:1 47:0 && sleep 0.01 && ydotool key 29:0" + elif command -v wtype >/dev/null; then + paste_cmd="wtype -M ctrl V -m ctrl" + else + exit 0 + fi + if [ -t 1 ]; then return 0; fi + ignore_paste_file="$HYDE_STATE_HOME/ignore.paste" if [[ ! -e $ignore_paste_file ]]; then cat <"$ignore_paste_file" @@ -386,11 +395,13 @@ Alacritty xterm-256color EOF fi + ignore_class=$(echo "$@" | awk -F'--ignore=' '{print $2}') [ -n "$ignore_class" ] && echo "$ignore_class" >>"$ignore_paste_file" && print_log -y "[ignore]" "'$ignore_class'" && exit 0 + class=$(hyprctl -j activewindow | jq -r '.initialClass') if ! grep -q "$class" "$ignore_paste_file"; then - hyprctl -q dispatch exec 'wtype -M ctrl V -m ctrl' + hyprctl -q dispatch exec "$paste_cmd" fi } is_hovered() { diff --git a/Scripts/dots/deps.toml b/Scripts/dots/deps.toml index b5f76d5fa..dc0eba148 100644 --- a/Scripts/dots/deps.toml +++ b/Scripts/dots/deps.toml @@ -36,6 +36,9 @@ pacman = [ "satty", # Modern Screenshot Annotation "cliphist", # clipboard manager "wl-clip-persist", # Keep Wayland clipboard even after programs close (avoids crashes) + "ydotool", # preferred tool for auto-pasting from clipboard + # "wtype", # alternative tool for auto-pasting from clipboard + # Dependencies "hyprpolkitagent", # authentication agent "xdg-desktop-portal-hyprland", # xdg desktop portal for hyprland diff --git a/Scripts/pkg_extra.lst b/Scripts/pkg_extra.lst index ddffb8daa..ba440ea3c 100644 --- a/Scripts/pkg_extra.lst +++ b/Scripts/pkg_extra.lst @@ -8,6 +8,8 @@ python-requests|wttrbar # script dependency ddcui # GUI to control brightness for external monitors # hyprgui-bin # GUI for hyprland configuration // might mess your userprefs but convenient // Just disappeared # power-profiles-daemon # for managing power profiles from waybar +# ydotool # preferred tool for auto-pasting from clipboard +# wtype # alternative tool for auto-pasting from clipboard # --------------------------------------------------- // Shell