Xclip realtime clipboard backup?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
As is known to all of us, clipboard is managed by the program itself in most Linux distribution, which means that the content in clipboard will disappear when the hosting program halts.
However, clipboard managers like xclip seems to be exceptions. Even we got return value from these programs, we still can paste contents from the clipboard. So, I wonder if it possible to make xclip a daemon service which realtime backups content in clipboard. In this way, we can still available to paste contents from clipboard even if the original program halts for every process.
If so, I believe it will save a lot efforts, especially you don't need to re-open your closed libreoffice to re-copy in order to paste some sentences.
linux clipboard
add a comment |Â
up vote
1
down vote
favorite
As is known to all of us, clipboard is managed by the program itself in most Linux distribution, which means that the content in clipboard will disappear when the hosting program halts.
However, clipboard managers like xclip seems to be exceptions. Even we got return value from these programs, we still can paste contents from the clipboard. So, I wonder if it possible to make xclip a daemon service which realtime backups content in clipboard. In this way, we can still available to paste contents from clipboard even if the original program halts for every process.
If so, I believe it will save a lot efforts, especially you don't need to re-open your closed libreoffice to re-copy in order to paste some sentences.
linux clipboard
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
As is known to all of us, clipboard is managed by the program itself in most Linux distribution, which means that the content in clipboard will disappear when the hosting program halts.
However, clipboard managers like xclip seems to be exceptions. Even we got return value from these programs, we still can paste contents from the clipboard. So, I wonder if it possible to make xclip a daemon service which realtime backups content in clipboard. In this way, we can still available to paste contents from clipboard even if the original program halts for every process.
If so, I believe it will save a lot efforts, especially you don't need to re-open your closed libreoffice to re-copy in order to paste some sentences.
linux clipboard
As is known to all of us, clipboard is managed by the program itself in most Linux distribution, which means that the content in clipboard will disappear when the hosting program halts.
However, clipboard managers like xclip seems to be exceptions. Even we got return value from these programs, we still can paste contents from the clipboard. So, I wonder if it possible to make xclip a daemon service which realtime backups content in clipboard. In this way, we can still available to paste contents from clipboard even if the original program halts for every process.
If so, I believe it will save a lot efforts, especially you don't need to re-open your closed libreoffice to re-copy in order to paste some sentences.
linux clipboard
asked Nov 11 '17 at 23:31
TJM
18010
18010
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
If you are planning to write your own clipboard manager, you might look at this python example which uses the gtk library to do most of the work. You might want to change SELECTION_CLIPBOARD
to SELECTION_PRIMARY
. The class is documented here.
Selections can be rich text, or images, but if you only want to handle text it can be simpler.
This much shorter example just prints the selection every time it changes, and might be enough for you to keep a history of text selections.
parcellite claims to do what you want, keeping a history of selections, but I cannot test it as I don't use a suitable desktop environment.
If you use gnome, you can try gpaste, which should be available as a package. It is a clipboard manager, but seems to use dbus rather than the X11 selection mechanism, so it may not work with pure X11 clients, but only gnome applications.
autocutsel could also be a starting point if you program in C. It copies the PRIMARY selection to cutbuffer 0 whenever it changes, to provide compatibility with some other systems when using VNC.
add a comment |Â
up vote
0
down vote
Have a look at xclipboard
. Unfortunately, it only stores CLIPBOARD
selections, while most modern X applications only use PRIMARY
selections ...
But the source is available, you can change it as you like.
It's true that most modern X applications only usePRIMARY
. However, when you close the application, content that you manually copied byCtrl-c
will also lose. I want a clipboard manager who can solve this problem. Howeverxclip
can't. I'm now reading Freedesktop documents. And I hope in one day I can write axclipboard daemon
. But anyway, thanks.
â TJM
Nov 13 '17 at 4:02
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
If you are planning to write your own clipboard manager, you might look at this python example which uses the gtk library to do most of the work. You might want to change SELECTION_CLIPBOARD
to SELECTION_PRIMARY
. The class is documented here.
Selections can be rich text, or images, but if you only want to handle text it can be simpler.
This much shorter example just prints the selection every time it changes, and might be enough for you to keep a history of text selections.
parcellite claims to do what you want, keeping a history of selections, but I cannot test it as I don't use a suitable desktop environment.
If you use gnome, you can try gpaste, which should be available as a package. It is a clipboard manager, but seems to use dbus rather than the X11 selection mechanism, so it may not work with pure X11 clients, but only gnome applications.
autocutsel could also be a starting point if you program in C. It copies the PRIMARY selection to cutbuffer 0 whenever it changes, to provide compatibility with some other systems when using VNC.
add a comment |Â
up vote
2
down vote
If you are planning to write your own clipboard manager, you might look at this python example which uses the gtk library to do most of the work. You might want to change SELECTION_CLIPBOARD
to SELECTION_PRIMARY
. The class is documented here.
Selections can be rich text, or images, but if you only want to handle text it can be simpler.
This much shorter example just prints the selection every time it changes, and might be enough for you to keep a history of text selections.
parcellite claims to do what you want, keeping a history of selections, but I cannot test it as I don't use a suitable desktop environment.
If you use gnome, you can try gpaste, which should be available as a package. It is a clipboard manager, but seems to use dbus rather than the X11 selection mechanism, so it may not work with pure X11 clients, but only gnome applications.
autocutsel could also be a starting point if you program in C. It copies the PRIMARY selection to cutbuffer 0 whenever it changes, to provide compatibility with some other systems when using VNC.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
If you are planning to write your own clipboard manager, you might look at this python example which uses the gtk library to do most of the work. You might want to change SELECTION_CLIPBOARD
to SELECTION_PRIMARY
. The class is documented here.
Selections can be rich text, or images, but if you only want to handle text it can be simpler.
This much shorter example just prints the selection every time it changes, and might be enough for you to keep a history of text selections.
parcellite claims to do what you want, keeping a history of selections, but I cannot test it as I don't use a suitable desktop environment.
If you use gnome, you can try gpaste, which should be available as a package. It is a clipboard manager, but seems to use dbus rather than the X11 selection mechanism, so it may not work with pure X11 clients, but only gnome applications.
autocutsel could also be a starting point if you program in C. It copies the PRIMARY selection to cutbuffer 0 whenever it changes, to provide compatibility with some other systems when using VNC.
If you are planning to write your own clipboard manager, you might look at this python example which uses the gtk library to do most of the work. You might want to change SELECTION_CLIPBOARD
to SELECTION_PRIMARY
. The class is documented here.
Selections can be rich text, or images, but if you only want to handle text it can be simpler.
This much shorter example just prints the selection every time it changes, and might be enough for you to keep a history of text selections.
parcellite claims to do what you want, keeping a history of selections, but I cannot test it as I don't use a suitable desktop environment.
If you use gnome, you can try gpaste, which should be available as a package. It is a clipboard manager, but seems to use dbus rather than the X11 selection mechanism, so it may not work with pure X11 clients, but only gnome applications.
autocutsel could also be a starting point if you program in C. It copies the PRIMARY selection to cutbuffer 0 whenever it changes, to provide compatibility with some other systems when using VNC.
edited Dec 18 '17 at 0:53
Jeff Schaller
32k849109
32k849109
answered Nov 13 '17 at 9:43
meuh
29.6k11751
29.6k11751
add a comment |Â
add a comment |Â
up vote
0
down vote
Have a look at xclipboard
. Unfortunately, it only stores CLIPBOARD
selections, while most modern X applications only use PRIMARY
selections ...
But the source is available, you can change it as you like.
It's true that most modern X applications only usePRIMARY
. However, when you close the application, content that you manually copied byCtrl-c
will also lose. I want a clipboard manager who can solve this problem. Howeverxclip
can't. I'm now reading Freedesktop documents. And I hope in one day I can write axclipboard daemon
. But anyway, thanks.
â TJM
Nov 13 '17 at 4:02
add a comment |Â
up vote
0
down vote
Have a look at xclipboard
. Unfortunately, it only stores CLIPBOARD
selections, while most modern X applications only use PRIMARY
selections ...
But the source is available, you can change it as you like.
It's true that most modern X applications only usePRIMARY
. However, when you close the application, content that you manually copied byCtrl-c
will also lose. I want a clipboard manager who can solve this problem. Howeverxclip
can't. I'm now reading Freedesktop documents. And I hope in one day I can write axclipboard daemon
. But anyway, thanks.
â TJM
Nov 13 '17 at 4:02
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Have a look at xclipboard
. Unfortunately, it only stores CLIPBOARD
selections, while most modern X applications only use PRIMARY
selections ...
But the source is available, you can change it as you like.
Have a look at xclipboard
. Unfortunately, it only stores CLIPBOARD
selections, while most modern X applications only use PRIMARY
selections ...
But the source is available, you can change it as you like.
answered Nov 12 '17 at 7:59
dirkt
14.2k2931
14.2k2931
It's true that most modern X applications only usePRIMARY
. However, when you close the application, content that you manually copied byCtrl-c
will also lose. I want a clipboard manager who can solve this problem. Howeverxclip
can't. I'm now reading Freedesktop documents. And I hope in one day I can write axclipboard daemon
. But anyway, thanks.
â TJM
Nov 13 '17 at 4:02
add a comment |Â
It's true that most modern X applications only usePRIMARY
. However, when you close the application, content that you manually copied byCtrl-c
will also lose. I want a clipboard manager who can solve this problem. Howeverxclip
can't. I'm now reading Freedesktop documents. And I hope in one day I can write axclipboard daemon
. But anyway, thanks.
â TJM
Nov 13 '17 at 4:02
It's true that most modern X applications only use
PRIMARY
. However, when you close the application, content that you manually copied by Ctrl-c
will also lose. I want a clipboard manager who can solve this problem. However xclip
can't. I'm now reading Freedesktop documents. And I hope in one day I can write a xclipboard daemon
. But anyway, thanks.â TJM
Nov 13 '17 at 4:02
It's true that most modern X applications only use
PRIMARY
. However, when you close the application, content that you manually copied by Ctrl-c
will also lose. I want a clipboard manager who can solve this problem. However xclip
can't. I'm now reading Freedesktop documents. And I hope in one day I can write a xclipboard daemon
. But anyway, thanks.â TJM
Nov 13 '17 at 4:02
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403966%2fxclip-realtime-clipboard-backup%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password