Disabling (and re-enabling) Clipboard (Klipper) programmatically

Hi,

I’m trying to replicate what this GUI action does programmatically or via a script: Configure System Tray > Entries > Clipboard > Disable". (and “Always Shown”).

The clipboard (Klipper) remains interfering periodically/intermittently with applications like Gwenview, Libreoffice Calc so it’d be convenient that when I am working with those applications, I can quickly run a script to disable Klipper temporarily.

You can assign a shortcut

That is a shortcut to display Clipboard entries, not a shortcut to enable or disable Clipboard.