Skip to content

feat: add support of ydotool alongside with wtype - #1821

Open
zeerayne wants to merge 5 commits into
HyDE-Project:devfrom
zeerayne:ydotool
Open

feat: add support of ydotool alongside with wtype#1821
zeerayne wants to merge 5 commits into
HyDE-Project:devfrom
zeerayne:ydotool

Conversation

@zeerayne

@zeerayne zeerayne commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

This PR add feature to use ydotool when wtype is not present in the system. It can be helpful for multi-layout keyboard users because wtype breaks waybar indication of selected language.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (non-breaking change; modified files are limited to the documentations)
  • Technical debt (a code change that does not fix a bug or add a feature but makes something clearer for devs)
  • Other (provide details below)

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My commit message follows the commit guidelines.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added a changelog entry.
  • I have added necessary comments/documentation to my code.
  • I have added tests to cover my changes.
  • I have tested my code locally and it works as expected.
  • All new and existing tests passed.

@kRHYME7 I'm a little bit confused about adding changelog entry: should I create smth like ## v26.x.x | Future Release in the head of the CHANGELOG.md?

Summary by CodeRabbit

  • Bug Fixes
    • Improved auto-paste by preferring ydotool when available and falling back to wtype otherwise.
    • Added an early exit when no supported paste utility is installed.
    • Kept existing ignore rules working across the selected paste method.
  • Documentation
    • Updated the changelog to note the new ydotool-over-wtype preference.
  • Chores
    • Updated package/dependency lists to include ydotool and wtype as optional (commented) entries.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

πŸ“ Walkthrough

Walkthrough

paste_string now selects ydotool or wtype at runtime, exits when neither is installed, and passes the selected command through the existing Hyprland dispatch and ignore logic. Package configuration and release notes document the paste tools.

Changes

Paste backend selection

Layer / File(s) Summary
Backend selection and dispatch
Configs/.local/lib/hyde/globalcontrol.sh
paste_string selects an available paste tool, preserves TTY and ignore checks, and dispatches the selected command instead of hardcoding wtype.
Optional tool documentation and packaging
CHANGELOG.md, Scripts/dots/deps.toml, Scripts/pkg_extra.lst
The changelog records the backend preference; ydotool is added to pacman dependencies, while ydotool and wtype are listed as commented optional packages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: krhyme7

Poem

I’m a rabbit with a paste-ready nose,
ydotool hops where the clipboard flows.
If wtype waits in the burrow below,
The command still leaps when asked to show.
No tool? I quietly wiggle my toes.

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (4 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title clearly matches the main change: adding ydotool support alongside wtype with runtime preference handling.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@rubiin
rubiin requested a review from kRHYME7 July 25, 2026 15:51
@kRHYME7

kRHYME7 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@kRHYME7 I'm a little bit confused about adding changelog entry: should I create smth like ## v26.x.x | Future Release in the head of the CHANGELOG.md?

@zeerayne ## Unreleased would do

@zeerayne

Copy link
Copy Markdown
Contributor Author

@kRHYME7

  1. I have added changelog entry to Unreleased
  2. Changed logic a bit - now ydotool is preferred over wtype if both tools are available

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 69: Move the clipboard bullet about preferring ydotool over wtype from
the v26.7.4 section into ## Unreleased, creating or reusing its ### Changed
subsection as needed. Keep the existing wording and release sections otherwise
unchanged.

In `@Configs/.local/lib/hyde/globalcontrol.sh`:
- Around line 376-383: Update the paste-command selection around the ydotool
branch to verify that a usable ydotoold backend is available before choosing
ydotool. If ydotoold is unavailable or unconfigured, continue to the existing
wtype fallback; preserve the current ydotool and no-backend behavior when its
backend is usable.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 669074ca-ebdc-40fe-9f13-610aef5ab556

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between c752754 and d1e0dfd.

πŸ“’ Files selected for processing (4)
  • CHANGELOG.md
  • Configs/.local/lib/hyde/globalcontrol.sh
  • Scripts/dots/deps.toml
  • Scripts/pkg_extra.lst

Comment thread CHANGELOG.md
- 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ“ Maintainability & Code Quality | 🟑 Minor | ⚑ Quick win

Move this entry under ## Unreleased.

The clipboard bullet is currently under ## v26.7.4, although this change is intended for the Unreleased section. Move it there, adding ### Changed if necessary.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` at line 69, Move the clipboard bullet about preferring ydotool
over wtype from the v26.7.4 section into ## Unreleased, creating or reusing its
### Changed subsection as needed. Keep the existing wording and release sections
otherwise unchanged.

Comment on lines +376 to +383
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | πŸ—οΈ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
rg -n --hidden --glob '!.git/**' \
  'ydotoold|YDOTOOL_SOCKET|systemctl.*ydotool' .

Repository: HyDE-Project/HyDE

Length of output: 155


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# Locate and inspect the referenced script around the paste backend selection and dispatch.
if [ -f "Configs/.local/lib/hyde/globalcontrol.sh" ]; then
  wc -l "Configs/.local/lib/hyde/globalcontrol.sh"
  sed -n '340,420p' "Configs/.local/lib/hyde/globalcontrol.sh" | cat -n
else
  fd -a 'globalcontrol\.sh$' .
  printf '\nReferenced file missing.\n'
fi

printf '\nRepository-wide ydotool-related references:\n'
rg -n --hidden --glob '!.git/**' 'ydotool|ydotoold|YDOTOOL|clipboard|paste' . || true

printf '\nRepository-wide daemon start/socket references:\n'
rg -n --hidden --glob '!.git/**' 'systemctl|xdotool|wtype|ydotool|ydotool.socket|clipboard|xdg|wayland|x11|rclone|sway|hyprland|i3|awesome|qtile|dunst' . | head -200 || true

Repository: HyDE-Project/HyDE

Length of output: 44013


Ensure ydotool has a usable ydotoold backend before selecting it.

command -v ydotool only checks for the executable, but ydotool depends on a running ydotoold backend. If that backend is unavailable, this branch beats wtype and auto-paste from the clipboard can silently fail. Select wtype unless ydotoold is reliably available, or document that ydotoold must be started/configured before HyDE uses this path.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Configs/.local/lib/hyde/globalcontrol.sh` around lines 376 - 383, Update the
paste-command selection around the ydotool branch to verify that a usable
ydotoold backend is available before choosing ydotool. If ydotoold is
unavailable or unconfigured, continue to the existing wtype fallback; preserve
the current ydotool and no-backend behavior when its backend is usable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants