mrichar1 / clipster

clipster - python clipboard manager
GNU Affero General Public License v3.0
242 stars 26 forks source link

piping to rofi or dmenu broken in 1.2.4 #61

Closed magnetophon closed 7 years ago

magnetophon commented 7 years ago

I use clipster trough rofi, with the command clipster -o -n 0 -0 | rofi -i -dmenu -sep '\x00' -eh 2 -p paste: | sed -ze 's/\n$//' | clipster. On version 1.0.1 that worked just fine, but on 1.2.4 I get all the text overlaid on one line: https://imgur.com/a/QKpjT

Also more minimal versions fail in similar ways: clipster -o -n 0 -0 | rofi -dmenu clipster -o -n 0 -0 | dmenu

mrichar1 commented 7 years ago

Hi,

Thanks for this report.

I'm trying to replicate what you're describing, but I'm not sure what you mean by 'text overlaid on one line.'

My test seems to work as expected:

>$ echo -e "cat\ndog\nfish\n\n" | clipster
(server:) DEBUG:[u'cat\ndog\nfish\n\n']

 $ clipster -o -n 0 -0 | rofi -i -dmenu -sep '\x00' -eh 2 -p paste: | sed -ze 's/\n$//'
<*select only item in rofi*>
cat
dog
fish

>$

Can you give me an example of the expected versus actual output you're seeing? Thanks!

magnetophon commented 7 years ago

Did you see the screenshot?

magnetophon commented 7 years ago

I just tried with 1.2.3, and that works fine too.

mrichar1 commented 7 years ago

Hi - thanks for the screenshot and updates.

Turns out that in fixing a python 2 unicode bug in 1.2.4 I'd introduced a new one for python 3. py2 needs stringscontaining unicode explicitly encoding, but calling encode() on python3 strings converts them to bytes, which rofi doesn't cope with.

I've hopefully fixed this in ed205c68ff5b21648f05dcb8fed36c7a3fc86758 - can you try 1.2.5 and let me know if you are still having issues. Thanks!

magnetophon commented 7 years ago

All good now! Thank you!

fourstepper commented 4 years ago

@magnetophon Hi, how do you use the above? I tried to use your option in i3wm with rofi, got the menu up and running when I select one of the options it seems that nothing happens. clipster daemon is up and running

magnetophon commented 4 years ago

At the moment I'm using clipster trough fzf, for even better search capabilities and a nice preview window: https://github.com/magnetophon/.dot/blob/master/common/.local/bin/clipster_fzf.sh

fourstepper commented 4 years ago

Sorry for the ignorance, but how do I copy the output of the fuzzy find to my primary clipboard?

magnetophon commented 4 years ago

I think that's this line: https://github.com/magnetophon/.dot/blob/master/common/.config/clipster/clipster.ini#L13