Clipboard in the console

I’m looking for a way to automate clipboard functionality on KDE Plasma.
I’ve used xsel and xclip in the past.
Neither of these seem to be available anywhere on Rock KDE Plasma - I’ve searched dnf repos and the package installer gui (not sure of the name of it on OpenMandriva).

In the past I’ve run a command like:
cat <text-from-file> | xclip
cat <text-from-file> | xclip -sel c
This is nice and copies the info to the clipboard so I can paste it other places via shift-insert or ctrl-v

I also found xclipboard via dnf but that is just a clipboard history thing.
Is there a way to use klipper on the console to get my functionality?

Oh, also when I run vi/vim/neovim I get a warning when I try to copy that states:
Clipboard: no provider

– Update –

I’ve just installed the OpenMandriva Rock (KDE Plasma) on my desktop running a AMD Ryzen 7 9700X, 32Gb RAM and it runs so great (smooth & fast). I was previously on Ubuntu 24.04.
I’m a developer and I run nvim 90% of the time for the code I’m writing and not being able to copy to the system clipboard is going to make things very difficult for me.

I’m not complaining I’m just trying to figure this out so I can use it for my daily driver.

I’ve had OpenMandriva on my laptop and run nvim there too, but just hadn’t noticed this issue – that I can’t copy text from neovim / vi to the system clipboard. I can’t copy text out of there and paste it anywhere else.
Thanks for any help.

Requirements:

I have Searched the forum for my issue and found nothing related or helpful
I have checked the Resources category (Resources Index)
I have reviewed the Wiki for relevant information
I have read the the Release Notes and Errata

OpenMandriva Lx version:

Desktop environment (KDE, LXQT…):

Description of the issue (screenshots if relevant):

Relevant informations (hardware involved, software version, logs or output…):

Welcome back.

Please make sure to fill this out.

You cannot get Ctrl + Shift + C and V to work with konsole?

Thanks for the idea.

I just opened up neovim and highlighted text two different ways:

  1. selected with mouse

  2. via nvim (Shift-V) then “j” to highlight successive lines

In both cases, I then tried Shift-Ctrl-C.

I then attempted to paste into another terminal window but in both cases the pasted text was not the text I highlighted and copied. Instead it was old text from the system clipboard.

I see no way to select and copy text from nvim or vi within OpenMandriva.

I can do this on my Ubuntu 24.04 installation & I have a laptop running Manjaro (arch-based) and copy / paste within vi / nvim works properly on that platform also.
Thanks for your help.

If I could just get xclip on my OpenMandriva then I could probably get this fixed but i’ve found no way to do that. If you know of a way, let me know.

OpenMandriva Lx version:

Operating System: OpenMandriva Lx 6.0
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0
Qt Version: 6.9.0
Kernel Version: 6.14.2-desktop-3omv2590 (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 9700X 8-Core Processor
Memory: 30.5 GiB of RAM
Graphics Processor 1: AMD Radeon Graphics
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B650 AORUS ELITE AX ICE
System Version: Default string-WCP

Wow! I found (built) my own solution.

I built & installed xclip from the github repo ( GitHub - astrand/xclip: Command line interface to the X11 clipboard ) and this has resolved the issue.

As I said, I’m a dev, but I wasn’t sure how to build xclip bec it’s not actually obvious from the repo.

I found a text file in the repo named INSTALL and that file has all the steps for building.

Dependencies

You’re going to need the GNU C build chain and then you’ll also have to install
the X11 dev libraries (libxmu-devel.x86_64) via:

sudo dnf install libxmu-devel.x86_64

After that, follow the steps in the INSTALL text file and you’ll be able to build, test and install xclip to your system.

As soon as I installed it to my system and then went back to neovim and tried the copy and paste and it worked! So happy. This means i can continue to use OpenMandriva as my daily driver. :+1:t4::+1:t4::+1:t4::+1:t4::+1:t4:

This solves the issue for me. But it is a bit of a pain that I have to build xclip myself.
thanks,

If you would like to save others from that headache you could package xclip for the OM repos.

Here is a guide for packaging RPMs

https://openmandriva.pkgs.org/6.0/openmandriva-unsupported-release-x86_64/xsel-1.2.1-1-omv2490.x86_64.rpm.html

https://openmandriva.pkgs.org/6.0/openmandriva-unsupported-release-x86_64/xclip-0.13-1-omv4002.x86_64.rpm.html

pkgs.org + terminal is one of the main ways I install things. I use ROME, but xsel and xclip appear to be available for ROCK

I’m attaching a TTS script I use, it gets any selected text into the clipboard (X11/wayland) different purpose, but part of it might be interesting

#!/bin/sh

# Determine the clipboard command based on the session type
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
  clip_cmd="wl-paste --primary --no-newline"
else
  clip_cmd="xclip -rmlastnl -o"
fi

# Retrieve clipboard content and replace newlines with ,,,
clipboard_content=$($clip_cmd | sed -z 's/\n/,,,/g')

# Escape special characters and pass to SpeechNote
echo "$clipboard_content" | sed 's/[^a-zA-Z0-9]/\\&/g' | xargs flatpak run net.mkiol.SpeechNote --action start-reading-text --text

1 Like

Oh, yea, xclip is in the ‘extra’ repo, so you just need to make sure that repo is enabled using the om-repo-picker

1 Like

In the ‘extra’ repo. That’s what I was looking for. Thanks very much.
That should make things much easier in the future.

Since I’m new to OpenMandriva I wasn’t sure how to add other repos to OM.

I just looked up om-repo-picker and found some docs on the main wiki site for how to do that.
I will try them out later. Thanks again.

1 Like