You are not logged in.

#1 2013-10-07 02:33:31

pythonscript
Member
From: Edinburgh, Scotland
Registered: 2009-07-10
Posts: 68

[solved] Telling dwm to use a custom dmenu

I run a customized version of dwm from my home directory, in ~/build/dwm, which I maintain a git repository. I'd like to do the same thing with dmenu, but if I don't have dmenu installed anywhere else on my system (I haven't installed it as root), how will dwm know to use the version of dmenu in ~/build/dmenu ? As long as ~/build/dmenu/ is in my path, dwm should find the binary, correct?

Last edited by pythonscript (2013-11-01 00:54:20)


Lenovo SL510 Thinkpad / Asus EEEPC 1005HA
No hables a menos que puedas mejorar el silencio. - Neruda
La sabiduría nos llega cuando ya no nos sirve de nada. - Márquez

Offline

#2 2013-10-07 04:04:56

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: [solved] Telling dwm to use a custom dmenu

It doesn't really matter whether you installed dmenu as root or inside your $HOME dir, as long as the binary is accessible for dwm (via a launcher for instance).

That's how I do it:

1. I have a custom dmenu launcher in $HOME/.local/bin/dmenu-dwm (./local/bin is in my $PATH).
2. In confg.h I put:

/* commands */
static const char *dmenu[] = { "dmenu-dwm", NULL };
.
.

static Key keys[] = {
  { MODKEY,               XK_d, spawn, {.v = dmenu }},
  .
  .
}

-- and voilà: everything works like a charm.

Last edited by bohoomil (2013-10-07 04:36:23)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#3 2013-10-16 03:53:07

pythonscript
Member
From: Edinburgh, Scotland
Registered: 2009-07-10
Posts: 68

Re: [solved] Telling dwm to use a custom dmenu

Sorry about the delay; placing dmenu somewhere in my path (~/bin in my case) let dwm pick it up without any other modifications. Thank you!


Lenovo SL510 Thinkpad / Asus EEEPC 1005HA
No hables a menos que puedas mejorar el silencio. - Neruda
La sabiduría nos llega cuando ya no nos sirve de nada. - Márquez

Offline

#4 2013-10-31 00:52:06

pythonscript
Member
From: Edinburgh, Scotland
Registered: 2009-07-10
Posts: 68

Re: [solved] Telling dwm to use a custom dmenu

Unfortunately, this doesn't seem to have worked after all. I placed a symbolic link to ~/build/dmenu/dmenu_run and ~/build/dmenu/dmenu in my ~/bin, then restarted X. dmenu works properly except it doesn't autocomplete entries. According to the wiki (https://wiki.archlinux.org/index.php/dm … not_loaded), this can be because dmenu doesn't inherit ~/.bashrc. I followed the instructions there, placing export PATH=$PATH:~/bin/ in my ~/.xinitrc, deleting ~/.dmenu_cache and restarting X, but still, dmenu doesn't autocomplete entries.


Lenovo SL510 Thinkpad / Asus EEEPC 1005HA
No hables a menos que puedas mejorar el silencio. - Neruda
La sabiduría nos llega cuando ya no nos sirve de nada. - Márquez

Offline

#5 2013-10-31 01:09:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [solved] Telling dwm to use a custom dmenu

Why are you trying to export your PATH from .xinitrc?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2013-10-31 02:43:36

pythonscript
Member
From: Edinburgh, Scotland
Registered: 2009-07-10
Posts: 68

Re: [solved] Telling dwm to use a custom dmenu

jasonwryan wrote:

Why are you trying to export your PATH from .xinitrc?

I must be reading the wiki incorrectly. The page/section I linked to says:

Scripts in $PATH not loaded

This happens because dmenu doesn't inherit environment set in ~/.bashrc. To fix this, put the export line in .xinitrc:

    export PATH=$PATH:~/bin/:~/scripts/

Delete ~/.cache/dmenu_cache and restart X.

Am I reading that incorrectly? I deleted both ~/.dmenu_cache and ~/.cache/dmenu_run, and still no luck.

Last edited by pythonscript (2013-10-31 02:46:36)


Lenovo SL510 Thinkpad / Asus EEEPC 1005HA
No hables a menos que puedas mejorar el silencio. - Neruda
La sabiduría nos llega cuando ya no nos sirve de nada. - Márquez

Offline

#7 2013-10-31 03:09:01

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [solved] Telling dwm to use a custom dmenu

This strikes me as a stupid idea: environment variables should not be in .bashrc, even less so in .xinitrc: they belong in (if you are using bash) .profile or .bash_profile...

# edit: fixed.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2013-10-31 03:13:53

pythonscript
Member
From: Edinburgh, Scotland
Registered: 2009-07-10
Posts: 68

Re: [solved] Telling dwm to use a custom dmenu

I guess it's good that it's removed from the wiki then, but I'm still not sure why dmenu isn't autocompleting. Why is it a bad idea for environment variables to be in ~/.bashrc?

Last edited by pythonscript (2013-10-31 03:14:11)


Lenovo SL510 Thinkpad / Asus EEEPC 1005HA
No hables a menos que puedas mejorar el silencio. - Neruda
La sabiduría nos llega cuando ya no nos sirve de nada. - Márquez

Offline

#9 2013-11-01 00:52:56

pythonscript
Member
From: Edinburgh, Scotland
Registered: 2009-07-10
Posts: 68

Re: [solved] Telling dwm to use a custom dmenu

Stupid mistake on my part. When I compiled dmenu, I hadn't made dmenu_path executable. Tweaking that fixed the problem. I added dmenu's build folder to the path, and now it's working properly.


Lenovo SL510 Thinkpad / Asus EEEPC 1005HA
No hables a menos que puedas mejorar el silencio. - Neruda
La sabiduría nos llega cuando ya no nos sirve de nada. - Márquez

Offline

#10 2013-11-01 00:54:54

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [solved] Telling dwm to use a custom dmenu

Cool. Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB