On 2018-11-22, [email protected] wrote:
> On 11/22/2018 10:02 AM, Andrew Savchenko wrote:
>> On Thu, 22 Nov 2018 09:35:42 -0700 [email protected] wrote:
>>> I have a simple text file (with few lines in it) and using XFCE.
>>>
>>> How do I copy text from that file to "clipboard" so that user can past
>>> it with "ctrl-v"
>>> I would like to that text to be in a clipboard after XFCE started.
>>
>> Use x11-misc/xclip:
>> xclip -in filename_with_paste
>>
>> Add this script to you XFCE autostart. This can be done either by:
>>
>> 1) GUI: Settings -> Session and Startup -> Application Autostart
>> https://docs.xfce.org/xfce/xfce4-session/preferences#application_autostart
>>
>> 2) Custom run hook:
>> Edit ~/.config/xfce4/xinitrc properly (call xclip, then
>> default xfce4 xinitrc)
>> https://unix.stackexchange.com/a/267238
>>
>> Best regards,
>> Andrew Savchenko
>
> Hmm... I tried it from the command line and restarting the XFCE; nothing
> in the clipboard, empty. Nothing to paste.
>
> xclip -in test.txt
xclip defaults to the X11 primary selection. To use the "clipboard"
selection, try
xclip -selection clipboard -in test.txt
To make sure this command works, you can run it in a terminal emulator
and then check if ctrl+V pastes what you want in another program. But
for the automation part, you must put the command somewhere else (such
as the autostart feature Andrew mentioned).
--
Nuno Silva