Skip to content

Commit

Permalink
Updated setupcfgdefault() settings (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerjenigeUberMensch authored May 19, 2024
1 parent acf82d6 commit 24ccc17
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions dwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3075,6 +3075,7 @@ setupcfg(void)
void
setupcfgdefaults(void)
{
UserSettings *s = &_cfg;
const u16 nmaster = 1;
const u8 hoverfocus = 0; /* bool */
const u8 desktoplayout = Monocle;
Expand All @@ -3085,17 +3086,25 @@ setupcfgdefaults(void)
const u16 winsnap = 10;
const u16 maxcc = 256;
const float mfact = 0.55f;

USSetMCount(&_cfg, nmaster);
USSetLayout(&_cfg, desktoplayout);
USSetOLayout(&_cfg, odesktoplayout);
USSetDefaultDesk(&_cfg, defaultdesktop);
USSetHoverFocus(&_cfg, hoverfocus);
USSetRefreshRate(&_cfg, refreshrate);
USSetGapWidth(&_cfg, bgw);
USSetSnap(&_cfg, winsnap);
USSetMaxClientCount(&_cfg, maxcc);
USSetMFact(&_cfg, mfact);
const u16 bw = _wm.selmon->ww;
const u16 bh = _wm.selmon->wh / 10; /* div 10 is roughly the same as the WSWM old default bar height */
const i16 bx = _wm.selmon->wx;
const i16 by = _wm.selmon->wy + bh; /* because a window is a rectangle calculations start at the top left corner, so we need to add the height */

USSetMCount(s, nmaster);
USSetLayout(s, desktoplayout);
USSetOLayout(s, odesktoplayout);
USSetDefaultDesk(s, defaultdesktop);
USSetHoverFocus(s, hoverfocus);
USSetRefreshRate(s, refreshrate);
USSetGapWidth(s, bgw);
USSetSnap(s, winsnap);
USSetMaxClientCount(s, maxcc);
USSetMFact(s, mfact);
USSetBarWidth(s, bw);
USSetBarHeight(s, bh);
USSetBarX(s, bx);
USSetBarY(s, by);
}

void
Expand Down

0 comments on commit 24ccc17

Please sign in to comment.