few extra barpadding options

This commit is contained in:
speedie 2022-12-18 19:55:01 +01:00
parent 042a547a7d
commit bd7955f105
5 changed files with 61 additions and 56 deletions

View file

@ -4,8 +4,10 @@
speedwm.bar.height: 3 ! Height of the bar in pixels (<num>)
speedwm.bar.position: 1 ! Position of the bar (0: Bottom, 1: Top)
speedwm.bar.paddingh: 10 ! Horizontal padding (extra space) around the bar in pixels (<num>)
speedwm.bar.paddingv: 10 ! Vertical padding (extra space) around the bar in pixels (<num>)
speedwm.bar.paddingoh: 10 ! Horizontal padding (extra space) around the bar in pixels (<num>)
speedwm.bar.paddingov: 10 ! Vertical padding (extra space) around the bar in pixels (<num>)
speedwm.bar.paddingih: 0 ! Horizontal padding (extra space) inside the bar in pixels (<num>)
speedwm.bar.paddingiv: 0 ! Vertical padding (extra space) inside the bar in pixels (<num>)
!! Bar module options
@ -194,19 +196,18 @@ speedwm.gaps.smartgapsize: 0 ! Size of the gaps when only one client
speedwm.icon.size: 10 ! Size of the window icon in the taskbar (<num>)
speedwm.icon.spacing: 5 ! Spacing between icon and text in the taskbar (<num>)
!! Layout options
!!
!! Deck layout
speedwm.layout.deck.count: 0 ! Enable deck count in the deck layout (0/1)
speedwm.layout.deck.format: [%d]
!! Monocle layout
!! Monocle layout
speedwm.layout.monocle.clientcount: 0 ! Enable client count in the monocle layout (0/1)
speedwm.layout.monocle.count: 0 ! Enable focused client and number of total clients in the monocle layout (0/1)
speedwm.layout.monocle.format: [%d/%d]
!! mfact options

View file

@ -78,7 +78,7 @@ static int maxwidth = 600; /* Max menu width */
static int maxheight = 200; /* Max menu height */
/* Misc */
static char shell[] = "/bin/sh"; /* Shell to use */
static char shell[] = "/bin/sh"; /* Shell to use */
static int warpcursor = 1; /* Warp cursor when switching client/monitor */
static int urgentwindows = 1; /* Color urgent tags */
static int pertag = 1; /* Use different mfact and layout for each layout */
@ -97,8 +97,10 @@ static int iconspacing = 5; /* Spacing between the title
/* Bar options */
static int barposition = 1; /* Bar position. Top: 1, Bottom: 0 */
static int barheight = 3; /* Bar height in pixels, 0 = calculate automatically */
static int barpaddingv = 10; /* Vertical bar padding in pixels. */
static int barpaddingh = 10; /* Horizontal bar padding in pixels. */
static int barpaddingov = 10; /* Vertical outer bar padding in pixels. */
static int barpaddingoh = 10; /* Horizontal outer bar padding in pixels. */
static int barpaddingiv = 0; /* Vertical inner bar padding in pixels. */
static int barpaddingih = 5; /* Horizontal inner bar padding in pixels. */
/* Title options */
static int titleposition = 1; /* Title position. (0: Left, 1: Center) */
@ -131,7 +133,7 @@ static int hidefloating = 0; /* Hide floating indicator (1
static int hidesticky = 0; /* Hide sticky indicator (1) or show (0) */
static int hideclientindicator = 0; /* Hide client indicator (1) or show (0) */
/* Layout options
/* Layout options
*
* Monocle layout */
static int monocleclientcount = 0; /* Display client count in the Monocle layout */

View file

