aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-05-22 13:01:36 +0530
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-05-22 14:01:19 +0530
commita74fcc1ad0764ff6de1043e15d2444a7f954082d (patch)
tree0aa932c715ff3428ddfb316aeb1e52618212576c
parent83c004cd19eead9219f792b7e9782a3c9b63f466 (diff)
downloaddwm-a74fcc1ad0764ff6de1043e15d2444a7f954082d.tar.gz
dwm-a74fcc1ad0764ff6de1043e15d2444a7f954082d.tar.bz2
dwm-a74fcc1ad0764ff6de1043e15d2444a7f954082d.zip
Adjust config.h to use new pertag gaps
-rw-r--r--config.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/config.h b/config.h
index 543715b..e329637 100644
--- a/config.h
+++ b/config.h
@@ -6,13 +6,12 @@
#define STATUSBAR "dwmblocks"
/* appearance */
-static const unsigned int borderpx = 0; /* border pixel of windows */
-static const unsigned int snap = 32; /* snap pixel */
-static const unsigned int gappx = 0; /* default gaps between windows */
-static const unsigned int opengap = 20; /* optional gaps between windows */
-static unsigned int togglegap = true;
-static const int showbar = true; /* 0 means no bar */
-static const int topbar = 0; /* 0 means bottom bar */
+static const unsigned int borderpx = 0; /* border pixel of windows */
+static const unsigned int snap = 32; /* snap pixel */
+static const unsigned int opengap = 20; /* optional gaps between windows */
+static const unsigned int gappx = 0; /* default gaps between windows */
+static const int showbar = true; /* 0 means no bar */
+static const int topbar = 0; /* 0 means bottom bar */
static const char *fonts[] = { "Noto Sans Mono:size=13" };
static const char dmenufont[] = "monospace:size=9";
static const char col_black[] = "#161616";
@@ -169,15 +168,12 @@ togglegaps(const Arg *arg)
{
if (!selmon)
return;
- if (togglegap)
- selmon->gappx = opengap;
+ int *gap_size = &selmon->pertag->gaps[selmon->pertag->curtag];
+ if (*gap_size == gappx)
+ selmon->pertag->gaps[selmon->pertag->curtag] = opengap;
else
- selmon->gappx = gappx;
+ selmon->pertag->gaps[selmon->pertag->curtag] = gappx;
arrange(selmon);
- system(togglegap
- ? "notify-send -u low \"Gaps on\""
- : "notify-send -u low \"Gaps off\"");
- togglegap = !togglegap;
}
void
@@ -186,7 +182,8 @@ printgaps(const Arg *arg)
if (!selmon)
return;
char *cmd = malloc(sizeof(*cmd) * 38);
- sprintf(cmd, "notify-send -u low \"Gaps=%d\"", selmon->gappx);
+ sprintf(cmd, "notify-send -u low \"Gaps=%d\"",
+ selmon->pertag->gaps[selmon->pertag->curtag]);
system(cmd);
free(cmd);
}