You are not logged in.

#1 2011-04-10 20:34:10

NoobCp
Member
From: IRC @-offtopic
Registered: 2010-09-28
Posts: 14
Website

[SOLVED] Primary selection not being copied to clipboard

So what's up with that?

I can paste the primary selection via shift+insert fine in xterm or urxvt, but not in Firefox. In Firefox shift+insert instead pastes the current clipboard.

I hear this should work without a clipboard manager, but it isn't.

How do I fix this?

Edit: if relevant: using Fluxbox as WM.

Edit2: Solved.

Last edited by NoobCp (2011-04-14 12:51:33)

Offline

#2 2011-04-10 21:31:51

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: [SOLVED] Primary selection not being copied to clipboard

community/autocutsel 0.9.0-3 [installed]
    synchronizes the two copy/paste buffers mainly used by X
    applications

Offline

#3 2011-04-10 21:56:37

NoobCp
Member
From: IRC @-offtopic
Registered: 2010-09-28
Posts: 14
Website

Re: [SOLVED] Primary selection not being copied to clipboard

I presume it has to be added to ~/.xinitrc but how?

Edit: judging from https://wiki.archlinux.org/index.php/Xinitrc and https://wiki.archlinux.org/index.php/Dwm just adding "autocutsel &" will do

Edit2:

...nope, it does nothing

Last edited by NoobCp (2011-04-10 22:34:58)

Offline

#4 2011-04-11 00:18:32

hellomynameisphil
Member
From: /home/phil/Vancouver
Registered: 2009-10-02
Posts: 257
Website

Re: [SOLVED] Primary selection not being copied to clipboard

I have these two lines in my .xinitrc:

autocutsel -fork &
autocutsel -selection PRIMARY -fork &

Try that and see if it tickles your fancy.

Offline

#5 2011-04-11 01:33:24

NoobCp
Member
From: IRC @-offtopic
Registered: 2010-09-28
Posts: 14
Website

Re: [SOLVED] Primary selection not being copied to clipboard

Thanks hellomynameisphil.

Actually it seems that dual button middleclick emulation is working now for pasting stuff highlighted in terminals.

Edit: actually no it doesn't, since MMB emulation works in some input fields and not others.

So I'm either in need of a way to emulate MMB better, or (as said before) a way to (conditionally?) transfer primary selection to clipboard.

PS: autocutsel is a horribly undocumented program!

Last edited by NoobCp (2011-04-11 01:51:58)

Offline

#6 2011-04-11 03:46:00

hellomynameisphil
Member
From: /home/phil/Vancouver
Registered: 2009-10-02
Posts: 257
Website

Re: [SOLVED] Primary selection not being copied to clipboard

With those two lines in my .xinitrc, I can copy back and forth between xterm et al. and programs like Firefox absolutely flawlessly. Well, sometimes it seems like I have to select or copy things more than once before I can paste them.

For me, pasting works in either direction with either shift-insert or an emulated middle-click. Selecting text in xterm and pasting it into Firefox can also be done with Firefox's paste functionality.

It sounds like some things are working for you and not others. Can you give us an example of what is not working and the exact steps you are taking for the action that fails?

Offline

#7 2011-04-11 04:50:36

NoobCp
Member
From: IRC @-offtopic
Registered: 2010-09-28
Posts: 14
Website

Re: [SOLVED] Primary selection not being copied to clipboard

Hm, it seems the MMB emulation has such a short time for registering that it behaved inconsistently before my coordination improved... It seems emulated MMB works in every app I have afterall, but that's irrelevant:

In Firefox, SciTE, Skype, Thunderbird shift+insert always pastes clipboard (and not primapy selection), ctrl+v pastes the clipboard.
In urxvt, xterm both shift+insert and MMB behave the same: pasting primary selection and not clipboard.
Select+deleted text remains as primary selection.

EDIT: It might be relevant that I can't find an autocutsel process in htop. Yet I have the relevant lines in .xinitrc that should start it? The process does appear and disappear from htop when launching and stopping it manually. For completeness here's my entire .xinitrc:

$ cat ~/.xinitrc 
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

autocutsel -fork &
autocutsel -selection PRIMARY -fork &

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

exec startfluxbox
# exec gnome-session
# exec startkde
# exec startxfce4
# ...or the Window Manager of your choice

Last edited by NoobCp (2011-04-11 05:29:06)

Offline

#8 2011-04-11 21:50:25

hellomynameisphil
Member
From: /home/phil/Vancouver
Registered: 2009-10-02
Posts: 257
Website

Re: [SOLVED] Primary selection not being copied to clipboard

NoobCp wrote:

EDIT: It might be relevant that I can't find an autocutsel process in htop. Yet I have the relevant lines in .xinitrc that should start it? The process does appear and disappear from htop when launching and stopping it manually. For completeness here's my entire .xinitrc:

It is understandable that autocutsel might not consistently show up in htop, as it consumes almost no resources. To be safe, though, what do you get from 'ps aux | grep autocutsel' ?

Offline

#9 2011-04-12 16:28:22

NoobCp
Member
From: IRC @-offtopic
Registered: 2010-09-28
Posts: 14
Website

Re: [SOLVED] Primary selection not being copied to clipboard

[kas@tinfoilhat ~]$ ps aux | grep autocutsel
kas      21437  0.0  0.0   8548   976 pts/0    S+   19:26   0:00 grep autocutsel

Offline

#10 2011-04-12 22:28:11

hellomynameisphil
Member
From: /home/phil/Vancouver
Registered: 2009-10-02
Posts: 257
Website

Re: [SOLVED] Primary selection not being copied to clipboard

Well, that would 'splain it. autocutsel is not running. Do you get any error messages when you are trying to run it from the terminal?

I assume that you have either restarted X with those two lines in your .xinitrc or tried to start autocutsel manually with the same commands.

Offline

#11 2011-04-14 12:49:56

NoobCp
Member
From: IRC @-offtopic
Registered: 2010-09-28
Posts: 14
Website

Re: [SOLVED] Primary selection not being copied to clipboard

Ahh, I think I found the problem! CDM by default ignores xinitrc. So autocutsel didn't get started. So the solution is te either change /etc/cdmrc to use xinitrc or use whatever ether startup method your WM/DE uses.

Starting autocutsel with those two commands seemed to make the synching work indeed.

I guess what I really need is to do is go complain upstream about changing shift+insert behaviour to paste clipboard.

Thanks for the help anyway.

Offline

Board footer

Powered by FluxBB