diff --git a/docs/spmenu.conf b/docs/spmenu.conf index 5cc40f7..e352c41 100644 --- a/docs/spmenu.conf +++ b/docs/spmenu.conf @@ -296,6 +296,7 @@ spmenu = { fast = 1; // Grab keyboard before matching entries (0/1) type = 1; // Allow typing (0/1) password = 0; // Don't read standard input and replace all characters with the password character (0/1) + width = 0.3; // Width reserved for user input (menu width * ) } ); diff --git a/libs/conf/config.c b/libs/conf/config.c index 698465d..c65ee06 100644 --- a/libs/conf/config.c +++ b/libs/conf/config.c @@ -708,6 +708,7 @@ void conf_init(void) { config_setting_lookup_int(conf, "fast", &fast); // spmenu.input.fast config_setting_lookup_int(conf, "type", &type); // spmenu.input.type config_setting_lookup_int(conf, "password", &passwd); // spmenu.input.password + config_setting_lookup_float(conf, "width", &inputwidth); // spmenu.input.width } } diff --git a/libs/options.h b/libs/options.h index 3511915..dec890b 100644 --- a/libs/options.h +++ b/libs/options.h @@ -9,6 +9,7 @@ static int loadconfig = 1; /* Load configuration (~/.config/spm static int loadtheme = 1; /* Load theme (~/.config/spmenu/theme.conf) on runtime */ static int loadbinds = 1; /* Load keybind file (~/.config/spmenu/binds.conf) on runtime */ static int mon = -1; /* Monitor to run spmenu on */ +static int managed = 0; /* Let your window manager manage spmenu? */ /* Wayland options */ static int scrolldistance = 512; /* Distance to scroll for a scroll action to count */ @@ -25,13 +26,13 @@ static int alpha = 1; /* Enable alpha */ static int menuposition = 2; /* Position of the menu (0: Bottom, 1: Top, 2: Center */ static int menupaddingv = 0; /* Vertical padding inside the menu (px) */ static int menupaddingh = 0; /* Horizontal padding inside the menu (px) */ -static int menuwidth = 0; /* spmenu width */ +static int menuwidth = 0; /* spmenu window width */ static int menumarginv = 0; /* Vertical padding around the menu */ static int menumarginh = 0; /* Horizontal padding around the menu */ static int centerwidth = 1000; /* Width when centered */ +static double inputwidth = 0.3; /* Width reserved for input text, (Menu width * input width) */ static int xpos = 0; /* X position to offset spmenu */ static int ypos = 0; /* Y position to offset spmenu */ -static int managed = 0; /* Let your window manager manage spmenu? */ /* Powerline options */ static int powerlineprompt = 1; /* Enable powerline for the prompt */ diff --git a/spmenu.c b/spmenu.c index d3f7abd..4274e09 100644 --- a/spmenu.c +++ b/spmenu.c @@ -491,7 +491,9 @@ void resizeclient(void) { * items. */ void get_width(void) { - sp.inputw = sp.mw / 3; + sp.inputw = sp.mw * inputwidth; + + fprintf(stderr, "%f\n", inputwidth); } void get_mh(void) {