update config

This commit is contained in:
Ray Andrew 2024-10-13 00:40:12 -05:00
parent 4a7a296450
commit 930ecddadb
2 changed files with 88 additions and 44 deletions

View file

@ -4,32 +4,29 @@
((hex >> 8) & 0xFF) / 255.0f, \
(hex & 0xFF) / 255.0f }
/* appearance */
static const int sloppyfocus = 0; /* focus follows mouse */
static const int sloppyfocus = 1; /* focus follows mouse */
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
static const int smartgaps = 0; /* 1 means no outer gap when there is only one window */
static const int monoclegaps = 1; /* 1 means outer gaps in monocle layout */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int gappih = 10; /* horiz inner gap between windows */
static const unsigned int gappiv = 10; /* vert inner gap between windows */
static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int gappih = 15; /* horiz inner gap between windows */
static const unsigned int gappiv = 15; /* vert inner gap between windows */
static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */
static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */
static const float rootcolor[] = COLOR(0x1e222aff);
static const float bordercolor[] = COLOR(0x282b2cff);
static const float focuscolor[] = COLOR(0xd1b171ff);
static const float urgentcolor[] = COLOR(0xec6b64ff);
static const int showbar = 0; /* 0 means no bar */
static const int topbar = 0; /* 0 means bottom bar */
// static const char *fonts[] = {"monospace:size=10"};
// static const char *fonts[] = { "JetBrainsMono Nerd Font Mono:style:medium:size=14", "Font Awesome 6 Free Regular:size=14", "Iosevka:style:medium:size=14", "monospace:size=14" };
static const char *fonts[] = {
"JetBrainsMonoNL Nerd Font:size=20:antialias=true:autohint=true"
"DejaVu Sans Mono for Powerline:style=Book:size=16",
"JoyPixels:size=16:antialias=true:autohint=true",
"Font Awesome 6 Free,Font Awesome 6 Free Regular:style=Regular:size=16:antialias=true:autohint=true"
};
// static const char *fonts[] = { "JetBrainsMono Nerd Font Mono:style:medium:size=14", "Iosevka:style:medium:size=14", "monospace:size=14" };
static const unsigned int gappov = 5; /* vert outer gap between windows and screen edge */
// gruvbox
// static const float rootcolor[] = COLOR(0x1e222aff);
// static const float bordercolor[] = COLOR(0x282b2cff);
// static const float focuscolor[] = COLOR(0xd1b171ff);
// static const float urgentcolor[] = COLOR(0xec6b64ff);
// gruber
static const float rootcolor[] = COLOR(0x101010ff);
static const float bordercolor[] = COLOR(0x525252ff);
static const float focuscolor[] = COLOR(0x8e8e8eff);
// static const float focuscolor[] = COLOR(0xffdd33ff);
static const float urgentcolor[] = COLOR(0x7c7c7cff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
static const int respect_monitor_reserved_area = 0; /* 1 to monitor center while respecting the monitor's reserved area, 0 to monitor center */
// static const float rootcolor[] = COLOR(0x000000ff);
// static const uint32_t black = 0x1e222aff;
// static const uint32_t white = 0xc7b89dff;
@ -64,9 +61,14 @@ static int log_level = WLR_DEBUG;
/* Autostart */
static const char *const autostart[] = {
"dinit", NULL,
"dbus-update-activation-environment", "DISPLAY", "MOZ_DBUS_REMOTE", "WAYLAND_DISPLAY", "XDG_CURRENT_DESKTOP=wlroots", NULL,
"dinitctl", "setenv", "DISPLAY", "MOZ_DBUS_REMOTE", "WAYLAND_DISPLAY", "XDG_CURRENT_DESKTOP=wlroots", NULL,
"keyd-application-mapper", NULL,
"shikane", NULL,
"pipewire", NULL,
"/usr/lib/pam_kwallet_init", NULL,
"dbus-update-activation-environment", "DISPLAY", "MOZ_DBUS_REMOTE", "WAYLAND_DISPLAY", "XDG_CURRENT_DESKTOP", NULL,
"dinit", "-q", NULL,
// "/home/rayandrew/Code/somebar/build/somebar", NULL,
// "pkexec", "swayosd-libinput-backend", NULL,
"swayosd-server", NULL,
NULL /* terminate */
@ -75,19 +77,23 @@ static const char *const autostart[] = {
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
static const Rule rules[] = {
/* app_id title tags mask isfloating isterm noswallow monitor */
/* app_id title tags mask isfloating isterm noswallow monitor x y width height isnotcenter*/
/* examples: */
{ "Gimp_EXAMPLE", NULL, 0, 1, 0, 0, -1 }, /* Start on currently visible tags floating, not tiled */
{ "firefox_EXAMPLE", NULL, 1 << 8, 0, 0, 0, -1 }, /* Start on ONLY tag "9" */
{ "zoom", NULL, 0, 1, 0, 0, -1 },
{ "teams", NULL, 0, 1, 0, 0, -1 },
{ "wezterm", NULL, 0, 0, 1, 1, -1 }, /* make wezterm swallow clients that are not wezterm */
{ "foot", NULL, 0, 0, 1, 1, -1 }, /* make foot swallow clients that are not foot */
{ "thesaurus-syn", NULL, 0, 1, 1, 1, -1 },
{ "xdg-desktop-portal-gtk", "Open File", 0, 1, 0, 1, -1 },
{ "org.freedesktop.impl.portal.desktop.kde", "Open File", 0, 1, 0, 1, -1 },
{ NULL, "wev", 0, 0, 0, 1, -1 },
{ NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
// { "Gimp_EXAMPLE", NULL, 0, 1, 0, 0, -1, 0, 0, 0, 0 }, /* Start on currently visible tags floating, not tiled */
// { "firefox_EXAMPLE", NULL, 1 << 8, 0, 0, 0, -1, 0, 0, 0, 0 }, /* Start on ONLY tag "9" */
{ "Zoom Workplace", NULL, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0 },
{ "zoom", NULL, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0 },
{ "teams", NULL, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0 },
{ "wezterm", NULL, 0, 0, 1, 1, -1, 0, 0, 0, 0, 0 }, /* make wezterm swallow clients that are not wezterm */
{ "foot", NULL, 0, 0, 1, 1, -1, 0, 0, 0, 0, 0 }, /* make foot swallow clients that are not foot */
{ "footclient", NULL, 0, 0, 1, 1, -1, 0, 0, 0, 0, 0 }, /* make foot swallow clients that are not foot */
{ "kitty", NULL, 0, 0, 1, 1, -1, 0, 0, 0, 0, 0 }, /* make kitty swallow clients that are not kitty */
// { "thesaurus-syn", NULL, 0, 1, 1, 1, -1, 0, 0, 1000, 0.8f, 0 },
{ "thesaurus-syn", NULL, 0, 1, 1, 1, -1, 0, 0, 0, 0, 0 },
{ "xdg-desktop-portal-gtk", "Open File", 0, 1, 0, 1, -1, 0, 0, 0, 0, 0 },
{ "org.freedesktop.impl.portal.desktop.kde", "Open File", 0, 1, 0, 1, -1, 0, 0, 0, 0, 0 },
{ NULL, "wev", 0, 0, 0, 1, -1, 0, 0, 0, 0, 0 },
{ NULL, "Event Tester", 0, 0, 0, 1, -1, 0, 0, 0, 0, 0 }, /* xev */
};
/* layout(s) */
@ -182,6 +188,7 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
/* commands */
// #define TERM_CMD "wezterm", "-e"
#define TERM_CMD "footclient"
// #define TERM_CMD "kitty", "--single-instance"
#define TERM(cmd) { .v = (const char*[]){ TERM_CMD, cmd, NULL } }
static const char *termcmd[] = { TERM_CMD, NULL };
// static const char *menucmd[] = { "wofi", "--show=drun", NULL };
@ -204,8 +211,10 @@ static const char *micdecreasecmd[] = { "swayosd-client", "--input=volu
static const char *micincreasecmd[] = { "swayosd-client", "--input=volume=raise", NULL };
// brightness
static const char *increasebrightnesscmd[] = { "/usr/bin/brightnessctl", "s", "+10%", NULL };
static const char *decreasebrightnesscmd[] = { "/usr/bin/brightnessctl", "s", "10%-", NULL };
// static const char *increasebrightnesscmd[] = { "/usr/bin/brightnessctl", "s", "+10%", NULL };
// static const char *decreasebrightnesscmd[] = { "/usr/bin/brightnessctl", "s", "10%-", NULL };
static const char *increasebrightnesscmd[] = { "swayosd-client", "--brightness=raise", NULL };
static const char *decreasebrightnesscmd[] = { "swayosd-client", "--brightness=lower", NULL };
// media
static const char *mediaplaypausecmd[] = { "/usr/bin/playerctl", "play-pause", NULL };
// static const char *mediaplay[] = { "/usr/bin/playerctl", "play", NULL };
@ -277,7 +286,7 @@ static const Key keys[] = {
TAGKEYS( XKB_KEY_0, XKB_KEY_parenright, 9),
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_bar, quit, {0} },
// { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_R, spawn, KILL_DWL },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, spawn, SHCMD("killall dbus-run-session") },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, spawn, SHCMD("killall dinit") },
// gaps
{ MODKEY, XKB_KEY_minus, incgaps, {.i = -1 } },

43
dwl.c
View file

@ -162,7 +162,7 @@ struct Client {
#endif
unsigned int bw;
uint32_t tags;
int isfloating, isurgent, isfullscreen, isterm, noswallow, isfakefullscreen, issticky;
int isfloating, isurgent, isfullscreen, isterm, noswallow, isfakefullscreen, issticky, isnotcenter;
uint32_t resize; /* configure serial of a pending resize */
pid_t pid;
Client *swallowing, *swallowedby;
@ -270,6 +270,11 @@ typedef struct {
int isterm;
int noswallow;
int monitor;
int x;
int y;
float w;
float h;
int isnotcenter;
} Rule;
typedef struct {
@ -583,6 +588,11 @@ applyrules(Client *c)
int i;
const Rule *r;
Monitor *mon = selmon, *m;
int newwidth;
int newheight;
int newx;
int newy;
int apply_resize = 0;
c->isfloating = client_is_float_type(c);
if (!(appid = client_get_appid(c)))
@ -603,12 +613,23 @@ applyrules(Client *c)
c->isfloating = r->isfloating;
c->isterm = r->isterm;
c->noswallow = r->noswallow;
c->isnotcenter = r->isnotcenter;
newtags |= r->tags;
i = 0;
wl_list_for_each(m, &mons, link) {
if (r->monitor == i++)
mon = m;
}
if (c->isfloating || !mon->lt[mon->sellt]->arrange) {
/* client is floating or in floating layout */
struct wlr_box b = respect_monitor_reserved_area ? mon->w : mon->m;
newwidth = (int)round(r->w ? (r->w <= 1 ? b.width * r->w : r->w) : c->geom.width);
newheight = (int)round(r->h ? (r->h <= 1 ? b.height * r->h : r->h) : c->geom.height);
newx = (int)round(r->x ? (r->x <= 1 ? b.width * r->x + b.x : r->x + b.x) : c->geom.x);
newy = (int)round(r->y ? (r->y <= 1 ? b.height * r->y + b.y : r->y + b.y) : c->geom.y);
apply_resize = 1;
}
}
}
if (!c->noswallow && !client_is_float_type(c)
@ -626,11 +647,19 @@ applyrules(Client *c)
newtags = p->tags;
}
}
if (mon) {
setmon(c, mon, newtags);
if (apply_resize) {
resize(c, (struct wlr_box){
.x = newx,
.y = newy,
.width = newwidth,
.height = newheight,
}, 1);
}
if (mon && c->isfloating && (c->isnotcenter == 0)) {
c->geom.x = (mon->w.width - c->geom.width) / 2 + mon->m.x;
c->geom.y = (mon->w.height - c->geom.height) / 2 + mon->m.y;
}
setmon(c, mon, newtags);
}
void
@ -2698,7 +2727,7 @@ mapnotify(struct wl_listener *listener, void *data)
* try to apply rules for them */
if ((p = client_get_parent(c))) {
c->isfloating = 1;
if (p->mon) {
if (p->mon && c->isfloating && (c->isnotcenter == 0)) {
c->geom.x = (p->mon->w.width - c->geom.width) / 2 + p->mon->m.x;
c->geom.y = (p->mon->w.height - c->geom.height) / 2 + p->mon->m.y;
}
@ -3271,6 +3300,12 @@ run(char *startup_cmd)
wlr_cursor_warp_closest(cursor, NULL, cursor->x, cursor->y);
wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
char* dinit_fd = getenv("DINIT_FD");
if (dinit_fd) {
int dinit_pipefd = atoi(dinit_fd);
write(dinit_pipefd, "READY", 5);
}
/* Run the Wayland event loop. This does not return until you exit the
* compositor. Starting the backend rigged up all of the necessary event
* loop configuration to listen to libinput events, DRM events, generate