forked from speedie/spmenu
load configuration optionally
This commit is contained in:
parent
af4c682814
commit
522ea5d50d
|
@ -95,6 +95,9 @@ See a list below for a list.
|
|||
- spmenu -ic - Position the image in the center
|
||||
- spmenu -itc - Position the image in the top center
|
||||
- spmenu -wm - Spawn spmenu as a window manager controlled client
|
||||
- spmenu -nwm - Don't spawn spmenu as a window manager controlled client
|
||||
- spmenu -lcfg - Load spmenu configuration (~/.spmenu or ~/.config/spmenu/spmenurc)
|
||||
- spmenu -ncfg - Don't load spmenu configuration (~/.spmenu or ~/.config/spmenu/spmenurc)
|
||||
- spmenu -v - Print spmenu version to stdout
|
||||
|
||||
- spmenu -fn font - Set the spmenu font to font
|
||||
|
|
|
@ -60,6 +60,8 @@ spmenu.preselected: 0
|
|||
spmenu.type: 1
|
||||
spmenu.class: spmenu
|
||||
spmenu.mon: -1
|
||||
spmenu.managed: 0
|
||||
spmenu.loadconfig: 0
|
||||
spmenu.leftarrow: <
|
||||
spmenu.rightarrow: >
|
||||
spmenu.password: .
|
||||
|
|
14
libs/argv.c
14
libs/argv.c
|
@ -14,6 +14,11 @@ readargs(int argc, char *argv[])
|
|||
}
|
||||
|
||||
if (xresources) {
|
||||
if (loadconfig) {
|
||||
int cxrdb = system("[ -e $HOME/.config/spmenu/spmenurc ] && xrdb -override $HOME/.config/spmenu/spmenurc");
|
||||
int hxrdb = system("[ -e $HOME/.spmenurc ] && xrdb -override $HOME/.spmenurc");
|
||||
}
|
||||
|
||||
load_xresources();
|
||||
}
|
||||
|
||||
|
@ -77,6 +82,12 @@ readargs(int argc, char *argv[])
|
|||
generatecache = 0;
|
||||
} else if (!strcmp(argv[i], "-wm")) { /* display as managed wm window */
|
||||
managed = 1;
|
||||
} else if (!strcmp(argv[i], "-nwm")) { /* don't display as managed wm window */
|
||||
managed = 0;
|
||||
} else if (!strcmp(argv[i], "-lcfg")) { /* load config */
|
||||
loadconfig = 1;
|
||||
} else if (!strcmp(argv[i], "-ncfg")) { /* don't load config */
|
||||
loadconfig = 0;
|
||||
} else if (!strcmp(argv[i], "-na")) { /* disable alpha */
|
||||
alpha = 0;
|
||||
} else if (!strcmp(argv[i], "-a")) { /* alpha */
|
||||
|
@ -355,6 +366,9 @@ usage(void)
|
|||
"spmenu -ic Position the image in the center\n"
|
||||
"spmenu -itc Position the image in the top center\n"
|
||||
"spmenu -wm Spawn spmenu as a window manager controlled client/window. Useful for testing\n"
|
||||
"spmenu -nwm Don't spawn spmenu as a window manager controlled client/window. Useful for testing\n"
|
||||
"spmenu -lcfg Load spmenu configuration (~/.spmenu or ~/.config/spmenu/spmenurc)\n"
|
||||
"spmenu -ncfg Don't load spmenu configuration (~/.spmenu or ~/.config/spmenu/spmenurc)\n"
|
||||
"spmenu -v Print spmenu version to stdout\n"
|
||||
"\n", stdout);
|
||||
fputs("- Appearance arguments -\n"
|
||||
|
|
|
@ -134,6 +134,8 @@ ResourcePref resources[] = {
|
|||
{ "generatecache", INTEGER, &generatecache },
|
||||
{ "mode", INTEGER, &mode },
|
||||
{ "fast", INTEGER, &fast },
|
||||
{ "loadconfig", INTEGER, &loadconfig },
|
||||
{ "managed", INTEGER, &managed },
|
||||
{ "mon", INTEGER, &mon },
|
||||
{ "pango_item", INTEGER, &pango_item },
|
||||
{ "pango_prompt", INTEGER, &pango_prompt },
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
static char class[] = "spmenu"; /* Class for spmenu */
|
||||
static int fast = 0; /* Grab keyboard first */
|
||||
static int xresources = 1; /* Enable .Xresources support */
|
||||
static int loadconfig = 1; /* Load configuration (~/.spmenurc or ~/.config/spmenu/spmenurc) on runtime */
|
||||
static int mon = -1; /* Monitor to run spmenu on */
|
||||
|
||||
/* Window options */
|
||||
|
@ -16,6 +17,7 @@ static int menupaddingv = 0; /* Vertical padding of bar (in pixels) */
|
|||
static int menupaddingh = 0; /* Horizontal padding of bar (in pixels) */
|
||||
static int minwidth = 500; /* Minimum width */
|
||||
static int centered = 0; /* Whether or not to center spmenu by default */
|
||||
static int managed = 0; /* Let your window manager manage spmenu? */
|
||||
|
||||
/* Image options */
|
||||
static int imagewidth = 86; /* Default image width */
|
||||
|
|
9
spmenu.1
9
spmenu.1
|
@ -183,6 +183,15 @@ spmenu -itc - Position the image in the top center
|
|||
.IP \[bu] 2
|
||||
spmenu -wm - Spawn spmenu as a window manager controlled client
|
||||
.IP \[bu] 2
|
||||
spmenu -nwm - Don\[cq]t spawn spmenu as a window manager controlled
|
||||
client
|
||||
.IP \[bu] 2
|
||||
spmenu -lcfg - Load spmenu configuration (\[ti]/.spmenu or
|
||||
\[ti]/.config/spmenu/spmenurc)
|
||||
.IP \[bu] 2
|
||||
spmenu -ncfg - Don\[cq]t load spmenu configuration (\[ti]/.spmenu or
|
||||
\[ti]/.config/spmenu/spmenurc)
|
||||
.IP \[bu] 2
|
||||
spmenu -v - Print spmenu version to stdout
|
||||
.IP \[bu] 2
|
||||
spmenu -fn font - Set the spmenu font to font
|
||||
|
|
Loading…
Reference in a new issue