XftColor bar_font_color;
struct passwd *pwd;
char *startup_exception;
-unsigned int nr_exceptions = 0;
+unsigned int nr_exceptions = 0;
/* layout manager data */
struct swm_geometry {
void wkill(struct swm_region *, union arg *);
void workaround(void);
void xft_init(struct swm_region *);
-void _add_startup_exception(const char *, va_list);
-void add_startup_exception(const char *, ...);
+void _add_startup_exception(const char *, va_list);
+void add_startup_exception(const char *, ...);
RB_PROTOTYPE(key_tree, key, entry, key_cmp);
RB_GENERATE(key_tree, key, entry, key_cmp);
free(r);
/* Use WM_NAME instead; no UTF-8. */
c = xcb_get_property(conn, 0, win, XCB_ATOM_WM_NAME,
- XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
+ XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
r = xcb_get_property_reply(conn, c, NULL);
if (!r)
}
if (r->length > 0)
name = strndup(xcb_get_property_value(r),
- xcb_get_property_value_length(r));
+ xcb_get_property_value_length(r));
free(r);
}
char which[PATH_MAX];
size_t i;
- /* suppress unused warning since var is needed */
- (void)flags;
-
args = expand_tilde(value);
DNPRINTF(SWM_D_SPAWN, "setconfspawn: [%s] [%s]\n", selector, args);
which[i] = '\0';
break;
}
- if (system(which) != 0)
+ if (flags == 0 && system(which) != 0)
add_startup_exception("could not find %s",
&which[strlen("which ")]);
{
setconfspawn("term", "xterm", 0);
setconfspawn("spawn_term", "xterm", 0);
- setconfspawn("screenshot_all", "screenshot.sh full", 0);
- setconfspawn("screenshot_wind", "screenshot.sh window", 0);
- setconfspawn("lock", "xlock", 0);
- setconfspawn("initscr", "initscreen.sh", 0);
setconfspawn("menu", "dmenu_run"
" -fn $bar_font"
" -nb $bar_color"
" -nf $bar_font_color"
" -sb $bar_border"
" -sf $bar_color", 0);
- setconfspawn("search", "damenu"
+ setconfspawn("search", "dmenu"
" -i"
" -fn $bar_font"
" -nb $bar_color"
" -nf $bar_font_color"
" -sb $bar_border"
" -sf $bar_color", 0);
+
+ /* these are not verified for existence */
+ setconfspawn("lock", "xlock", 1);
+ setconfspawn("screenshot_all", "screenshot.sh full", 1);
+ setconfspawn("screenshot_wind", "screenshot.sh window", 1);
+ setconfspawn("initscr", "initscreen.sh", 1);
}
/* key bindings */
cp += strspn(cp, "= \t\n"); /* eat trailing */
/* get RHS value */
optval = strdup(cp);
+ if (strlen(optval) == 0) {
+ add_startup_exception("%s: line %zd: must supply value "
+ "to %s", filename, lineno,
+ configopt[optidx].optname);
+ goto invalid;
+ }
/* call function to deal with it all */
if (configopt[optidx].func(optsub, optval,
configopt[optidx].funcflags) != 0) {
TAILQ_FOREACH(r, &screens[i].rl, entry)
bar_setup(r);
- if (screens[0].r_focus == NULL) {
- /* Focus on first region. */
- r = TAILQ_FIRST(&screens[0].rl);
- if (r)
- focus_region(r);
- }
+ /* Focus on first region. */
+ r = TAILQ_FIRST(&screens[0].rl);
+ if (r)
+ focus_region(r);
}
stack();