diff --git a/.config/suckless/dwm/bar.c b/.config/suckless/dwm/bar.c deleted file mode 100644 index 4ea8669..0000000 --- a/.config/suckless/dwm/bar.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "bar.h" -#include - -const char* vol() { - static char buf[5]; - float v; - FILE *fp = popen("wpctl get-volume @DEFAULT_AUDIO_SINK@", "r"); - if (!fp || fscanf(fp, "Volume: %f", &v) != 1) return NULL; - pclose(fp); - snprintf(buf, sizeof(buf), "%d%%", (int)(v * 100)); - return buf; -} - -const char* age() { - static char buf[5]; - int days; - FILE *fp = popen("sh -c 'echo $(( ( $(date +%s) - $(stat -c %W /) ) / 86400 ))'", "r"); - if (!fp || fscanf(fp, "%d", &days) != 1) return NULL; - pclose(fp); - snprintf(buf, sizeof(buf), "%dd", days); - return buf; -} - -void execute_bar(char *out, size_t len) { - snprintf(out, len, " V: %s A: %s ", vol(), age()); -} diff --git a/.config/suckless/dwm/config.h b/.config/suckless/dwm/config.h index 25fa7af..337720b 100644 --- a/.config/suckless/dwm/config.h +++ b/.config/suckless/dwm/config.h @@ -1,17 +1,13 @@ -static const unsigned int borderpx = 2; -static const unsigned int gappx = 3; +static const unsigned int borderpx = 0; +static const unsigned int gappx = 10; static const int showbar = 0; static const int topbar = 0; static const char *fonts[] = { "Cascadia Mono:style=Bold:size=10:antialias=true:autohint=true" }; -static const char *colors[][3] = { - [SchemeNorm] = { "#D3C6AA", "#272E33", "#83C092" }, - [SchemeSel] = { "#374145", "#DBBC7F", "#A7C080" }, -}; static const char *tags[] = { "1", "2", "3" }; static const Rule rules[] = { - { "ghostty", NULL, NULL, 1, 0, -1 }, + { "ghostty", NULL, NULL, 1, 0, -1 }, { "librewolf", NULL, NULL, 1 << 1, 0, -1 }, { "steam", NULL, NULL, 1 << 2, 0, -1 }, }; @@ -35,15 +31,12 @@ static const Layout layouts[] = { #include "X11/XF86keysym.h" static const Key keys[] = { + { MODKEY, XK_h, focusstack, {.i = +1 } }, + { MODKEY, XK_l, focusstack, {.i = -1 } }, + { MODKEY, XK_q, killclient, {0} }, { MODKEY, XK_Return, spawn, SHCMD("ghostty -e tmux a") }, { MODKEY, XK_f, spawn, SHCMD("librewolf") }, { MODKEY|ShiftMask, XK_s, spawn, SHCMD("steam") }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY, XK_q, killclient, {0} }, - { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pactl set-sink-volume @DEFAULT_SINK@ +5%") }, { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pactl set-sink-volume @DEFAULT_SINK@ -5%") }, diff --git a/.config/suckless/dwm/dwm.c b/.config/suckless/dwm/dwm.c index 73918f2..398506d 100644 --- a/.config/suckless/dwm/dwm.c +++ b/.config/suckless/dwm/dwm.c @@ -160,7 +160,6 @@ static int sendevent(Client *c, Atom proto); static void setclientstate(Client *c, long state); static void setfocus(Client *c); static void setfullscreen(Client *c, int fullscreen); -static void setmfact(const Arg *arg); static void setup(void); static void seturgent(Client *c, int urg); static void showhide(Client *c); @@ -384,8 +383,8 @@ cleanup(void) cleanupmon(mons); for (i = 0; i < CurLast; i++) drw_cur_free(drw, cursor[i]); - for (i = 0; i < LENGTH(colors); i++) - free(scheme[i]); + // for (i = 0; i < LENGTH(colors); i++) + // free(scheme[i]); free(scheme); XDestroyWindow(dpy, wmcheckwin); drw_free(drw); @@ -594,7 +593,6 @@ drawbar(Monitor *m) return; /* draw status first so it can be overdrawn by tags later */ if (m == selmon) { /* status is only drawn on selected monitor */ - execute_bar(stext, sizeof(stext)); drw_setscheme(drw, scheme[SchemeNorm]); tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0); @@ -1175,25 +1173,10 @@ setfullscreen(Client *c, int fullscreen) } } -/* arg > 1.0 will set mfact absolutely */ -void -setmfact(const Arg *arg) -{ - float f; - - if (!arg || !selmon->lt[selmon->sellt]->arrange) - return; - f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - if (f < 0.05 || f > 0.95) - return; - selmon->mfact = f; - arrange(selmon); -} - void setup(void) { - int i; + // int i; XSetWindowAttributes wa; Atom utf8string; struct sigaction sa; @@ -1238,9 +1221,9 @@ setup(void) cursor[CurResize] = drw_cur_create(drw, XC_sizing); cursor[CurMove] = drw_cur_create(drw, XC_fleur); /* init appearance */ - scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); - for (i = 0; i < LENGTH(colors); i++) - scheme[i] = drw_scm_create(drw, colors[i], 3); + // scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); + // for (i = 0; i < LENGTH(colors); i++) + // scheme[i] = drw_scm_create(drw, colors[i], 3); /* init bars */ updatebars(); updatestatus(); diff --git a/.config/suckless/dwm/util.c b/.config/suckless/dwm/util.c index 7eacff1..adbdbd8 100644 --- a/.config/suckless/dwm/util.c +++ b/.config/suckless/dwm/util.c @@ -4,30 +4,6 @@ #include #include "util.h" -const char* vol() { - static char buf[5]; - float v; - FILE *fp = popen("wpctl get-volume @DEFAULT_AUDIO_SINK@", "r"); - if (!fp || fscanf(fp, "Volume: %f", &v) != 1) return NULL; - pclose(fp); - snprintf(buf, sizeof(buf), "%d%%", (int)(v * 100)); - return buf; -} - -const char* age() { - static char buf[5]; - int days; - FILE *fp = popen("sh -c 'echo $(( ( $(date +%s) - $(stat -c %W /) ) / 86400 ))'", "r"); - if (!fp || fscanf(fp, "%d", &days) != 1) return NULL; - pclose(fp); - snprintf(buf, sizeof(buf), "%dd", days); - return buf; -} - -void execute_bar(char *out, size_t len) { - snprintf(out, len, " V: %s A: %s ", vol(), age()); -} - void die(const char *fmt, ...) { va_list ap; @@ -43,7 +19,7 @@ void die(const char *fmt, ...) { exit(1); } -void * ecalloc(size_t nmemb, size_t size) { +void *ecalloc(size_t nmemb, size_t size) { void *p; if (!(p = calloc(nmemb, size))) die("calloc:"); return p; diff --git a/.config/suckless/dwm/util.h b/.config/suckless/dwm/util.h index f8c94a0..1e5f789 100644 --- a/.config/suckless/dwm/util.h +++ b/.config/suckless/dwm/util.h @@ -5,4 +5,3 @@ void die(const char *fmt, ...); void *ecalloc(size_t nmemb, size_t size); -void execute_bar(char *out, size_t len);