Skip to content

Commit

Permalink
chore: rename standard layout to default
Browse files Browse the repository at this point in the history
  • Loading branch information
Frewacom committed Jan 17, 2023
1 parent 26a179d commit 3b0ab5f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 32 deletions.
8 changes: 4 additions & 4 deletions doc/dwl-guile.1.man
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ At least one layout must be set, which is why \fBdwl-guile\fP will automatically
.B
.RS
.nf
\fC(set-layouts 'tile "[]=" 'dwl:tile)
\fC(set-layouts 'default "[]=" 'dwl:tile)
\fP
.fi
.RE
Expand All @@ -94,15 +94,15 @@ Including both the \fBtile\fP and \fBmonocle\fP layouts can look like this:
.B
.RS
.nf
\fC(set-layouts 'tile "[]=" 'dwl:tile
\fC(set-layouts 'default "[]=" 'dwl:tile
.B
'monocle "|M|" 'dwl:monocle)
\fP
.fi
.RE

.PP
Note that \fB'tile\fP and \fB'monocle\fP are unique identifiers for their respective layouts. A monitor rule can use these identifiers to assign a certain layout to a specific monitor. Adding a new layout with an identifier that already exists will simply override the options of the previous layout.
Note that \fB'default\fP and \fB'monocle\fP are unique identifiers for their respective layouts. A monitor rule can use these identifiers to assign a certain layout to a specific monitor. Adding a new layout with an identifier that already exists will simply override the options of the previous layout.

.SS "Monitor rules"
.PP
Expand All @@ -120,7 +120,7 @@ A valid configuration file should contain at least one monitor rule without a sp
.B
(transform . TRANSFORM-NORMAL)
.B
(layout . tile)))
(layout . default)))
\fP
.fi
.RE
Expand Down
8 changes: 4 additions & 4 deletions doc/dwl-guile.1.org
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ At least one layout must be set, which is why *dwl-guile* will automatically add

.B
#+begin_src scheme
(set-layouts 'tile "[]=" 'dwl:tile)
(set-layouts 'default "[]=" 'dwl:tile)
#+end_src

Including both the *tile* and *monocle* layouts can look like this:

.B
#+begin_src scheme
(set-layouts 'tile "[]=" 'dwl:tile
(set-layouts 'default "[]=" 'dwl:tile
.B
'monocle "|M|" 'dwl:monocle)
#+end_src

Note that *'tile* and *'monocle* are unique identifiers for their respective layouts. A monitor rule can use these identifiers to assign a certain layout to a specific monitor. Adding a new layout with an identifier that already exists will simply override the options of the previous layout.
Note that *'default* and *'monocle* are unique identifiers for their respective layouts. A monitor rule can use these identifiers to assign a certain layout to a specific monitor. Adding a new layout with an identifier that already exists will simply override the options of the previous layout.

** Monitor rules
A valid configuration file should contain at least one monitor rule without a specified *name* field, e.g.:
Expand All @@ -93,7 +93,7 @@ A valid configuration file should contain at least one monitor rule without a sp
.B
(transform . TRANSFORM-NORMAL)
.B
(layout . tile)))
(layout . default)))
#+end_src

To configure a dual-monitor setup with two horizontally adjacent monitors you could write something like this:
Expand Down
21 changes: 0 additions & 21 deletions dscm/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -610,27 +610,6 @@ dscm_config_load()
if (firstload) {
if (!inhibdef)
scm_c_primitive_load(PREFIX "/share/dwl-guile/defaults.scm");

/* Ensure that all required settings have been set */
int found = 0;
MonitorRule *r;
wl_list_for_each(r, &monrules, link)
if (r->name == NULL)
found = 1;
if (!found)
die("dscm: no default monitor rule with name = NULL set\n\n\
Consider adding something like the following to your config:\n\
(set-monitor-rules '((masters . 1)\n\
(master-factor . 0.55)\n\
(scale . 1)\n\
(rr . TRANSFORM-NORMAL)\n\
(layout . tile)))");
if (!wl_list_length(&layouts))
die("dscm: no layouts found, please add at least one layout\n\n\
Consider adding the following to your config:\n\
(set-layouts 'tile \"[]=\" 'dwl:tile)\n\
(set-layouts 'monocle \"|M|\" 'dwl:monocle)");

firstload = 0;
}
}
Expand Down
6 changes: 3 additions & 3 deletions share/init.scm
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ VIEW-MODIFIERS, and MOVE-MODIFIERS, respectively."
;; These can not be inhibited, but they can easily be overridden if needed.
(setq tags (map number->string (iota 9 1)))

;; Define layouts before monitor rules to make sure layout is available
(set-layouts 'tile "[]=" 'dwl:tile)
;; Define layouts before monitor rules to make sure layout is available.
(set-layouts 'default "[]=" 'dwl:tile)

;; There must be a default monitor rule (i.e. with name == NULL)
(set-monitor-rules '((masters . 1)
(master-factor . 0.55)
(scale . 1)
(transform . TRANSFORM-NORMAL)
(layout . tile)))
(layout . default)))

0 comments on commit 3b0ab5f

Please sign in to comment.