Gentoo Archives: gentoo-user

From: nunojsilva@×××××××.pt
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: copy text file to clipboard on startup
Date: Thu, 22 Nov 2018 18:51:03
Message-Id: pt6tm2$loj$1@blaine.gmane.org
In Reply to: Re: [gentoo-user] copy text file to clipboard on startup by thelma@sys-concept.com
1 On 2018-11-22, thelma@×××××××××××.com wrote:
2
3 > On 11/22/2018 10:02 AM, Andrew Savchenko wrote:
4 >> On Thu, 22 Nov 2018 09:35:42 -0700 thelma@×××××××××××.com wrote:
5 >>> I have a simple text file (with few lines in it) and using XFCE.
6 >>>
7 >>> How do I copy text from that file to "clipboard" so that user can past
8 >>> it with "ctrl-v"
9 >>> I would like to that text to be in a clipboard after XFCE started.
10 >>
11 >> Use x11-misc/xclip:
12 >> xclip -in filename_with_paste
13 >>
14 >> Add this script to you XFCE autostart. This can be done either by:
15 >>
16 >> 1) GUI: Settings -> Session and Startup -> Application Autostart
17 >> https://docs.xfce.org/xfce/xfce4-session/preferences#application_autostart
18 >>
19 >> 2) Custom run hook:
20 >> Edit ~/.config/xfce4/xinitrc properly (call xclip, then
21 >> default xfce4 xinitrc)
22 >> https://unix.stackexchange.com/a/267238
23 >>
24 >> Best regards,
25 >> Andrew Savchenko
26 >
27 > Hmm... I tried it from the command line and restarting the XFCE; nothing
28 > in the clipboard, empty. Nothing to paste.
29 >
30 > xclip -in test.txt
31
32 xclip defaults to the X11 primary selection. To use the "clipboard"
33 selection, try
34
35 xclip -selection clipboard -in test.txt
36
37 To make sure this command works, you can run it in a terminal emulator
38 and then check if ctrl+V pastes what you want in another program. But
39 for the automation part, you must put the command somewhere else (such
40 as the autostart feature Andrew mentioned).
41
42 --
43 Nuno Silva