You are not logged in.

#1 2016-06-19 13:19:56

tomtava
Member
Registered: 2016-06-17
Posts: 6

dmenu customization

I have been looking into customizing the dmenu(_run). It seems to be a quite convenient menu with a lot of functionality. I have a few questions about it though.

The first thing I want to ask is, if it's possible to make it look somewhat like this:
http://i.imgur.com/mHBgdTn.png
(credit to /u/cosatelo from https://www.reddit.com/r/unixporn/comme … nsopenbox/ )
And I am aware that this is actually rofi and not dmenu, but I am trying to keep my installations to a minimum. Besides it seems to me that dmenu is more powerful! But I might be wrong.

I have tried editing the ~/.config/dmenu/dmenu-bind.sh but as far as I can see (in the man page) this is pretty much limited to color customization and I can't find any way to use padding or aligning (aside from top or bottom).

My second question is how I can launch the menu with my super key (windows key). I tried editing the keybinding in ~/.config/openbox/rc.xml. The specific changes I made are as follows:


</keybind>
    <keybind key="W">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>dmenu-bind</name>
        </startupnotify>
        <command>~/.config/dmenu/dmenu-bind.sh</command>
      </action>
    </keybind>

This doesn't seem to work though.

Well, once again, thanks in advance!
tomtava

Last edited by tomtava (2016-06-19 15:14:37)


I sure hope this doesn't break my system!

Offline

#2 2016-06-19 13:23:11

mrneilypops
The BL Scrot.Moe Guy
From: luxembourg
Registered: 2015-09-30
Posts: 577
Website

Re: dmenu customization

Have you had a look at dmenu-extended?
https://github.com/markjones112358/dmenu-extended

I use it a lot in my projects and it is regularly updated.

Offline

#3 2016-06-19 13:48:15

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: dmenu customization

To hack dmenu, download the source from suckless:

git clone http://git.suckless.org/dmenu

The code can then be patched:
http://tools.suckless.org/dmenu/patches/

It is also possible to script the crap out of it in the best traditions of UNIX smile

See https://bbs.archlinux.org/viewtopic.php?id=80145

Offline

#4 2016-06-19 14:47:04

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: dmenu customization

tomtava wrote:

...
My second question is how I can launch the menu with my super key (windows key). I tried editing the keybinding in ~/.config/openbox/rc.xml. ...
This doesn't seem to work though.

Well, once again, thanks in advance!
tomtava

You can't. The Super key is a modifier, ie it must be used in combination with another key.
"Menu -> Help -> Openbox Website -> Openbox Documentation"  http://openbox.org/wiki/Help:Bindings

PS Please use [ code ] tags for terminal output wink

---EDIT--- But see @nore's post below. I didn't know you could workaround it that way  8o

Last edited by damo (2016-06-19 15:44:08)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#5 2016-06-19 15:35:35

nore
>2⁹
From: squirrels' nest
Registered: 2015-09-29
Posts: 537

Re: dmenu customization

In your rc.xml you can map left Super key with

<keybind key="0x85">

0x86 the right Super key, if you have one on your keyboard.

Offline

#6 2016-06-19 16:22:55

tomtava
Member
Registered: 2016-06-17
Posts: 6

Re: dmenu customization

@mrneilypops that sure looks like a neat plug-in or addon or what ever it is called! Does it include some way to align/center/use padding? I couldn't find it at leat. smile

@Head_on_a_Stick ahh, I will have to look into that! Sorry for being such a noob, but when I run that command, where is the source stored? Or how can I modify it?

@damo Oh, sorry haha! It's fixed now! smile

@nore Great! Just what I was looking for!

Thanks to all of you!


I sure hope this doesn't break my system!

Offline

#7 2016-06-19 16:34:10

vasa1
Member
Registered: 2015-09-29
Posts: 204

Re: dmenu customization

nore wrote:

In your rc.xml you can map left Super key with

<keybind key="0x85">

0x86 the right Super key, if you have one on your keyboard.

Good stuff! But if OP uses it that way, won't all the default rc.xml keybinds using Super + something else open dmenu plus whatever else? Or does OP not want to use the Super key in conjunction with anything else?


Using the Openbox (3.5.2) session of Lubuntu 14.04 LTS but very interested in BL :)

