You are not logged in.

#1 2019-01-21 00:39:13

trent234
Member
Registered: 2019-01-21
Posts: 6

[Solved] Clipmenu not displaying any copied data

This is my first Arch post, I’ve tried to cover my bases in order to be as effective here as possible, but please let me know how I can edit this to improve it.

First, the issue: The menu never shows any cuts whether from primary or clipboard selection. There is no drop-down of clips.  The primary and clipboard selection still function as they normally would.

Background relevant setup info: I’m using i3 and dmenu. System is up to date of course.

I installed clipmenu and then clipnotify. I also installed autcutsel to combine the primary and clipboard selection, but upon realizing clipmenu would cover this consolidation I uninstalled it. (So it should have no impact but including that info in case.)

I installed xbindkeys to bind my F2 key to clipmenu by including

xbindkeys

in my .xinitrc and including

clipmenu
XF86AudioLowerVolume

In .xbindkeysrc.

F2 works and the empty dmenu-looking clipmenu bar appears.

After installing clipmenu I tried enabling clipmenud with

sudo systemctl enable clipmenud

which usually has worked for services in the past, but I had to provide the full path for systemctl to find the file:

sudo systemctl enable usr/bin/systemd/user/clipmenud.service 

and it created a symlink I believe.
I’ve confirmed the service is consistently started by checking this after reboot:

sudo systemctl status clipmenu

Which outputs success:

 clipmenud.service - Clipmenu daemon
   Loaded: loaded (/usr/lib/systemd/user/clipmenud.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-01-18 09:41:36 PST; 2 days ago
 Main PID: 424 (bash)
    Tasks: 2 (limit: 4915)
   Memory: 3.9M
   CGroup: /system.slice/clipmenud.service
           ├─  424 bash /usr/bin/clipmenud
           └─18986 sleep 0.5

# No protocol specified
# Can't open X display
# No protocol specified
# xsel: Can't open display: (null)
# : Resource temporarily unavailable
# No protocol specified
# xsel: Can't open display: (null)
# : Resource temporarily unavailable
# No protocol specified
# Can't open X display

(Not sure if those last lines matter, but I'm including it just in case)

Running clipmenu in the console and searching for anything results in the following output:

# clipmenu
FATAL: dsa not in cache (/run/user/1000/clipmenu.5.trent/56984002 4 missing)
Please report the following debug information:

Running this (the creator of clipmenu has asked for this output for debugging purposes in other posts):

bash -x usr/bin/clipmenu

It outputs this:

+ : dmenu
+ : /run/user/1000
+ : 8
+ major_version=5
+ shopt -s nullglob
+ cache_dir=/run/user/1000/clipmenu.5.trent
+ cache_file_prefix=/run/user/1000/clipmenu.5.trent/line_cache
+ [[ '' == --help ]]
+ [[ '' == -h ]]
+ [[ dmenu == rofi ]]
+ [[ dmenu == rofi-script ]]
++ list_clips
++ dmenu -l 8
++ cat /dev/null
++ cut '-d ' -f2-
++ LC_ALL=C
++ sort -rnk 1
++ awk '!seen[$0]++'
+ chosen_line=
+ [[ -n '' ]]
+ exit 1

The cache directory where the clips should be stored is listed above. Checking that, I found the directory does not exist. So, this is where I believe the problem lies. Clipmenu is installed, the service is enabled, it can be displayed through dmenu, but there are no clips showing because the program is failing to write anything to the cache file. But I am stuck at this point and could not find an answer by looking through short clipmenu code:

https://github.com/cdown/clipmenu/blob/develop/clipmenu

Does anyone see something in all of this that could be causing the issue? Having a fully functional clipboard like clipmenu that fits right at home in the i3 environment would be so ideal.
Thanks in advance for any and all input.

Trent

Last edited by trent234 (2019-01-21 20:35:21)

Offline

#2 2019-01-21 04:52:50

Lupo Alberto
Member
From: Gomel, Belarus
Registered: 2013-11-25
Posts: 84

Re: [Solved] Clipmenu not displaying any copied data

In first, why don't you bind the keys  in i3/config?
I had the problem alike your and I did this:
1.  I've added clipmenud.service my user systemd-level but not system-level.

systemctl --user enable clipmenud.service

2. ...changed some variables for this service:

systemctl --user edit clipmenud.service
[Service]
Environment=CM_DIR=%h/.cache/

3. Then I've written this wrapper script clipmenu.sh  (Don't forget to place it in your user $PATH)

#!/bin/bash
export CM_LAUNCHER=rofi
export CM_DIR=~/.cache
export CM_HISTLENGTH=12

case "$1" in
	show)
		clipmenu ;;
	clean)
		clipdel -d ".*" \
		&& notify-send "Clipboard Content deleted" -u low \
		|| notify-send "Errors occurred while Clean Up"	;;
esac

4. Finally I've made some keybinding to show and delete my clipboard:

...
set $clip_chooser clipmenu.sh
# Show clipboard content
bindsym $mod+Shift+Menu exec --no-startup-id $clip_chooser show
# Clean Up clipboard
#bindsym $mod+Shift+d exec --no-startup-id $clip_chooser clean
bindcode $mod+Shift+40 exec --no-startup-id $clip_chooser clean

Offline

#3 2019-01-21 20:29:24

trent234
Member
Registered: 2019-01-21
Posts: 6

Re: [Solved] Clipmenu not displaying any copied data

Those were all helpful recommendations.
I removed xbindkeys, removed any mention of it from xinitrc, and instead used i3/config to bind the keys.
I changed the service from system level to user level (and reviewed my habits on this for past services.)
I made a similar wrapper script.

I think those were all improvements in technique and style, and I believe the big change was modifying the CM_DIR variable because my clipmenu is working as expected now, and I've visually confirmed the cache files now exist in their new directory in my ~/.cache folder.

Thanks,
Trent

Offline

Board footer

Powered by FluxBB