phillbush / xmenu

a x11 menu utility
Other
296 stars 26 forks source link

dmenu style argument parser #10

Closed p4p1 closed 4 years ago

p4p1 commented 4 years ago

dmenu argment parser for styling

I added a dmenu style argument parser to change the font, the color of background and foreground during selection and in normal mode. Edited the usage and man page accordingly. I also kept the same error messages as getopt and keeps the title logic at the end if needed.

Example

./xmenu -fn "Hack Nerd Font:size=13:" -nb "#393939" -nf "#bbbbbb" -sb "#50fa7b" -sf "#393939" -bc "#393939"

screenshot

Usage

phillbush commented 4 years ago

You can already change the colors at runtime via X resources.

I think that specifying colors via X resources is better than specifying it via command-line options because you don't need to call xmenu with the same options all the time or create an alias, just put the colors at ~/.Xresources and you're done: every xmenu call will have the same colors scheme.

I separate appearance configuration from behavior configuration in my programs this way: appearance goes to ~/.Xresources and behavior goes as command-line options during invocation.

I'm gonna see if setting colors at invocation is a feature that other users want. If it is, I'll merge the pull request, otherwise I'll keep with the X resources way.