You are not logged in.

#176 2013-04-05 22:43:38

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

@karabaja4, read the comment above that. When isatty returns false for stdin, it means the stdin does not refer to terminal, but something else. However, it might be good idea to reverse the OR conditional.

Offline

#177 2013-04-06 09:05:56

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

I read the comment, but it is still not clear to me. Consider this line:

if (!isatty(fileno(stdin)) || PIPE_MODE) return 1;

If we are not in terminal, isatty will return false so "if" will evaluate to true -> the function returns 1 and does nothing.
OR
If we are using PIPE_MODE flag, "if" will evaluate to true -> the function returns 1 and does nothing.

Is this right?

*** edit

I tried loliclip just now. I know you suggested to use lolictrl, but I wanted to see if it would work on it's own:

loliclip -p | loliclip -i -c

This doesn't work if I am not in terminal... am I doing something wrong?

Last edited by karabaja4 (2013-04-06 09:40:19)

Offline

#178 2013-04-06 10:27:17

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

If we are not in terminal, isatty will return false so "if" will evaluate to true -> the function returns 1 and does nothing.
OR
If we are using PIPE_MODE flag, "if" will evaluate to true -> the function returns 1 and does nothing.
Is this right?

This should be right.

This doesn't work if I am not in terminal... am I doing something wrong?

How are you executing this and where, I can't reproduce it?
Also, does loliclip -p output anything? There is daemon running?

Last edited by Cloudef (2013-04-06 10:37:06)

Offline

#179 2013-04-06 10:37:41

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

Cloudef wrote:

This should be right.

But why does PIPE_MODE=1 cause the function to do nothing? That means if we are using -i switch (PIPE_MODE=1) the function will always return (do nothing).

Cloudef wrote:

How are you executing this and where, I can't reproduce it?

Openbox, I have this binded in rc.xml:

<keybind key="W-c">
      <action name="Execute">
        <execute>/home/igor/scripts/system/primary2clipboard.sh</execute>
      </action>
    </keybind>

and this in the primary2clipboard.sh:

#!/bin/bash

loliclip -p | loliclip -i -c

loliclip -p outputs the primary clipboard content.
daemon is running.

Last edited by karabaja4 (2013-04-06 10:40:51)

Offline

#180 2013-04-06 10:47:15

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

But why does PIPE_MODE=1 cause the function to do nothing? That means if we are using -i switch (PIPE_MODE=1) the function will always return (do nothing).

The stuff below it, outputs the data from selected clipboard. You don't want that, if the pipe din't have nothing.

I'll install openbox and test your configuration.

Last edited by Cloudef (2013-04-06 10:47:48)

Offline

#181 2013-04-06 10:58:37

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

BTW, if I comment out line 1806

if (PIPE_MODE || !isatty(fileno(stdin))) return 1;

all works fine.

Last edited by karabaja4 (2013-04-06 11:01:47)

Offline

#182 2013-04-06 11:18:05

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

@karabaja, Yeah indeed. The isatty seems to not work well here which is a shame.
Oh well, I just restore the old behaviour. That is using -pcs for outputting data from selection, and -pcs with -i switch for input.

To preserve the isatty checks for just normal terminal usage, you would also need output mode for these corner cases, which pretty much kills the point for me.

