removing random things

This commit is contained in:
DarthMooMancer
2025-09-13 16:08:54 -04:00
parent fcf720918c
commit 49b15611ee
2 changed files with 19 additions and 45 deletions
+16 -16
View File
@@ -1,9 +1,19 @@
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
#define MODKEY Mod1Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
#include "X11/XF86keysym.h"
static const unsigned int borderpx = 2; static const unsigned int borderpx = 2;
static const unsigned int gappx = 5; static const unsigned int gappx = 5;
static const int showbar = 1; static const int showbar = 1;
static const int topbar = 1; static const int topbar = 1;
static const char *fonts[] = { "CaskaydiaCove NFM style:SemiBold:size=11" }; static const char *fonts[] = { "Cascadia Mono:style:Medium:size=10:antialias=true:autohint=true" };
static const char *colors[][3] = { static const char *colors[][3] = {
[SchemeNorm] = { "#D3C6AA", "#272E33", "#83C092" }, [SchemeNorm] = { "#D3C6AA", "#272E33", "#83C092" },
[SchemeSel] = { "#374145", "#DBBC7F", "#A7C080" }, [SchemeSel] = { "#374145", "#DBBC7F", "#A7C080" },
@@ -11,10 +21,10 @@ static const char *colors[][3] = {
static const char *tags[] = { "1", "2", "3" }; static const char *tags[] = { "1", "2", "3" };
static const Rule rules[] = { static const Rule rules[] = {
{ "st-256color", "st-256color", NULL, 1, 0 }, { "st-256color", 1 },
{ "librewolf", "Navigator", NULL, 1 << 1, 0 }, { "librewolf", 1 << 1 },
{ "PrismLauncher", "prismlauncher", NULL, 1 << 2, 0 }, { "PrismLauncher", 1 << 2 },
{ "steam", "steamwebhelper", NULL, 1 << 2, 0 }, { "steam", 1 << 2 },
}; };
static const float mfact = 0.55; static const float mfact = 0.55;
@@ -23,19 +33,9 @@ static const int resizehints = 1;
static const int lockfullscreen = 1; static const int lockfullscreen = 1;
static const Layout layouts[] = { static const Layout layouts[] = {
{ "L: Tile", tile }, { "T", tile },
}; };
#define MODKEY Mod1Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
#include "X11/XF86keysym.h"
static const Key keys[] = { static const Key keys[] = {
{ MODKEY, XK_Return, spawn, SHCMD("st") }, { MODKEY, XK_Return, spawn, SHCMD("st") },
{ MODKEY, XK_space, spawn, SHCMD("dmenu_run") }, { MODKEY, XK_space, spawn, SHCMD("dmenu_run") },
+3 -29
View File
@@ -104,10 +104,7 @@ struct Monitor {
typedef struct { typedef struct {
const char *class; const char *class;
const char *instance;
const char *title;
unsigned int tags; unsigned int tags;
int isfloating;
} Rule; } Rule;
/* function declarations */ /* function declarations */
@@ -165,7 +162,6 @@ static void showhide(Client *c);
static void spawn(const Arg *arg); static void spawn(const Arg *arg);
static void tag(const Arg *arg); static void tag(const Arg *arg);
static void tile(Monitor *m); static void tile(Monitor *m);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg); static void toggleview(const Arg *arg);
static void unfocus(Client *c, int setfocus); static void unfocus(Client *c, int setfocus);
static void unmanage(Client *c, int destroyed); static void unmanage(Client *c, int destroyed);
@@ -225,25 +221,18 @@ struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
/* function implementations */ /* function implementations */
void applyrules(Client *c) { void applyrules(Client *c) {
const char *class, *instance; const char *class;
unsigned int i;
const Rule *r; const Rule *r;
XClassHint ch = { NULL, NULL }; XClassHint ch = { NULL, NULL };
/* rule matching */ /* rule matching */
c->isfloating = 0;
c->tags = 0; c->tags = 0;
XGetClassHint(dpy, c->win, &ch); XGetClassHint(dpy, c->win, &ch);
class = ch.res_class ? ch.res_class : broken; class = ch.res_class ? ch.res_class : broken;
instance = ch.res_name ? ch.res_name : broken;
for (i = 0; i < LENGTH(rules); i++) { for (unsigned int i = 0; i < LENGTH(rules); i++) {
r = &rules[i]; r = &rules[i];
if ((!r->title || strstr(c->name, r->title)) if (!r->class || strstr(class, r->class)) {
&& (!r->class || strstr(class, r->class))
&& (!r->instance || strstr(instance, r->instance)))
{
c->isfloating = r->isfloating;
c->tags |= r->tags; c->tags |= r->tags;
} }
} }
@@ -1251,23 +1240,8 @@ void tile(Monitor *m) {
} }
} }
void toggletag(const Arg *arg) {
unsigned int newtags;
if (!selmon->sel)
return;
newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
if (newtags) {
selmon->sel->tags = newtags;
focus(NULL);
arrange(selmon);
}
}
void toggleview(const Arg *arg) { void toggleview(const Arg *arg) {
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
if (newtagset) { if (newtagset) {
selmon->tagset[selmon->seltags] = newtagset; selmon->tagset[selmon->seltags] = newtagset;
focus(NULL); focus(NULL);