dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Compare Notes Search feat(quickshell): add clipboard picker ipc surface
21b0bb25aaa35ffd25d092989c12a599a72febf4
Oliver Jan Krylow <oliver@bugabinga.net > · 17 Jun 2026
unsigned
Browse files Compare with HEAD
Changed files (5) docs/super/inventory/2026-06-17-quickshell-phase-4c-clipboard-picker-verification.md Added new file mode 100644 1 + #
Quickshell Phase 4C Clipboard Picker Verification — 2026-06-17 5 + Added a full Quickshell clipboard picker IPC surface. This replaces the `hyprlauncher --dmenu` frontend path later, while keeping `cliphist` as the clipboard storage backend.
9 + - `quickshell/nugu/ClipboardPicker.qml`
10 + - `quickshell/nugu/shell.qml` IPC wiring
11 + - `quickshell/nugu/ClipboardWidget.qml` copy input fix
12 + - `quickshell/nugu/README.md` usage notes
16 + Current Hypr bind uses:
19 + cliphist list
| hyprlauncher --dmenu
| cliphist decode
| wl-copy
22 + The new picker keeps `cliphist list`, `cliphist decode`, and `wl-copy`. Only the picker frontend changes.
24 + Validation showed `cliphist decode` needs the full selected `cliphist list` line. Passing only the numeric id does not decode correctly:
27 + found=1 id_decode=0 line_decode=1
30 + So both the bar clipboard popup and the full picker now pass the full selected line to `Commands.copyClipboardEntry()`.
34 + A synthetic non-secret clipboard entry was inserted for the test. The previous clipboard text was saved to a temporary file and restored afterward without printing it.
36 + Temporary `XDG_CONFIG_HOME` named config was used; no live home symlink mutation.
39 + qs ipc -c nugu call nugu openClipboardPicker
< synthetic-query
> 40 + qs ipc -c nugu call nugu clipboardPickerVisible
41 + qs ipc -c nugu call nugu clipboardPickerMatchCount
42 + qs ipc -c nugu call nugu chooseClipboardIndex 0
43 + qs ipc -c nugu call nugu clipboardPickerVisible
46 + Observed returns, redacted:
49 + open=[synthetic-clipboard-entry]
52 + choose=[synthetic-clipboard-entry]
57 + `chosen_ok=1` means `wl-paste --no-newline` matched the synthetic entry after selecting index 0.
62 + INFO: Configuration Loaded
65 + No QML errors, binding loops, reference errors, annotation warnings, or lingering `qs` process were observed after the fix.
69 + - `/tmp/nugu-qs-clipboard-picker.png`
71 + Vision check confirmed:
73 + - Nugu clipboard picker popup is visible.
74 + - Search field is visible.
75 + - One matching synthetic row is shown and highlighted.
76 + - Border/background style matches the other Nugu popups.
79 + ##
Still open before replacing the live clipboard bind 81 + - Real keyboard navigation: type, up/down, escape, enter.
82 + - Live Hypr bind migration once Quickshell service is active/recoverable.
83 + - Empty-history behavior with a temporary isolated `cliphist` database if supported.
quickshell/nugu/ClipboardPicker.qml Added new file mode 100644 4 + import Quickshell.Wayland
9 + required property QtObject theme
10 + required property QtObject commands
11 + property bool
open :
false 12 + property string
query :
"" 13 + property
var entries: []
19 + anchors {
top :
true ;
left :
true ;
right :
true }
23 + color :
"transparent" 26 + layer :
WlrLayer .Overlay
27 + namespace :
"nugu-clipboard-picker" 28 + keyboardFocus : root.open
? WlrKeyboardFocus .Exclusive
: WlrKeyboardFocus .None
31 + ScriptModel {
id : matches }
33 + onQueryChanged : rebuild()
37 + Qt .callLater(search.forceActiveFocus)
41 + function show (initialQuery: string): string {
42 + query
= initialQuery
47 + function close ():
void {
52 + function matchCount (): int {
return matches.values.length }
53 + function firstMatchPreview (): string {
return matches.values.length
> 0 ? matches.values[
0 ].preview
: "" }
55 + function refresh ():
void {
56 + list.exec([
"sh" ,
"-c" ,
"cliphist list | head -n 80" ])
59 + function rebuild ():
void {
60 + const needle
= query.toLowerCase().trim()
61 + matches.values
= entries
62 + .filter(entry
=> needle.length
=== 0 || entry.search.indexOf(needle)
!== - 1 )
64 + results.currentIndex
= matches.values.length
> 0 ? 0 : - 1 67 + function chooseIndex (index: int): string {
68 + if (index
< 0 || index
>= matches.values.length)
return "" 69 + const entry
= matches.values[index]
70 + commands.copyClipboardEntry(entry.encoded, entry.preview)
72 + return entry.preview
75 + function parseLine (line: string):
var {
76 + const tab
= line.indexOf(
"\t" )
77 + const encoded
= line
78 + const raw
= tab
>= 0 ? line.slice(tab
+ 1 )
: line
79 + const compact
= raw.replace(
/\s + / g ,
" " ).trim()
80 + const preview
= compact.length
> 80 ? ` ${compact.slice(
0 ,
77 )}
…` : compact
81 + return {
"encoded" : encoded,
"preview" : preview,
"search" : compact.toLowerCase() }
85 + anchors.fill: parent
86 + onClicked : root.close()
90 + anchors.top: parent.top
91 + anchors.horizontalCenter: parent.horizontalCenter
92 + width :
Math .
min (parent.width
- 32 ,
720 )
93 + height : parent.height
95 + color :
` ${theme.ui.backdrop}
f2` 97 + border.color: theme.ui.accent
100 + anchors.fill: parent
101 + anchors.margins:
14 106 + width : parent.width
109 + onTextChanged : root.query
= text
110 + color : theme.ui.important_global
111 + selectionColor : theme.ui.focus
112 + selectedTextColor : theme.content.backdrop
113 + font.family:
"IBM Plex Mono" 119 + anchors.fill: parent
120 + anchors.margins:
- 6 123 + color : theme.content.backdrop
125 + border.color: theme.ui.unfocus
128 + Keys .onPressed: event
=> {
129 + if (event.key
=== Qt .Key_Escape) {
131 + event.accepted
= true 132 + }
else if (event.key
=== Qt .Key_Down) {
133 + results.currentIndex
= Math .
min (results.currentIndex
+ 1 , matches.values.length
- 1 )
134 + event.accepted
= true 135 + }
else if (event.key
=== Qt .Key_Up) {
136 + results.currentIndex
= Math .
max (results.currentIndex
- 1 ,
0 )
137 + event.accepted
= true 138 + }
else if (event.key
=== Qt .Key_Return
|| event.key
=== Qt .Key_Enter) {
139 + root.chooseIndex(results.currentIndex)
140 + event.accepted
= true 147 + width : parent.width
148 + height : parent.height
- search.height
- parent.spacing
153 + delegate : Rectangle {
155 + required property
var modelData
156 + required property int index
158 + width : results.width
161 + color : results.currentIndex
=== index
? theme.ui.focus
: (rowMouse.containsMouse
? theme.ui.accent
: "transparent" )
166 + anchors.fill: parent
168 + onClicked : root.chooseIndex(row.index)
172 + anchors.left: parent.left
173 + anchors.right: parent.right
174 + anchors.verticalCenter: parent.verticalCenter
175 + anchors.leftMargin:
10 176 + anchors.rightMargin:
10 177 + text : row.modelData.preview
178 + color : (results.currentIndex
=== row.index
|| rowMouse.containsMouse)
? theme.content.backdrop
: theme.ui.normal
179 + font.family:
"IBM Plex Mono" 181 + elide :
Text .ElideRight
187 + visible : matches.values.length
=== 0 188 + text : root.entries.length
=== 0 ? "clipboard empty" : "no clipboard match" 189 + color : theme.ui.minor
190 + font.family:
"IBM Plex Mono" 198 + stdout : StdioCollector {
199 + onStreamFinished : {
200 + const text
= this.text.trim()
201 + root.entries
= text.length
=== 0 ? []
: text.split(
"\n" ).map(line
=> root.parseLine(line))
quickshell/nugu/ClipboardWidget.qml Modified 116 116 onStreamFinished : {
117 117 root.entries
= this.text.trim().length
=== 0 ? []
: this.text.trim().split(
"\n" ).map(line
=> {
118 118 const tab
= line.indexOf(
"\t" )
119 - const encoded
= tab
>= 0 ? line.slice(
0 , tab)
: line
119 + const encoded
= line
120 120 const raw
= tab
>= 0 ? line.slice(tab
+ 1 )
: line
121 121 const compact
= raw.replace(
/\s + / g ,
" " )
122 122 const preview
= compact.length
> 30 ? ` ${compact.slice(
0 ,
27 )}
…` : compact
quickshell/nugu/README.md Modified 116 116 qs ipc -c nugu call nugu launcherFirstMatchName
117 117 qs ipc -c nugu call nugu closeLauncher
120 + ## Phase 4C clipboard picker IPC
122 + Phase 4C replaces only the picker frontend from the old pipeline:
125 + cliphist list | hyprlauncher --dmenu | cliphist decode | wl-copy
128 + `cliphist` remains the storage backend. The picker passes the full selected
129 + `cliphist list` line to `cliphist decode`; passing only the numeric id does not
133 + qs ipc -c nugu call nugu openClipboardPicker query
134 + qs ipc -c nugu call nugu clipboardPickerVisible
135 + qs ipc -c nugu call nugu clipboardPickerMatchCount
136 + qs ipc -c nugu call nugu chooseClipboardIndex 0
137 + qs ipc -c nugu call nugu closeClipboardPicker
quickshell/nugu/shell.qml Modified 75 75 function launcherVisible (): bool {
return launcher.open }
76 76 function launcherMatchCount (): int {
return launcher.matchCount() }
77 77 function launcherFirstMatchName (): string {
return launcher.firstMatchName() }
81 + function openClipboardPicker (query: string): string {
return clipboardPicker.show(query) }
82 + function closeClipboardPicker ():
void { clipboardPicker.close() }
83 + function clipboardPickerVisible (): bool {
return clipboardPicker.open }
84 + function clipboardPickerMatchCount (): int {
return clipboardPicker.matchCount() }
85 + function clipboardPickerFirstPreview (): string {
return clipboardPicker.firstMatchPreview() }
86 + function chooseClipboardIndex (index: int): string {
return clipboardPicker.chooseIndex(index) }
108 + id : clipboardPicker
110 + commands : commandBus
100 115 model :
Quickshell .screens