I have not dealt much with env variables. Recently I am starting to use some application that use them instead of config files to get input from the user. As an example there is a program for managing clipboard history named ‘clipmanu’. Its deamond called clipmenud uses $CM_SELECTION to get which clipboards to use. I have tried to set a value for it and put it in my bashrc, but got no results. Does anyone knows how I should set this up? I am on EOS and suing XFCE. The dev thinks there is an issue on packaging or something , but I guess maybe I am doing something wrong.
Start clipmenud, then run clipmenu to select something to put on the clipboard. For systemd users, a user service called clipmenud is packaged as part of the project.
Can you elaborate a bit more. The new thing I learnt from your comment was that adding it to .bashrc doesn’t work on systemd. But how I should give another value to clipmenud. I starts on system boot so I should give it somewhere before that. I have a script that I had set to executes and it works for the most part but not this one.
In the link I posted above there are several suggestions for how to set environmental variables for systemd user services.
Please read through that.
I would try the method in the first point:
For users with a $HOME directory, create a .conf file in the ~/.config/environment.d/ directory with lines of the form NAME=VAL. Affects only that user’s user unit. See environment.d(5) for more information.
It is not working, I think I named the file wrongly. It says this in the link:
Example 1. Setup environment to allow access to a program installed in /opt/foo
/etc/environment.d/60-foo.conf:
but what is this number in start of the filename. I have created a file on ~/.config/environment.d/.conf and put my value in it but nothing happens after restarting system.d . I guess I should not use .conf as the filename but don’t know what to use from the example.
The clipmenu documentation. I am trying to stop clipmenu from copying primary selection into its history file.
clipmenud collects and caches what’s on the clipboard. You can manage its
operation with clipctl.
Environment variables:
$CM_DEBUG: turn on debugging output (default: 0)
$CM_DIR: specify the base directory to store the cache dir in (default: $XDG_RUNTIME_DIR, $TMPDIR, or /tmp)
$CM_MAX_CLIPS: soft maximum number of clips to store, 0 for inf. At $CM_MAX_CLIPS + 10, the number of clips is reduced to $CM_MAX_CLIPS (default: 1000)
$CM_ONESHOT: run once immediately, do not loop (default: 0)
$CM_OWN_CLIPBOARD: take ownership of the clipboard. Note: this may cause missed copies if some other application also handles the clipboard directly (default: 0)
$CM_SELECTIONS: space separated list of the selections to manage (default: “clipboard primary”)
$CM_IGNORE_WINDOW: disable recording the clipboard in windows where the windowname matches the given regex (e.g. a password manager), do not ignore any windows if unset or empty (default: unset)
After rebooting it works now , thank you very much for your help.
Do you know how can I set up basic env variables? Like for example $EDITOR and $BROWSER too? I had in the past have a difficult time setting these up in bashrc and make them work consistently all over the system.
Since this specific topic is already solved, and your other question is irrelevant, you may want to start a new topic, so you get advice about your new difficulty.