Anyways, can you try with current git now smile
(The -i/--pipe is now -i/--input, to not input, just don't include -i in your arguments)

I should make .install file reporting for this change, as it breaks the old way.

Last edited by Cloudef (2013-04-06 11:21:45)

Offline

#183 2013-04-06 12:25:12

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

Something's wrong.

When I select primary in terminal and try to pipe (in terminal):

~ >>> loliclip -p | loliclip -c
<it outputs my primary text here>
~ >>>

My bind on primary2clipboard.sh also doesn't work (without the -i switch in the script).

Last edited by karabaja4 (2013-04-06 12:27:33)

Offline

#184 2013-04-06 13:14:35

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

it should be loliclip -p | loliclip -ci

Offline

#185 2013-04-06 13:44:34

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

smile It works! cool

Thanks!

Offline

#186 2013-04-06 14:33:40

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

Nope. I'll just hope the --input change doesn't confuse things too much.

Offline

#187 2013-04-06 16:51:23

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

A problem again big_smile (sorry).

Sometimes loliclip seems to cut off the last character when copying text?

I can reproduce it when selecting big primary text (output of ps ax + new shell prompt line) in terminal, then doing "loliclip -p | loliclip -ci", then pasting in text editor, it pastes without the last character of the terminal prompt.

Last edited by karabaja4 (2013-04-06 16:58:35)

Offline

#188 2013-04-06 17:10:47

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

@karabaja4, yeah fixed already on git and AUR IIRC. Happenned when text had trailing space.
Err.. Seems to still happen.. Fixing.

Last edited by Cloudef (2013-04-06 17:12:59)

Offline

#189 2013-04-06 17:33:58

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

Hopefully fixed now.

Offline

#190 2013-04-06 17:38:54

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

Yeah, it works now. Thanks.

Offline

#191 2013-07-15 13:56:00

marttt
Member
Registered: 2013-05-21
Posts: 22

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

loliclip+dmenu is an excellent combo. Thanks for your work, Cloudef!

However: I can't get it working under Wine: I am doing audio editing with Reaper under wine, and while I can visually cut audio clips (meaning they seem to go to some kind of clipboard, somewhere), I cannot paste them. After killing the loliclip daemon, everyting works. Is this the expected behaviour at this point?

Disabling loliclip for these Wine+Reaper sessions is not much of a problem, but for the sake of perfection, I'd rather save those invaluable keystrokes and my precious time smile)

Last edited by marttt (2013-07-15 13:56:40)

Offline

#192 2013-07-15 14:12:57

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

@marttt
Can you run this python script while something has been copied from Reaper and post the output. (without loliclip running)
https://github.com/Cloudef/PKGBUILDS/bl … targets.py

Offline

#193 2013-07-16 13:41:46

marttt
Member
Registered: 2013-05-21
Posts: 22

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

@Cloudeff
Sure:

Targets available: TARGETS, REAPERMedia
Special selection 'TARGETS'...
Special selection 'REAPERMedia'...

Offline

#194 2013-07-16 14:35:45

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

@marttt
What happens when you add

REGISTER_SELECTION("REAPERMedia", 3, 0),

At the specialclip section in config.h, and compile again.

Last edited by Cloudef (2013-07-16 14:36:35)

Offline

#195 2013-07-16 18:12:02

marttt
Member
Registered: 2013-05-21
Posts: 22

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

@Cloudef
Yep, now it works. Thank you very much!
(I think I installed loliclip from AUR, so I did not look into the source files and your excellent instructions in the first place.)

Last edited by marttt (2013-07-16 18:14:41)

Offline

#196 2013-07-16 18:24:49

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

@marttt, I might work on some dynamic specialclip buffer in future, so unless customization is needed, those selection register stuff should become optional.

Last edited by Cloudef (2013-07-16 18:24:56)

Offline

#197 2013-07-31 14:24:17

Alien282
Member
Registered: 2013-07-31
Posts: 20

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

Hi, loliclip is EXACTLY what I need, however I'm having a couple of issues with it.

1) It takes a second or two to copy from the CLIPBOARD to the PRIMARY... is this a known issue? For example I copy from gVim some text (using "+y, i.e. in the OS CLIPBOARD) and then do a "P" in pentadactyl (which uses the PRIMARY selection) and it says that there is nothing there. It only works after a couple of seconds and is really annoying. Is there any way to "fix" that?

2) Sometimes when I copy from gVim and I close it really fast, the selection is not persisted - that is, when I paste, the previous one I had is pasted. Am I mistaken somewhere? Is loliclip supposed to save the CLIPBOARD contents after the application is quit (if not - who does that?) and why is it not working sometimes?

Thanks!

Offline

#198 2013-07-31 14:52:45

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

@Alien282


Loliclip doesn't do anything with primary since it's problematic. It only follows CLIPBOARD and offers you commands that you can map to keys for synchronizing primary to clipboard.
It's possible to turn on PRIMARY synchronization in loliclip, but it causes annoying side effects in X applications because it's not possible to know when PRIMARY selection for example is finished.

I suggest doing something like this in vim instead:

vmap <C-c> :<Esc>`>a<CR><Esc>mx`<i<CR><Esc>my'xk$v'y!tee >(loliclip -ci)<CR>u

Your visual selection is in CLIPBOARD now.
If you don't want vim binding, you can map (or run from shell) lolictrl -spc which synchronizes current primary selection to CLIPBOARD.

EDIT:
I read you wrong, you actually copy to CLIPBOARD.
Your problem is most likely related to loliclip's blocking system.

Try to lower following values in loliclip.c:
xcb_timeout_loop, xcb_timeout_daemon

Ideally these kinds of hacks would not be needed, but X11 doesn't give any clipboard events for other clients than the current owner.

Last edited by Cloudef (2013-07-31 15:04:58)

Offline

#199 2013-07-31 15:31:48

Alien282
Member
Registered: 2013-07-31
Posts: 20

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

Thanks for the answer! Can you explain to me what this vim mapping does exactly as I think it could be simpler... smile Another question - do all clipboard managers work by polling? parcellite was pretty good - it does the same as you?

Offline

#200 2013-07-31 16:23:52

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: xcmenu - lightweight clipboard manager for X (formerly loliclip)

Alien282 wrote:

Thanks for the answer! Can you explain to me what this vim mapping does exactly as I think it could be simpler... smile Another question - do all clipboard managers work by polling? parcellite was pretty good - it does the same as you?

The vim binding above, pipes only the visual selection (not whole line) to loliclip.

Loliclip does way more than usual clipboard managers, like post-processing, which needs loliclip to steal the ownership of clipboard from other application and store modified buffer with all the targets that the application that previously hold the buffer supported. While usual clipboard managers just keep history of clips and takes hold of the buffer when previously holding application dies or gives away the buffer.

Even this said though, I'm also confident that GTK's and Qt's X11 clipboard handling code is much higher quality than that in loliclip's.

Last edited by Cloudef (2013-07-31 16:41:35)

Offline

Board footer

Powered by FluxBB