Do we have `xclip` on Wayland?

I’m using xsel and xclip quite heavily on EOS/Cinnamon (and Mint).

Do we have these (or functional identical replacements) under Wayland?

Reason being: I hate BBCode but have to write lots of stuff on forums like the E-Reader Forum and MobileRead, which both use BBCode.

And of course I write in Markdown, hit Ctrl+C, Super+B and Ctrl+V, which will pick up the clipboard, use Pandoc to convert Markdown to BBCode, and paste the changed clipboard again. Et voilà—BBCode generated.

Or I mark something on screen, hit Super+E (English) or Super+G (German) to have it read out loud.

So, before even thinking of moving to Wayland—is that possible?


Example:

Markdown input

|Anwendung, Gerät|Dateiname|Speicherort|System überschreibt bei Updates[^1]|
|:---------------|:--------|:----------|:---:
|Linux|`hyph_de_DE.dic`|`/usr/share/hyphen/hyph_de_DE.dic`[^2]|Ja|
|Calibre *Hyphenate This!* Plugin|`hyph_de_DE.dic`|???|???|
|Tolino|`hyph_de.dic`, `de.js`|`.tolino/hyphenDicts/hyph_de.dic`, `.tolino/hyphenator/patterns/de.js`|Ja, schreibschützen[^3]|
|Pocketbook|`hyph_de.dic`|`system/adobe/hyphenDicts/hyph_de.dic`|Ja|
|Kobo|`hyph_de.dic`|`/usr/local/Kobo/hyphenDicts/hyph_de.dic`|Ja|
|KOReader|`German.pattern`|`…/koreader/data/hyph/German.pattern`|Ja|

[^1]: Nach einem System-Update muss die neue Silbentrennung erneut aufgespielt werden.

[^2]: Alernative Speicherorte wie etwa `~/.local/share/hyphen/hyph_de_DE.dic` oder `/usr/local/share/hyphen/hyph_de_DE.dic` funktionieren i.d.R. _nicht_, da das `hyphen`-Paket bisher nicht den _XDG-Standard_ unterstützt.

[^3]: Tolino-Firmwareupdates überschreiben schreibgeschützte Dateien nicht und geben auch keine sichtbare Fehlermeldung dazu aus.

BBCode crazy junk

[TABLE="width:500"]
[TR]
[TD][LEFT][B]Anwendung, Gerät[/B][/LEFT][/TD]
[TD][LEFT][B]Dateiname[/B][/LEFT][/TD]
[TD][LEFT][B]Speicherort[/B][/LEFT][/TD]
[TD][CENTER][B]System überschreibt bei Updates[1][/B][/CENTER][/TD]
[/TR]
[TR]
[TD][LEFT]Linux[/LEFT][/TD]
[TD][LEFT][ICODE]hyph_de_DE.dic[/ICODE][/LEFT][/TD]
[TD][LEFT][ICODE]/usr/share/hyphen/hyph_de_DE.dic[/ICODE][2][/LEFT][/TD]
[TD][CENTER]Ja[/CENTER][/TD]
[/TR]
[TR]
[TD][LEFT]Calibre [I]Hyphenate This![/I] Plugin[/LEFT][/TD]
[TD][LEFT][ICODE]hyph_de_DE.dic[/ICODE][/LEFT][/TD]
[TD][LEFT]???[/LEFT][/TD]
[TD][CENTER]???[/CENTER][/TD]
[/TR]
[TR]
[TD][LEFT]Tolino[/LEFT][/TD]
[TD][LEFT][ICODE]hyph_de.dic[/ICODE], [ICODE]de.js[/ICODE][/LEFT][/TD]
[TD][LEFT][ICODE].tolino/hyphenDicts/hyph_de.dic[/ICODE], [ICODE].tolino/hyphenator/patterns/de.js[/ICODE][/LEFT][/TD]
[TD][CENTER]Ja, schreibschützen[3][/CENTER][/TD]
[/TR]
[TR]
[TD][LEFT]Pocketbook[/LEFT][/TD]
[TD][LEFT][ICODE]hyph_de.dic[/ICODE][/LEFT][/TD]
[TD][LEFT][ICODE]system/adobe/hyphenDicts/hyph_de.dic[/ICODE][/LEFT][/TD]
[TD][CENTER]Ja[/CENTER][/TD]
[/TR]
[TR]
[TD][LEFT]Kobo[/LEFT][/TD]
[TD][LEFT][ICODE]hyph_de.dic[/ICODE][/LEFT][/TD]
[TD][LEFT][ICODE]/usr/local/Kobo/hyphenDicts/hyph_de.dic[/ICODE][/LEFT][/TD]
[TD][CENTER]Ja[/CENTER][/TD]
[/TR]
[TR]
[TD][LEFT]KOReader[/LEFT][/TD]
[TD][LEFT][ICODE]German.pattern[/ICODE][/LEFT][/TD]
[TD][LEFT][ICODE]…/koreader/data/hyph/German.pattern[/ICODE][/LEFT][/TD]
[TD][CENTER]Ja[/CENTER][/TD]
[/TR]
[/TABLE]
[HR][/HR]
[SIZE=3][1] Nach einem System-Update muss die neue Silbentrennung erneut aufgespielt werden.[/SIZE]
[SIZE=3][2] Alernative Speicherorte wie etwa [ICODE]~/.local/share/hyphen/hyph_de_DE.dic[/ICODE] oder [ICODE]/usr/local/share/hyphen/hyph_de_DE.dic[/ICODE] funktionieren i.d.R. [I]nicht[/I], da das [ICODE]hyphen[/ICODE]-Paket bisher nicht den [I]XDG-Standard[/I] unterstützt.[/SIZE]
[SIZE=3][3] Tolino-Firmwareupdates überschreiben schreibgeschützte Dateien nicht und geben auch keine sichtbare Fehlermeldung dazu aus.[/SIZE]

