Bug 469238

Summary: When run from a global shortcut, `normcap` does not copy text to clipboard, but `normcap | tee /dev/null` does
Product: [Plasma] kwin Reporter: sk.griffinix
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: kde, kde, kdebugs, magunasu.b97, nate, nicolas.fella, plasma-bugs
Priority: NOR    
Version: 5.27.4   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description sk.griffinix 2023-05-01 14:59:11 UTC
SUMMARY
***
Faced an issue while setting shortcut to normcap (https://github.com/dynobo/normcap/). When added as application or command `normcap`, and assigned shortcut, it triggers the program but the program fails to copy to clipboard. When command is edited so as to pipe it through anything, eg `normcap | tee /dev/null`, it triggers the same and also copies to clipboard. 
***


STEPS TO REPRODUCE
1. System Settings>Shortcuts>Add applications
2. Search and select normcap
3. Assign a shortcut (like ctrl+pritnscrn)

OBSERVED RESULT
When invoked through shortcut, normcap allows for region selection on screen and selects text but does not copy that text to clipboard.

EXPECTED RESULT
It should copy the text to clipboard. Piping the command should not be required

ADDITIONAL INFORMATION
Bug report for the same was created on https://github.com/dynobo/normcap/issues/422
Comment 1 Magnus Boman 2023-09-03 08:39:55 UTC
I ran into this as well but with wl-copy, I've been using the good ol' "custom shortcuts" but that has been intentionally removed from Wayland, adding my script as a command shortcut results in the problem explained in this report.

Broken:
<output> | wl-copy --trim-newline

Works:
<output> | wl-copy --trim-newline | tee /dev/null
Comment 2 David Edmundson 2024-06-04 09:05:13 UTC
Cannot reproduce. 
I do recall wl-copy having a bug at some point that affected us, maybe it was that.

It might have been: https://github.com/bugaevc/wl-clipboard/commit/d2c32f2b4d469f53070e8c4052dea6f412de3916


Please reopen if this is still an issue.