From be13a65ff566b7794573fb24ee1dc190f83803df Mon Sep 17 00:00:00 2001 From: speedie Date: Mon, 1 May 2023 18:01:47 +0200 Subject: [PATCH] some improvements, dmenu.conf is now theme.conf compatible --- libs/arg.c | 2 +- themes/dmenu.conf | 20 ++++---------------- themes/sample.theme | 7 +++++-- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/libs/arg.c b/libs/arg.c index 3175d4e..b18f681 100644 --- a/libs/arg.c +++ b/libs/arg.c @@ -518,7 +518,7 @@ togglehighlight(Arg *arg) void setprofile(Arg *arg) { - if (!system("spmenu_profile --spmenu-set-profile")) + if (!system("command -v spmenu_profile > /dev/null && spmenu_profile --spmenu-set-profile")) die("spmenu: failed to run profile menu\n"); else exit(0); diff --git a/themes/dmenu.conf b/themes/dmenu.conf index 4ee47fa..e3d5edb 100644 --- a/themes/dmenu.conf +++ b/themes/dmenu.conf @@ -1,12 +1,12 @@ /* spmenu dmenu theme * - * This config should match vanilla dmenu as closely as possible. I am unable to tell the difference between the two. It should be noted though that SGR sequences are still displayed, so for this reason I've set them all to white. - * - * Also note that this config disables .Xresources, Pango and SGR sequence support, you can reenable it below if you want. + * This config should match vanilla dmenu as closely as possible. I am unable to tell the difference between the two. Note that neither Pango markup or SGR sequences are interpreted and they will be displayed as-is. You can change this if you want. * For perfect dmenu compatibility, you may want to remap keybindings, making sure all of them work in "any mode". + * + * To use, simply copy to ~/.config/spmenu/theme.conf */ -spmenu = { +theme = { // General window options window = ( { alpha = 0; } ); @@ -125,18 +125,6 @@ spmenu = { image = 1; } ); - // Match options - match = ( { sort = 1; - casesensitive = 1; - fuzzy = 0; - } ); - - // Xrdb - // .Xresources is disabled by default - xrdb = ( { xresources = 0; - global = 0; - } ); - // Pango pango = ( { item = 0; highlight = 0; diff --git a/themes/sample.theme b/themes/sample.theme index 221b736..230de19 100644 --- a/themes/sample.theme +++ b/themes/sample.theme @@ -1,7 +1,10 @@ /* This is a sample theme. * It simply sets the font to Terminus. * - * You can include this from your spmenu.conf using `@include "path/to/sample.theme`. Put it inside `text = ();` + * Simply copy this to ~/.config/spmenu/theme.conf to apply. */ -font = "Terminus 8"; +theme = { + text = ( { font = "Terminus 8"; + } ); +};