You could try wl-copy and see if that does the job.

Thanks! That looks like if it might work.

Or maybe wl-clipboard?
I haven’t used it but it is in the repos.

wl-clipboard is the package that provides wl-copy.
If one is using KDE Plasma then they would already have klipper as well.

As long as I can easily read, modify and rewrite the clipboard, all is good…

Like I do now (example):

xclip -selection clipboard -o | pandoc -f commonmark_x -t bbcode.lua - | xclip -selection clipboard

I would need to know xclip better in order to know/provide an alternative.

But for klipper .. well .. I’ll just copy the section from waybinder;

            _waybinder_clip_paste() {
                qdbus6 org.kde.klipper /klipper getClipboardContents
            }
            _waybinder_abbrvs_paste() {
                qdbus6 org.kde.klipper /klipper org.kde.klipper.klipper.setClipboardContents "$(_waybinder_abbrvs_expreg)"
            }
            _waybinder_abbrvs_paste_p() {
                # There is no primary for klipper?
                :
            }
            _waybinder_abbrvs_sh_paste() {
                qdbus6 org.kde.klipper /klipper org.kde.klipper.klipper.setClipboardContents "$(_waybinder_abbrvs_expsh)"
            }
            _waybinder_abbrvs_sh_paste_p() {
                # There is no primary for klipper?
                :
            }
            _waybinder_clip_copy_orig() {
                qdbus6 org.kde.klipper /klipper org.kde.klipper.klipper.setClipboardContents "$(printf %s\\n "$_waybinder_clipboard")"
            }

It does not have easy executable names .. its all dbus.

Might as well include the same stuff for wl-clipboard;

            _waybinder_clip_paste() {
                wl-paste -n
            }
            _waybinder_abbrvs_paste() {
                _waybinder_abbrvs_expreg | wl-copy
            }
            _waybinder_abbrvs_paste_p() {
                _waybinder_abbrvs_expreg | wl-copy -p
            }
            _waybinder_abbrvs_sh_paste() {
                _waybinder_abbrvs_expsh | wl-copy
            }
            _waybinder_abbrvs_sh_paste_p() {
                _waybinder_abbrvs_expsh | wl-copy -p
            }
            _waybinder_clip_copy_orig() {
                printf %s\\n "$_waybinder_clipboard" | wl-copy
            }

Guess I should be looking for another $20 laptop and give that a KDE/Wayland install, to check all that out… :wink:

Wayland session is just a login away.

As to trying those things out.. well klipper is included and wl-clipboard is one package.

Then you could assign key combos or similar ..

For ‘paste’:

qdbus6 org.kde.klipper /klipper getClipboardContents

For ‘copy’:

qdbus6 org.kde.klipper /klipper org.kde.klipper.klipper.setClipboardContents

Sure, but I’d have to install KDE first (running Cinnamon). Guess I’ll get another el-cheapo playing machine and then give KDE/Wayland a try. May take a few months, though.

Ah right-o .. dont know why I had it in my head you were also on Plasma.

In that case the wl-clipboard is a reasonable choice .. its slightly easier to use as well.

Well, let’s see. Thanks for all the info.
Maybe because I somewhere said I’d have to try Plasma one day… :wink:

Mainly want to be thoroughly informed before the act.
I’m still really happy with EOS & Cinnamon!