Skip to content

fix(script): When no item is selected from the clipboard history, the…#1738

Open
martinpiz097 wants to merge 1 commit into
mylinuxforwork:mainfrom
martinpiz097:feature/cliphist-fix
Open

fix(script): When no item is selected from the clipboard history, the…#1738
martinpiz097 wants to merge 1 commit into
mylinuxforwork:mainfrom
martinpiz097:feature/cliphist-fix

Conversation

@martinpiz097

Copy link
Copy Markdown
Contributor

Description

This pull request fixes the clipboard history script behavior when no item is selected from the menu.

Changes

  • Bug Fixes

Context

When the clipboard history menu was invoked and the user closed it without selecting any item, the currently loaded clipboard content was overwritten with an empty value. This caused the previously copied text to be lost, forcing the user to reopen the history and select it again. Now, if no item is selected from the menu, the script exits cleanly without modifying the clipboard.

How Has This Been Tested?

  • Tested on Arch Linux/Based Distro.

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • My changes do not introduce new warnings.

Additional Notes

The fix was applied by capturing the rofi selection into a variable and checking whether it is empty before piping it to cliphist decode | wl-copy or cliphist delete. If the selection is empty, the script exits with code 0.

… currently loaded item is no longer deleted.
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.

1 participant