Offline

#8 2016-06-19 16:44:55

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: dmenu customization

vasa1 wrote:

...
Good stuff! But if OP uses it that way, won't all the default rc.xml keybinds using Super + something else open dmenu plus whatever else? Or does OP not want to use the Super key in conjunction with anything else?

Yes, every other keybind that uses Super will be broken - that's why it is meant to be a "modifier". But it is his system to do what he wants with wink

Actually, only dmenu will open, because it blocks other actions while it is running. It would make more sense to use the "Menu" key, if the kb has one, I guess.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#9 2016-06-19 16:47:32

mrneilypops
The BL Scrot.Moe Guy
From: luxembourg
Registered: 2015-09-30
Posts: 577
Website

Re: dmenu customization

tomtava wrote:

@mrneilypops that sure looks like a neat plug-in or addon or what ever it is called! Does it include some way to align/center/use padding? I couldn't find it at leat.

Not that I am ware of...but the dev is very approachable, he might be able to assist;
https://github.com/markjones112358

I do know that you can adjust number of entries to effectively adjust the size, also the colours are easily tweakable  wink

Offline

#10 2016-06-19 17:48:39

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: dmenu customization

tomtava wrote:

@Head_on_a_Stick ahh, I will have to look into that! Sorry for being such a noob, but when I run that command, where is the source stored? Or how can I modify it?

The `git clone` command downloads the folder to the present working directory, you will probably find it at ~/dmenu unless the command was run from a terminal opened in ~/Downloads or something.

Probably simplest to use:

git clone http://git.suckless.org/dmenu && cd dmenu

You can then copy config.def.h to config.h to set the colour options at compile-time and make sure that you edit config.mk and change these lines:

X11INC = /usr/include/X11
X11LIB = /usr/lib/X11

Once this is done you can then apply the patches by downloading them and running this command (from the dmenu folder):

git apply ~/Downloads/patch.diff

This presumes that the patch is called "patch.diff" and it is in ~/Downloads, adjust as needed.

Finally, compile the program and install it:

make && sudo make install

This will place the dmenu binary at /usr/local/bin/dmenu so it can be used with the suckless-tools package still installed.

If you elect to change the colour configuration at compile time, edit ~/.config/openbox/rc.xml and change "~/.config/dmenu/dmenu-bind.sh" at line 337 to "dmenu_run"

Offline

#11 2016-06-19 17:58:49

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: dmenu customization

tomtava wrote:

align/center/use padding?

Have a look at @nobody's "gravitating dmenu" fork:
https://github.com//dmenu-v

http://crunchbang.org/forums/viewtopic. … 27#p422327

Offline

#12 2016-06-19 19:20:38

nore
>2⁹
From: squirrels' nest
Registered: 2015-09-29
Posts: 537

Re: dmenu customization

vasa1 wrote:

But if OP uses it that way, won't all the default rc.xml keybinds using Super + something else open dmenu plus whatever else?

Yes, there will be side effects, if Super-keybindings are not replaced. But if there are two Windows (or Tux or whatever) keys on keyboard, default Openbox W-* key is the left one, and right one is left unused.

Offline

#13 2016-06-20 03:50:13

vasa1
Member
Registered: 2015-09-29
Posts: 204

Re: dmenu customization

damo wrote:

...
Actually, only dmenu will open, because it blocks other actions while it is running. It would make more sense to use the "Menu" key, if the kb has one, I guess.

Thanks, I use dmenu a bit and have it set to C-S-D.

nore wrote:
vasa1 wrote:

But if OP uses it that way, won't all the default rc.xml keybinds using Super + something else open dmenu plus whatever else?

Yes, there will be side effects, if Super-keybindings are not replaced. But if there are two Windows (or Tux or whatever) keys on keyboard, default Openbox W-* key is the left one, and right one is left unused.

True, thanks!


Using the Openbox (3.5.2) session of Lubuntu 14.04 LTS but very interested in BL :)

Offline

Board footer

Powered by FluxBB