.Pp
Enabling or disabling an option is done by using 1 or 0 respectively.
.Pp
+Colors need to be specified per the
+.Xr XQueryColor 3
+specification.
+.Pp
The file supports the following keywords:
.Bl -tag -width 2m
.It Ic autorun
.It Ic bar_enabled
Enable or disable status bar.
.It Ic bar_font
-Status bar font.
+Font used in the status bar. Either Xft or X Logical Font Description (XLFD) may be used
+to specify the font.
+.Pp
+Example for Xft:
+.Bd -literal -offset indent
+bar_font = Terminus:style=Regular:pixelsize=14:antialias=true
+.Ed
+.Pp
+Example for XLFD:
+.Bd -literal -offset indent
+bar_font = -*-terminus-medium-*-*-*-14-*-*-*-*-*-*-*
+.Ed
+.Pp
+To list the available fonts in your system see
+.Xr fc-list 1
+or
+.Xr xlsfonts 1
+manpages.
+The
+.Xr xfontsel 1
+application can help with the XLFD setting.
+.Pp
.It Ic bar_font_color Ns Bq Ar x
Color of the font in status bar in screen
.Ar x .
.It Ic workspace_limit
Set the total number of workspaces available. Minimum is 1, maximum is 22, default is 10.
.El
-.Pp
-Colors need to be specified per the
-.Xr XQueryColor 3
-specification and fonts need to be specified per the
-.Xr XQueryFont 3
-specification.
-.Pp
-To list the available fonts in your system see
-.Xr fc-list 1
-or
-.Xr xlsfonts 1
-manpages.
-The
-.Xr xfontsel 1
-application can help you to show the X Logical Font Description ("XLFD") used
-as setting in the keyword
-.Pa bar_font .
.Sh PROGRAMS
.Nm
allows you to define custom actions to launch programs of your choice and then
#define SWM_BAR_JUSTIFY_CENTER (1)
#define SWM_BAR_JUSTIFY_RIGHT (2)
#define SWM_BAR_OFFSET (4)
-#define SWM_BAR_FONTS "-*-terminus-medium-*-*-*-*-*-*-*-*-*-*-*," \
- "-*-profont-*-*-*-*-*-*-*-*-*-*-*-*," \
- "-*-times-medium-r-*-*-*-*-*-*-*-*-*-*," \
- "-misc-fixed-medium-r-*-*-*-*-*-*-*-*-*-*," \
- "-*-*-*-r-*--*-*-*-*-*-*-*-*"
+#define SWM_BAR_FONTS "-*-terminus-medium-*-*-*-12-*-*-*-*-*-*-*," \
+ "-*-profont-*-*-*-*-12-*-*-*-*-*-*-*," \
+ "-*-times-medium-r-*-*-12-*-*-*-*-*-*-*," \
+ "-misc-fixed-medium-r-*-*-12-*-*-*-*-*-*-*," \
+ "-*-*-*-r-*-*-*-*-*-*-*-*-*-*"
#ifdef X_HAVE_UTF8_STRING
#define DRAWSTRING(x...) Xutf8DrawString(x)
void propertynotify(xcb_property_notify_event_t *);
void spawn_select(struct swm_region *, union arg *, char *, int *);
void screenchange(xcb_randr_screen_change_notify_event_t *);
+void shutdown_cleanup(void);
void store_float_geom(struct ws_win *, struct swm_region *);
void unmanage_window(struct ws_win *);
void unmapnotify(xcb_unmap_notify_event_t *);
sizeof(rect), &rect);
/* draw back buffer */
-#if 0
- gcv[0] = r->s->c[SWM_S_COLOR_BAR].pixel;
- xcb_change_gc(conn, r->s->bar_gc, XCB_GC_BACKGROUND, gcv);
- gcv[0] = r->s->c[SWM_S_COLOR_BAR_FONT].pixel;
- xcb_change_gc(conn, r->s->bar_gc, XCB_GC_FOREGROUND, gcv);
-#endif
draw = XftDrawCreate(display, r->bar->buffer,
DefaultVisual(display, r->s->idx),
DefaultColormap(display, r->s->idx));
restart(struct swm_region *r, union arg *args)
{
/* suppress unused warning since var is needed */
+ (void)r;
(void)args;
DNPRINTF(SWM_D_MISC, "restart: %s\n", start_argv[0]);
- /* disable alarm because the following code may not be interrupted */
- alarm(0);
- if (signal(SIGALRM, SIG_IGN) == SIG_ERR)
- err(1, "can't disable alarm");
-
- bar_extra_stop();
- bar_extra = 1;
- unmap_all();
-
- if (bar_font_legacy)
- XFreeFontSet(display, bar_fs);
- else {
- XftFontClose(display, bar_font);
- XftColorFree(display, DefaultVisual(display, r->s->idx),
- DefaultColormap(display, r->s->idx), &bar_font_color);
- }
- xcb_key_symbols_free(syms);
- xcb_flush(conn);
- xcb_disconnect(conn);
+ shutdown_cleanup();
execvp(start_argv[0], start_argv);
warn("execvp failed");
struct ws_win *win = NULL;
struct search_window *sw = NULL;
xcb_window_t w;
- uint32_t gcv, wa[2];
+ uint32_t wa[2];
int i, width, height;
char s[8];
FILE *lfile;
XFreeGC(display, l_draw);
} else {
-#if 0
- sw->gc = xcb_generate_id(conn);
- gcv = 0;
- xcb_create_gc(conn, sw->gc, w, XCB_GC_GRAPHICS_EXPOSURES,
- &gcv);
-#endif
draw = XftDrawCreate(display, w,
DefaultVisual(display, r->s->idx),
bar_font->descent, (FcChar8 *)s, len);
XftDrawDestroy(draw);
-/* xcb_free_gc(conn, sw->gc);*/
}
DNPRINTF(SWM_D_MISC, "search_win: mapped window: 0x%x\n", w);
}
}
+void
+shutdown_cleanup(void)
+{
+ int i, num_screens;
+
+ /* disable alarm because the following code may not be interrupted */
+ alarm(0);
+ if (signal(SIGALRM, SIG_IGN) == SIG_ERR)
+ err(1, "can't disable alarm");
+
+ bar_extra_stop();
+ bar_extra = 1;
+ unmap_all();
+
+ teardown_ewmh();
+
+ num_screens = xcb_setup_roots_length(xcb_get_setup(conn));
+ for (i = 0; i < num_screens; ++i) {
+ if (screens[i].bar_gc != 0)
+ xcb_free_gc(conn, screens[i].bar_gc);
+ if (!bar_font_legacy)
+ XftColorFree(display, DefaultVisual(display, i),
+ DefaultColormap(display, i), &bar_font_color);
+ }
+
+ if (bar_font_legacy)
+ XFreeFontSet(display, bar_fs);
+ else {
+ XftFontClose(display, bar_font);
+ }
+
+ xcb_key_symbols_free(syms);
+ xcb_flush(conn);
+ xcb_disconnect(conn);
+}
+
void
event_error(xcb_generic_error_t *e)
{
sact.sa_flags = SA_NOCLDSTOP;
sigaction(SIGCHLD, &sact, NULL);
- if (!X_HAVE_UTF8_STRING)
- warnx("no UTF-8 support");
-
if (!(display = XOpenDisplay(0)))
errx(1, "can not open display");
}
}
done:
- teardown_ewmh();
- bar_extra_stop();
-
- for (i = 0; i < num_screens; ++i)
- if (screens[i].bar_gc != 0)
- xcb_free_gc(conn, screens[i].bar_gc);
-
- if (bar_font_legacy) {
- XFreeFontSet(display, bar_fs);
- } else {
- XftFontClose(display, bar_font);
- XftColorFree(display, DefaultVisual(display, r->s->idx),
- DefaultColormap(display, r->s->idx), &bar_font_color);
- }
- xcb_key_symbols_free(syms);
- xcb_flush(conn);
- xcb_disconnect(conn);
+ shutdown_cleanup();
return (0);
}