Yo ya gnomers, that's what ya get for using CORBA-crap.
There's nothing better for yar software than relying on tools NOT installed by default.
All people without admin privileges will thank you for it.
Had ya used a proper desktop-environment, such as KDE-plasma, you would not have that problem, because ya could just use dbus, from whatever software ya like, e.g. the console:
qdbus org.kde.klipper /klipper setClipboardContents "NiHao"
qdbus org.kde.klipper /klipper getClipboardContents
Personally, when I want to get or set clipboard contents, I actually connect to dbus directly with C#, which means I don't need qdbus.
That's probably of no use for ya, since ya don't have klipper, but I thought I'd mention it anyway, just to annoy ya with how it's done properly - but the again, who cares about gnome anyway.
PS: Don't copy that C# code, Task.Result might deadlock. If you use async, you have to use async all-the-way.
private static async System.Threading.Tasks.Task<string> GetClipboardContentsAsync()
{
string clipboardContents = null;
Tmds.DBus.ObjectPath objectPath = new Tmds.DBus.ObjectPath("/klipper");
string service = "org.kde.klipper";
using (Tmds.DBus.Connection connection = new Tmds.DBus.Connection(Tmds.DBus.Address.Session))
{
await connection.ConnectAsync();
IKlipper klipper = connection.CreateProxy<IKlipper>(service, objectPath);
clipboardContents = await klipper.getClipboardContentsAsync();
} // End Using connection
return clipboardContents;
}
private static string GetClipboardContents()
{
return GetClipboardContentsAsync().Result;
}
private static async System.Threading.Tasks.Task SetClipboardContentsAsync(string text)
{
Tmds.DBus.ObjectPath objectPath = new Tmds.DBus.ObjectPath("/klipper");
string service = "org.kde.klipper";
using (Tmds.DBus.Connection connection = new Tmds.DBus.Connection(Tmds.DBus.Address.Session))
{
await connection.ConnectAsync();
IKlipper klipper = connection.CreateProxy<IKlipper>(service, objectPath);
await klipper.setClipboardContentsAsync(text);
} // End using connection
}
private static void SetClipboardContents(string text)
{
SetClipboardContentsAsync(text).Wait();
}
vim[enter]"+P
:3 (run vim and then from"
register - i.e. system clipboard - paste text). Then you have (one of) the best text editor(s) at your finger tips, so you can:w filename
. Also, I always run vim in tmux which means that if I need to copy a little text over to the terminal, I just select (withv
orV
for line selection) and then"+y
(which yanks or copies to clipboard), then I make a new tmux pane and can <ctrl>+<shift>+v to paste. Additionally, I will occaisionally usexsel -b > filename
if I need to write clipboard to a file. Cheers ^u^