You are not logged in.

#1 2008-04-28 03:49:19

KSiimson
Member
Registered: 2007-06-16
Posts: 37

Problem: xclip - cannot paste text into Firefox

1. I put text from clipboard into a file called "temporary.tmp":

xclip -o -selection clipboard > temporary.tmp

2. I do certain manipulations on the file.
3. I want to get the file back to clipboard:

xclip -i -selection clipboard < temporary.tmp

Problem: Putting the clipboard's contents into temporary.tmp works, and all the manipulations are successful. However, the "Paste" button in Firefox is grayed out. What am I doing wrong?

Offline

#2 2008-04-28 12:06:40

Ambi
Member
From: Warsaw, Poland
Registered: 2007-11-29
Posts: 44

Re: Problem: xclip - cannot paste text into Firefox

I'm not certain about that, but it seems to me that there are two clipboards in Linux, one for console, and one for X-server. You may try

cat temporary.tmp

, then right-click on file's content, and Edit->Copy.

Offline

#3 2008-04-28 12:19:31

KSiimson
Member
Registered: 2007-06-16
Posts: 37

Re: Problem: xclip - cannot paste text into Firefox

Baah, any way to get it to the other clipboard? I will need to repeat this for thousands of times.

Offline

#4 2008-04-28 13:12:51

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: Problem: xclip - cannot paste text into Firefox

hmm,

I have a similar problem.

I thought this

cat temporary.tmp | xclip

could solve your problem, cause I had a working script that pipes the output of mpc to xclip. 

This is my script

#!/bin/bash
mpc --format "%artist% - %title%" | head -n 1 | xclip

But it does not work anymore.

Last time I used the script it was working.
So maybe some Updates "broke" xclip ?


EDIT:
rebuilding xclip package doesn't solve the problem...

Last edited by SiD (2008-04-28 13:35:32)

Offline

#5 2008-04-28 13:47:54

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: Problem: xclip - cannot paste text into Firefox

ok, I've forgotten that you have to klick the middle mouse button to paste the content.

so,

cat temporary.tmp | xclip

should work.

Last edited by SiD (2008-04-28 13:49:09)

Offline

#6 2008-04-28 19:47:35

KSiimson
Member
Registered: 2007-06-16
Posts: 37

Re: Problem: xclip - cannot paste text into Firefox

For Firefox forms neither "Paste" from the menu or middle click seem to work, while elsewhere it is possible to paste the text with middle click. I assume there is something wrong with my approach to the problem. I will define what I want to accomplish. Maybe someone has got a better idea. I am rather newbie-sh with Linux scripting at this point.

Goal
1. Select text # The text is in a web site form in Firefox
2. Press a keyboard shortcut
3. The text is replaced with something else

My solution, which obviously didn't quite work
1. Select text
2.1. Cut text
2.2. Press a keyboard shortcut to execute a script, which will put selection into a file &
2.3. Modify the file &
2.4. Put the modified file to clipboard < FAIL
3. Paste the text

Last edited by KSiimson (2008-04-28 19:52:01)

Offline

Board footer

Powered by FluxBB