Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated setupcfgdefault() settings #75

Merged
merged 1 commit into from
May 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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