yusufaktepe / rofi-gpaste

Rofi frontend for GPaste clipboard manager.
GNU General Public License v3.0
24 stars 3 forks source link

Issues with i3 shortcuts #2

Closed landorg closed 1 week ago

landorg commented 6 months ago

Hi I'm having problems to run this from an i3 shortcut. While it works fine from the command line it hangs from the shortcut

bindsym --release $alt+ctrl+h exec "/bin/rofi-gpaste --debug &> /tmp/out"

/tmp/out

+ export SHELLOPTS
+ exec /bin/rofi-gpaste
+ Kb_Clear=Alt+c
+ Kb_Toggle=Alt+p
+ Kb_Delete=Alt+d
+ Kb_Edit=Alt+e
+ Kb_Archive=Alt+s
+ Kb_Hist=Alt+h
+ Kb_Paste=Alt+Return
+ Kb_QR=Alt+q
+ Kb_Save=Alt+o
+ Kb_Backup=Alt+B
+ Kb_Switch_Main=Alt+1
+ Kb_Switch_Archive=Alt+2
+ Kb_LaunchGUI=F1
+ Editor=xdg-open
+ ImageViewer=xdg-open
+ PromptPrefix=' '
+ ConfigFile=/home/roland/.config/rofi-gpaste.conf
+ '[' -f /home/roland/.config/rofi-gpaste.conf ']'
+ Script=rofi-gpaste
+ GpasteDir=/home/roland/.local/share/gpaste
+ pidof -q gpaste-daemon
+ case $1 in
+ menu
++ gpaste-client get-history

It always hangs on the gpaste-client get-history command. Also directly using that command makes it hang:

❯ pgrep -a gpaste
34408 /usr/lib/gpaste/gpaste-daemon
72155 /bin/bash /bin/rofi-gpaste
72158 gpaste-client get-history

Any idea what might be missing there?

yusufaktepe commented 6 months ago

Could you reset gpaste and try again?

Run:

pkill -f gpaste
dconf reset -f /org/gnome/GPaste/
mv ~/.local/share/gpaste ~/.local/share/gpaste.old
landorg commented 6 months ago

It's exactly the same. After the reset:

❯ pkill -f gpaste

❯ dconf reset -f /org/gnome/GPaste/

❯ mv ~/.local/share/gpaste ~/.local/share/gpaste.old

❯ pgrep -a gpaste

(I hit the shortcut)

❯ cat /tmp/out
+ export SHELLOPTS
+ exec /bin/rofi-gpaste
+ Kb_Clear=Alt+c
+ Kb_Toggle=Alt+p
+ Kb_Delete=Alt+d
+ Kb_Edit=Alt+e
+ Kb_Archive=Alt+s
+ Kb_Hist=Alt+h
+ Kb_Paste=Alt+Return
+ Kb_QR=Alt+q
+ Kb_Save=Alt+o
+ Kb_Backup=Alt+B
+ Kb_Switch_Main=Alt+1
+ Kb_Switch_Archive=Alt+2
+ Kb_LaunchGUI=F1
+ Editor=xdg-open
+ ImageViewer=xdg-open
+ PromptPrefix=' '
+ ConfigFile=/home/roland/.config/rofi-gpaste.conf
+ '[' -f /home/roland/.config/rofi-gpaste.conf ']'
+ Script=rofi-gpaste
+ GpasteDir=/home/roland/.local/share/gpaste
+ pidof -q gpaste-daemon
+ setsid -f gpaste-client daemon
+ case $1 in
+ menu
++ gpaste-client get-history

❯ pgrep -a gpaste
1090965 /bin/bash /bin/rofi-gpaste
1090968 gpaste-client daemon
1090973 /usr/lib/gpaste/gpaste-daemon
1090975 gpaste-client daemon
1090976 gpaste-client get-history

Starting it from the terminal still works

yusufaktepe commented 6 months ago

hangs on the gpaste-client get-history command. Also directly using that command makes it hang While it works fine from the command line it hangs from the shortcut

It's strange that the gpaste-client get-history command hangs when executed from i3 or outside the script, while it doesn't hang when the script is initiated from the terminal. I can't think of a reason for this behavior.

I suggest creating an issue at the GPaste repo since there seems to be an issue with the gpaste-client get-history command.

landorg commented 6 months ago

My guess it's missing some environment variables to work properly that are not there on i3 level. What does that client use to connect to gpaste?

yusufaktepe commented 5 months ago

My guess it's missing some environment variables to work properly that are not there on i3 level. What does that client use to connect to gpaste?

I'm not sure.

If the only issue is with the get-history command, we can workaround that. Can you try dconf-get-history branch to check if it works?

landorg commented 5 months ago

Hi. Sorry for the delay. Yes from that branch i get the rofi menu and it works

landorg commented 5 months ago

Ah sorry that was wrong. When I have gpaste running next thing that hangs is:

gpaste-client --oneline
yusufaktepe commented 5 months ago

Ah sorry that was wrong. When I have gpaste running next thing that hangs is:

gpaste-client --oneline

In that case, there is something wrong with your installation or environment. You should open an issue at gpaste repo for that.