@ -1,7 +1,7 @@
/* Signal definitions
* Signum must be greater than 0
* Trigger signals using `speedwm-utils -exec <signum>"`
*
* Trigger signals using `speedwm-utils -exec <signum>"`
*
* Once you're done with your edits, run 'make clean install'. */
static Signal signals[] = {
/* signum function argument */
@ -24,7 +24,7 @@ static Signal signals[] = {
{ 17, cyclelayout, {.i = -1 } },
{ 18, setmfact, {.f = +0.05} },
{ 19, setmfact, {.f = -0.05} },
{ 20, togglesticky, {0} },
{ 20, togglesticky, {0} },
{ 21, togglebar, {0} },
{ 22, togglefullscr, {0} },
{ 23, togglefloating, {0} },
@ -102,17 +102,17 @@ static Signal signals[] = {
{ 87, setbarheight, {.i = +1 } },
{ 88, setbarheight, {.i = -1 } },
{ 89, resetbarheight, {0} },
{ 90, setbarpaddingv, {.i = +1 } },
{ 91, setbarpaddingv, {.i = -1 } },
{ 92, setbarpaddingh, {.i = +1 } },
{ 93, setbarpaddingh, {.i = -1 } },
{ 90, setbarpaddingov, {.i = +1 } },
{ 91, setbarpaddingov, {.i = -1 } },
{ 92, setbarpaddingoh, {.i = +1 } },
{ 93, setbarpaddingoh, {.i = -1 } },
{ 94, setbarpadding, {.i = +1 } },
{ 95, setbarpadding, {.i = -1 } },
{ 96, togglebarpaddingv, {0} },
{ 97, togglebarpaddingh, {0} },
{ 96, togglebarpaddingov, {0} },
{ 97, togglebarpaddingoh, {0} },
{ 98, togglebarpadding, {0} },
{ 99, resetbarpaddingv, {0} },
{ 100, resetbarpaddingh, {0} },
{ 99, resetbarpaddingov, {0} },
{ 100, resetbarpaddingoh, {0} },
{ 101, resetbarpadding, {0} },
{ 102, incstackcount, {.i = +1 } },
{ 103, incstackcount, {.i = -1 } },

View file

@ -688,14 +688,14 @@ static void setbpgaps(const Arg *arg);
static void resetbpgaps(const Arg *arg);
/* barpadding */
static void setbarpaddingv(const Arg *arg);
static void setbarpaddingh(const Arg *arg);
static void setbarpaddingov(const Arg *arg);
static void setbarpaddingoh(const Arg *arg);
static void setbarpadding(const Arg *arg);
static void resetbarpaddingv(const Arg *arg);
static void resetbarpaddingh(const Arg *arg);
static void resetbarpaddingov(const Arg *arg);
static void resetbarpaddingoh(const Arg *arg);
static void resetbarpadding(const Arg *arg);
static void togglebarpaddingv(const Arg *arg);
static void togglebarpaddingh(const Arg *arg);
static void togglebarpaddingov(const Arg *arg);
static void togglebarpaddingoh(const Arg *arg);
static void togglebarpadding(const Arg *arg);
/* mouse */
@ -3031,15 +3031,15 @@ showhide(Client *c)
void
resetbarpadding(const Arg *arg)
{
resetbarpaddingv(NULL);
resetbarpaddingh(NULL);
resetbarpaddingov(NULL);
resetbarpaddingoh(NULL);
}
void
resetbarpaddingv(const Arg *arg)
resetbarpaddingov(const Arg *arg)
{
Bar *bar;
vp = (barposition == 1) ? barpaddingv : - barpaddingv;
vp = (barposition == 1) ? barpaddingov : - barpaddingov;
updatebarpos(selmon);
for (bar = selmon->bar; bar; bar = bar->next)
@ -3049,10 +3049,10 @@ resetbarpaddingv(const Arg *arg)
}
void
resetbarpaddingh(const Arg *arg)
resetbarpaddingoh(const Arg *arg)
{
Bar *bar;
sp = barpaddingh;
sp = barpaddingoh;
updatebarpos(selmon);
for (bar = selmon->bar; bar; bar = bar->next)
@ -3063,12 +3063,12 @@ resetbarpaddingh(const Arg *arg)
void
togglebarpadding(const Arg *arg)
{
togglebarpaddingv(arg);
togglebarpaddingh(arg);
togglebarpaddingov(arg);
togglebarpaddingoh(arg);
}
void
togglebarpaddingv(const Arg *arg)
togglebarpaddingov(const Arg *arg)
{
Bar *bar;
/* if its more than 1, disable padding, else enable padding */
@ -3088,7 +3088,7 @@ togglebarpaddingv(const Arg *arg)
}
void
togglebarpaddingh(const Arg *arg)
togglebarpaddingoh(const Arg *arg)
{
Bar *bar;
/* if its more than 1, disable padding, else enable padding */
@ -3109,12 +3109,12 @@ togglebarpaddingh(const Arg *arg)
void
setbarpadding(const Arg *arg)
{
setbarpaddingv(arg);
setbarpaddingh(arg);
setbarpaddingov(arg);
setbarpaddingoh(arg);
}
void
setbarpaddingv(const Arg *arg)
setbarpaddingov(const Arg *arg)
{
Bar *bar;
@ -3140,7 +3140,7 @@ setbarpaddingv(const Arg *arg)
}
void
setbarpaddingh(const Arg *arg)
setbarpaddingoh(const Arg *arg)
{
Bar *bar;
@ -3173,7 +3173,7 @@ setbarheight(const Arg *arg)
Bar *bar;
if (bh < drw->font->h)
bh = drw->font->h;
bh = drw->font->h + barpaddingiv;
updatebarpos(selmon);
for (bar = selmon->bar; bar; bar = bar->next)
@ -3185,8 +3185,8 @@ setbarheight(const Arg *arg)
void
setbpgaps(const Arg *arg)
{
setbarpaddingv(arg);
setbarpaddingh(arg);
setbarpaddingov(arg);
setbarpaddingoh(arg);
incrgaps(arg);
updatebarpos(selmon);
@ -3197,15 +3197,15 @@ setbpgaps(const Arg *arg)
void
resetbpgaps(const Arg *arg)
{
resetbarpaddingh(arg);
resetbarpaddingv(arg);
resetbarpaddingoh(arg);
resetbarpaddingov(arg);
defaultgaps(arg);
}
void
resetbarheight(const Arg *arg)
{
bh = drw->font->h + barheight;
bh = drw->font->h + barheight + barpaddingiv;
Bar *bar;
updatebarpos(selmon);
@ -5147,12 +5147,12 @@ setup(void)
drw = drw_create(dpy, screen, root, tw, sh, visual, depth, cmap);
if (!drw_font_create(drw, font))
die("no fonts could be loaded.");
lrpad = drw->font->h;
bh = drw->font->h + barheight;
lrpad = drw->font->h + barpaddingih;
bh = drw->font->h + barheight + barpaddingiv;
/* barpadding */
sp = barpaddingh;
vp = (barposition == 1) ? barpaddingv : - barpaddingv;
sp = barpaddingoh;
vp = (barposition == 1) ? barpaddingov : - barpaddingov;
updategeom();

View file

@ -4,8 +4,8 @@
*
* These are also used by the speedwmrc file in ~/.config/speedwm-de.
* When you're done with your edits, run 'make clean install'.
*
* Value in .Xresources Type Value internally */
*
* Value in .Xresources Type Value internally */
ResourcePref resources[] = {
{ "fonts.font", STRING, &font },
{ "col.background", STRING, &col_background },
@ -102,7 +102,7 @@ ResourcePref resources[] = {
{ "fullscreen.movefullscreenmon",INTEGER, &movefullscreenmon },
{ "fullscreen.hidebar", INTEGER, &fullscreenhidebar },
{ "rule.refresh", INTEGER, &refreshrules },
{ "border.size", INTEGER, &bordersize },
{ "border.size", INTEGER, &bordersize },
{ "stack.snap", INTEGER, &snap },
{ "bar.hide", INTEGER, &hidebar },
{ "stack.mastercount", INTEGER, &mastercount },
@ -113,8 +113,10 @@ ResourcePref resources[] = {
{ "client.swallow", INTEGER, &swallowclients },
{ "client.swallowfloating", INTEGER, &swallowfloating },
{ "bar.height", INTEGER, &barheight },
{ "bar.paddingv", INTEGER, &barpaddingv },
{ "bar.paddingh", INTEGER, &barpaddingh },
{ "bar.paddingov", INTEGER, &barpaddingov },
{ "bar.paddingoh", INTEGER, &barpaddingoh },
{ "bar.paddingiv", INTEGER, &barpaddingiv },
{ "bar.paddingih", INTEGER, &barpaddingih },
{ "stack.centerfloating", INTEGER, &centerfloating },
{ "client.savefloat", INTEGER, &savefloat },
{ "cursor.warp", INTEGER, &warpcursor },