diff --git a/autostart.h b/autostart.h index 314a599..35f1d8d 100644 --- a/autostart.h +++ b/autostart.h @@ -11,10 +11,6 @@ * Once you're done with your edits, run 'make clean install'. *************************************************************/ -#define STATUSBAR status -#define ICONSIZE sizeicon -#define ICONSPACING spacingicon - static const char *const autostart[] = { /* Autostart script, if it exists */ @@ -41,7 +37,7 @@ static const char *const autostart[] = { shell, "-c", NOTIFICATION "&", NULL, /* Run the status bar defined */ - shell, "-c", STATUSBAR, NULL, + shell, "-c", status, NULL, NULL }; diff --git a/docs/example.Xresources b/docs/example.Xresources index 0e89b47..b862da7 100644 --- a/docs/example.Xresources +++ b/docs/example.Xresources @@ -62,8 +62,8 @@ - speedwm.gappov: 10 - speedwm.attachdirection: 3 - speedwm.shell: /bin/sh - - speedwm.sizeicon: 10 - - speedwm.spacingicon: 5 + - speedwm.iconsize: 10 + - speedwm.iconspacing: 5 - speedwm.status: status - speedwm.defaultname: - speedwm.refreshrules: 1 diff --git a/options.h b/options.h index c83c000..107a9bf 100644 --- a/options.h +++ b/options.h @@ -203,8 +203,8 @@ static int lockfullscreen = 1; /* Window icon options */ #if USEWINICON -static int sizeicon = 10; /* size of the icon */ -static int spacingicon = 5; /* spacing between the title and icon */ +static int iconsize = 10; /* size of the icon */ +static int iconspacing = 5; /* spacing between the title and icon */ #endif /* Bar options */ diff --git a/speedwm.c b/speedwm.c index 1310647..eaacece 100644 --- a/speedwm.c +++ b/speedwm.c @@ -1911,7 +1911,7 @@ drawbar(Monitor *m) drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0); } else { #if USEWINICON - drw_text(drw, x, 0, tabw, bh, lrpad / 2 + (c->icon ? c->icw + ICONSPACING : 0), c->name, 0); + drw_text(drw, x, 0, tabw, bh, lrpad / 2 + (c->icon ? c->icw + iconspacing : 0), c->name, 0); if (c->icon) drw_pic(drw, x + lrpad / 2, (bh - c->ich) / 2, c->icw, c->ich, c->icon); #else drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0); @@ -2178,13 +2178,13 @@ geticonprop(Window win, unsigned int *picw, unsigned int *pich) for (i = p; i < end - 1; i += sz) { if ((w = *i++) >= 16384 || (h = *i++) >= 16384) { XFree(p); return None; } if ((sz = w * h) > end - i) break; - if ((m = w > h ? w : h) >= ICONSIZE && (d = m - ICONSIZE) < bstd) { bstd = d; bstp = i; } + if ((m = w > h ? w : h) >= iconsize && (d = m - iconsize) < bstd) { bstd = d; bstp = i; } } if (!bstp) { for (i = p; i < end - 1; i += sz) { if ((w = *i++) >= 16384 || (h = *i++) >= 16384) { XFree(p); return None; } if ((sz = w * h) > end - i) break; - if ((d = ICONSIZE - (w > h ? w : h)) < bstd) { bstd = d; bstp = i; } + if ((d = iconsize - (w > h ? w : h)) < bstd) { bstd = d; bstp = i; } } } if (!bstp) { XFree(p); return None; } @@ -2194,11 +2194,11 @@ geticonprop(Window win, unsigned int *picw, unsigned int *pich) uint32_t icw, ich; if (w <= h) { - ich = ICONSIZE; icw = w * ICONSIZE / h; + ich = iconsize; icw = w * iconsize / h; if (icw == 0) icw = 1; } else { - icw = ICONSIZE; ich = h * ICONSIZE / w; + icw = iconsize; ich = h * iconsize / w; if (ich == 0) ich = 1; } *picw = icw; *pich = ich; diff --git a/xresources.h b/xresources.h index 66d154c..174a99c 100644 --- a/xresources.h +++ b/xresources.h @@ -131,7 +131,8 @@ ResourcePref resources[] = { { "resizehints", INTEGER, &resizehints }, { "startontag", INTEGER, &startontag }, #if USEWINICON - { "sizeicon", INTEGER, &sizeicon }, + { "iconsize", INTEGER, &iconsize }, + { "iconspacing", INTEGER, &iconspacing }, #endif { "decorhints", INTEGER, &decorhints }, { "swallowclients", INTEGER, &swallowclients },