forked from mirror/dwl
Compare commits
581 commits
Shugyousha
...
0.7
Author | SHA1 | Date | |
---|---|---|---|
389d476f5b | |||
94a804e3d9 | |||
aad4181ca7 | |||
132dc5ad5c | |||
e801bcbdb6 | |||
7e2bbdbfaf | |||
8eb6cc467c | |||
7d25c6650d | |||
dc6f1cab59 | |||
49888cdcbb | |||
70a90ac7b5 | |||
8cd12ccb2d | |||
1ea7c6d404 | |||
1957bc6e55 | |||
57b7b87596 | |||
4c6e81631c | |||
|
cfc80c8f44 | ||
|
0e0c97db56 | ||
|
74e45c4014 | ||
|
464dddc110 | ||
|
cb01023db6 | ||
|
5bbb0ab404 | ||
|
ed74960373 | ||
|
cc622d4dd5 | ||
|
3256ae0679 | ||
|
e3f1aab770 | ||
|
57153fd557 | ||
|
a9bcdff683 | ||
|
bd59573f07 | ||
|
0060e1922d | ||
|
c709b09e10 | ||
|
efe10ea655 | ||
|
9a962ce136 | ||
|
0761fd0691 | ||
|
12b44421c8 | ||
|
5a4839b1c8 | ||
|
bd5001b780 | ||
|
043ab3ac13 | ||
|
aede3b294b | ||
|
7d8c3ea369 | ||
|
2db0a2e8ef | ||
|
ab5c554d09 | ||
|
b4638fef29 | ||
|
71f11e6cf6 | ||
|
2b4893a0ad | ||
|
1002ea04fa | ||
|
5d73134e33 | ||
|
46ae075430 | ||
|
13925eb1da | ||
|
4a7d1bebf5 | ||
|
baedf7f791 | ||
|
845d3c47bd | ||
|
9cdce1b8ff | ||
|
4cf1d604b8 | ||
|
650a918010 | ||
|
2902df94d6 | ||
|
9b1f35e42b | ||
|
92d1c286b8 | ||
|
784b047b38 | ||
|
11baacbec0 | ||
|
16076ec5a4 | ||
|
a8403d7b4d | ||
|
7a46fccdba | ||
|
c2e7350f2e | ||
|
7570dc0a41 | ||
|
e5a57fb155 | ||
|
57b5e41063 | ||
|
f4b6b429ec | ||
|
21205f2f40 | ||
|
8f6fca35d0 | ||
|
bca077b927 | ||
|
0047ff740a | ||
|
bf81a128ec | ||
|
9825c26cdd | ||
|
34b7a57211 | ||
|
5c19e23146 | ||
|
3b1f0a8a88 | ||
|
bb73481662 | ||
|
577d8da6d1 | ||
|
72e2ce8b00 | ||
|
dd00d994ce | ||
|
f7154d539d | ||
|
3a95d4ed03 | ||
|
2b171fd501 | ||
|
ea33ce9ae6 | ||
|
a0117eea76 | ||
|
7b3eb70501 | ||
|
c215e8a3e1 | ||
|
8e0b5baf8e | ||
|
8006e79200 | ||
|
5ae245beed | ||
|
089480e0b6 | ||
|
3c98c4c24d | ||
|
298949bbc4 | ||
|
17c5cbbf7b | ||
|
45e3694fc8 | ||
|
5c936efc42 | ||
|
9830a991ff | ||
|
863634a61c | ||
|
5fec98b17a | ||
|
ac6074f4fd | ||
|
433385f7f1 | ||
|
4043fc3093 | ||
|
b3f33e9147 | ||
|
f136aa088a | ||
|
1c3aaa70ba | ||
|
26d7c9689f | ||
|
6c8be38ec4 | ||
|
417e37f988 | ||
|
a1f3e25c35 | ||
|
0151bd48dd | ||
|
337d6ba3fb | ||
|
ec557f253b | ||
|
fd263041a0 | ||
|
a73afc66ab | ||
|
facbe57fcb | ||
|
f5b046ce9e | ||
|
6340989c8e | ||
|
25e34e4d0c | ||
|
668022bc90 | ||
|
c222468887 | ||
|
f3c4f72314 | ||
|
05c263de45 | ||
|
bf35e77811 | ||
|
6cbf8e9b80 | ||
|
d13015381b | ||
|
e277d84c51 | ||
|
bf5a6be73c | ||
|
1f0afcfc28 | ||
|
23fd312409 | ||
|
e39d931430 | ||
|
396840cdf2 | ||
|
a71b368483 | ||
|
7afdc191fe | ||
|
023efce6eb | ||
|
fa660fb61e | ||
|
126a333354 | ||
|
9a84789ff1 | ||
|
49bfe92703 | ||
|
c88960751d | ||
|
9c5bdcfbe8 | ||
|
0de7d1aa71 | ||
|
1884a07646 | ||
|
79c51a4584 | ||
|
f5d839844d | ||
|
e03896b4d6 | ||
|
e7e84b1083 | ||
|
9694477b2f | ||
|
6a15167754 | ||
|
e5e2d1c28f | ||
|
bdbfb45d66 | ||
|
50ea84c5f6 | ||
|
472a31b5a4 | ||
|
a760757b82 | ||
|
80c9ad12ba | ||
|
7341d047da | ||
|
be2a1dea26 | ||
|
393078d80c | ||
|
28ec843aee | ||
|
2b3504e439 | ||
|
bab5c0185a | ||
|
5f7d396996 | ||
|
901d2e2d9d | ||
|
00e867d536 | ||
|
2e29189b92 | ||
|
43f31b8f1b | ||
|
ff39cac355 | ||
|
70c5fcc23d | ||
|
3fe3581a59 | ||
|
057d50af8c | ||
|
2e4fdc1664 | ||
|
b100b446b8 | ||
|
9cb1ece6cc | ||
|
01a237bd5c | ||
|
a5e068b20a | ||
|
39f4ee564b | ||
|
a353eee2ca | ||
|
66ec028b00 | ||
|
1f10e69b4c | ||
|
922e117fc5 | ||
|
2783e82bf8 | ||
|
66ef4ecfec | ||
|
d08e6a3a7e | ||
|
f579dd8668 | ||
|
24576f1fdf | ||
|
7ac76219df | ||
|
6838f909bd | ||
|
d2dd2f4986 | ||
|
a0e79d8145 | ||
|
32e66f4582 | ||
|
b4da97446a | ||
|
2751a6195d | ||
|
fcf324be6c | ||
|
b8e933b9a9 | ||
|
1044a21555 | ||
|
6bcd5d8d87 | ||
|
7611dc91d7 | ||
|
e95f14541a | ||
|
bca1b779aa | ||
|
7bdbab0400 | ||
|
dd25cdb56e | ||
|
caac2d664d | ||
|
b1740056d5 | ||
|
0067c76cab | ||
|
22d21676b0 | ||
|
d6c102d9db | ||
|
0e897608a1 | ||
|
6d0ec595d3 | ||
|
4f4c540bb9 | ||
|
8e3f5364d3 | ||
|
2212363225 | ||
|
6f8a3f9374 | ||
|
e1f3983bf8 | ||
|
31bf1cbaf6 | ||
|
d6fabe3a15 | ||
|
a4a83e95e6 | ||
|
e45ded7eea | ||
|
e5e74acfce | ||
|
892a4d3ec7 | ||
|
ab87410023 | ||
|
7085057f6d | ||
|
8c79f8dc15 | ||
|
8781f4dbf5 | ||
|
df131cdb78 | ||
|
887fde65a3 | ||
|
b299e01e44 | ||
|
6d9a915fb6 | ||
|
935b852dc5 | ||
|
a18c528300 | ||
|
72a7d78a1a | ||
|
d63f4078c5 | ||
|
f4031590cd | ||
|
0ab1ed6530 | ||
|
f695674361 | ||
|
aec21eca1f | ||
|
342850487a | ||
|
1333f8cc6e | ||
|
5baf195523 | ||
|
773bd04764 | ||
|
755fcae2af | ||
|
960c32a7d8 | ||
|
aea8dd6ae1 | ||
|
c1d8b77f7f | ||
|
e5367753bb | ||
|
9be85c1117 | ||
|
4b8c1bf31e | ||
|
d7569870b6 | ||
|
4eb54b55f3 | ||
|
d4f2c6bfd6 | ||
|
4567979b16 | ||
|
25db045392 | ||
|
78cf88670f | ||
|
ce997c4a21 | ||
|
0e5405610e | ||
|
0bb1a1cc5c | ||
|
aecff8cb26 | ||
|
ca4a97b933 | ||
|
76ba2cdab0 | ||
|
4b15bbeb33 | ||
|
831fc36bc9 | ||
|
1841527871 | ||
|
ff7c0e9508 | ||
|
33bcd2e4ca | ||
|
fbd84aca4a | ||
|
a01e402c5d | ||
|
9dd3f230c0 | ||
|
eda0613cc4 | ||
|
733114f0ca | ||
|
fdb66ccfa3 | ||
|
6095ff84d2 | ||
|
68a17f962e | ||
|
9c592da01f | ||
|
df11b7a786 | ||
|
1e1811f953 | ||
|
dfb6b97159 | ||
|
65f68e7643 | ||
|
96ab92cdb1 | ||
|
1eb8a82ac4 | ||
|
24a337e6ec | ||
|
5215712cab | ||
|
f3d017077a | ||
|
06bc65549f | ||
|
a8ccbe63f3 | ||
|
9b9b79b35e | ||
|
3d98907b98 | ||
|
f8884ffc2b | ||
|
a5e45924ed | ||
|
72adab621f | ||
|
0729f18dce | ||
|
2d1a40caf2 | ||
|
733754bb06 | ||
|
797e0c74b2 | ||
|
3c760bcd4a | ||
|
da77e34ee5 | ||
|
20f61a59af | ||
|
9d68554c59 | ||
|
bbdf2a913b | ||
|
21930621ee | ||
|
6722a89532 | ||
|
eaf6dd2cd2 | ||
|
e4921fad28 | ||
|
d1b36925c9 | ||
|
c69a2bec3f | ||
|
737688a6b1 | ||
|
fefcdbed4a | ||
|
f8373ccf25 | ||
|
7f9a212476 | ||
|
ab8334bd8a | ||
|
23ede80f74 | ||
|
04fdf1a295 | ||
|
fbe89a929f | ||
|
e7f736ccc9 | ||
|
7ae5039b4f | ||
|
f7d6a34cd9 | ||
|
cf9c5745e5 | ||
|
8653b27692 | ||
|
932c1d45f2 | ||
|
dbe44e48c8 | ||
|
0b2c33248c | ||
|
56114f700f | ||
|
71c7e4e1e5 | ||
|
72d29f1654 | ||
|
e523c2b82b | ||
|
6d0e3a5198 | ||
|
5347ed663d | ||
|
b39d270b9f | ||
|
05f4e23c43 | ||
|
be854cab35 | ||
|
6ca011430a | ||
|
7eaa01ac1f | ||
|
92e7752203 | ||
|
6682878009 | ||
|
afacc9b0b5 | ||
|
dd9d8d543c | ||
|
686958a4cc | ||
|
1a3d89e5b2 | ||
|
7b1fe7e5f2 | ||
|
803a9ba98d | ||
|
a39a46c908 | ||
|
94c8bd6048 | ||
|
c60f651951 | ||
|
98c7adfb3d | ||
|
79b051f242 | ||
|
d42a977b5b | ||
|
4a32293548 | ||
|
9136b6247d | ||
|
19b5d47a9e | ||
|
b5229636a3 | ||
|
c9a0a8bf6d | ||
|
22336612ae | ||
|
38bd00351a | ||
|
c56bc42eb5 | ||
|
13b929d7d7 | ||
|
b6d6127733 | ||
|
02c257e0b1 | ||
|
16a49e9955 | ||
|
30c24a53ad | ||
|
017bb7d752 | ||
|
fac3b6f2cf | ||
|
035bb99d67 | ||
|
27ab9cf1b1 | ||
|
9c155eefdc | ||
|
df34fdd483 | ||
|
1b39bbf316 | ||
|
4c6050331e | ||
|
eaf8a21603 | ||
|
f929eaef1e | ||
|
ce1d040586 | ||
|
b4fb1f77c7 | ||
|
6df6781b43 | ||
|
10c56d6348 | ||
|
c91d21b68f | ||
|
3213088aa2 | ||
|
87d87cc404 | ||
|
ea1b2dda63 | ||
|
087373698a | ||
|
caec566286 | ||
|
05eca0e2d9 | ||
|
7eebe67787 | ||
|
63d6de5866 | ||
|
60a98b87f3 | ||
|
93a911d6e9 | ||
|
88d386bfdc | ||
|
972e3f3050 | ||
|
569f554016 | ||
|
21ef004886 | ||
|
dae00caadd | ||
|
5eb3529275 | ||
|
359e7edc52 | ||
|
25dfdcc433 | ||
|
fcb3fa4e90 | ||
|
b59c7f6a2e | ||
|
f1639ba9d5 | ||
|
8bd3442575 | ||
|
3cc22de712 | ||
|
448a96de13 | ||
|
99f062273e | ||
|
8298f20a71 | ||
|
6a0ec2a8c3 | ||
|
846ce52b92 | ||
|
a9e2ebaf41 | ||
|
9b5f0f0fc5 | ||
|
cb01ce9bcf | ||
|
9588b46b5c | ||
|
2f7834b130 | ||
|
f494891a9a | ||
|
fd2c47cb70 | ||
|
1eeb3689d3 | ||
|
e9826de295 | ||
|
110cde8f67 | ||
|
2d9d758c8d | ||
|
332ceb7136 | ||
|
9e912cf790 | ||
|
4eabf6f7eb | ||
|
765656902f | ||
|
1438dfc150 | ||
|
3902fba769 | ||
|
7f3c9fa0ae | ||
|
952fde68a3 | ||
|
0d1ca4663c | ||
|
f6820a6c29 | ||
|
87c4c1f629 | ||
|
8559141b30 | ||
|
434ed119f3 | ||
|
ae3d435717 | ||
|
b8bc54b65d | ||
|
b5776e5180 | ||
|
c13d948ea9 | ||
|
fc8b2a8335 | ||
|
c00faae263 | ||
|
e46238b95e | ||
|
2385d82612 | ||
|
31106eff64 | ||
|
1fdc65ff93 | ||
|
fbaeb85363 | ||
|
570e6e2c27 | ||
|
a1b33826cf | ||
|
d11358762d | ||
|
7710cf050d | ||
|
d14ee99661 | ||
|
cd96f889b8 | ||
|
bc72af6e24 | ||
|
bcc8ce7a40 | ||
|
ba7dcb2dea | ||
|
c8a9f63451 | ||
|
fd67087a82 | ||
|
77ba8e5127 | ||
|
c509046663 | ||
|
93de6e82a2 | ||
|
f8f94c97f5 | ||
|
1bb9c4583a | ||
|
9bcef3d040 | ||
|
ae42e4390b | ||
|
303fc72b12 | ||
|
871463c327 | ||
|
d1496a2a9b | ||
|
80084839a9 | ||
|
1aacfada29 | ||
|
dc59f7733d | ||
|
14c010a0d6 | ||
|
14a1e3e2a2 | ||
|
a94d089c40 | ||
|
e91f71e8d6 | ||
|
68576799b9 | ||
|
19a8a095eb | ||
|
1f59b76d77 | ||
|
40b1c0b849 | ||
|
c017916d35 | ||
|
2260519740 | ||
|
0e993b5fb1 | ||
|
83e37820d7 | ||
|
d738573e22 | ||
|
b9295e8cee | ||
|
e0cc5b046c | ||
|
406aebcbd2 | ||
|
dfcd142ce4 | ||
|
07bf1832bf | ||
|
174919ec53 | ||
|
a7f77160d1 | ||
|
7a343b98cf | ||
|
8d2516e83c | ||
|
f173c56c32 | ||
|
28af37cd1f | ||
|
48396a1bf8 | ||
|
b6e3fc1645 | ||
|
3431ac165d | ||
|
6ce035303e | ||
|
620fd9dc56 | ||
|
662e06e68e | ||
|
9d2eb8483b | ||
|
7eee0a8229 | ||
|
b04c73be3d | ||
|
8cdb997126 | ||
|
90a12c90a0 | ||
|
e082292606 | ||
|
deb48ff48b | ||
|
c70db2d06a | ||
|
e98719f552 | ||
|
058c699ac2 | ||
|
af12e777f2 | ||
|
8e03bce621 | ||
|
87fc3a58ab | ||
|
0eff78d6c2 | ||
|
c6d97f1db7 | ||
|
829dec6598 | ||
|
ff70337c16 | ||
|
7cc6c640e2 | ||
|
72e0a560d9 | ||
|
2aa391361c | ||
|
549335ae54 | ||
|
097b4a30f5 | ||
|
461d02d3e0 | ||
|
c1578bc14d | ||
|
9b84940e37 | ||
|
79ad72413d | ||
|
74fce9d918 | ||
|
553ba5b7c8 | ||
|
4ae6d0f387 | ||
|
2ef5abfb72 | ||
|
8076b47cc6 | ||
|
3a77f02919 | ||
|
d26ddfc7fd | ||
|
671a9b450b | ||
|
583f471cfe | ||
|
8bce3b1583 | ||
|
c008bf2a7d | ||
|
c990dbd441 | ||
|
a32db11f16 | ||
|
948fdcf709 | ||
|
4b890336e2 | ||
|
c7007b4811 | ||
|
d969289baf | ||
|
50b6630f3d | ||
|
14641560b0 | ||
|
7b42232ad1 | ||
|
a5a0674f6a | ||
|
70da04a714 | ||
|
283c043b5c | ||
|
88a8b784d0 | ||
|
79a148224f | ||
|
dca68f9aa1 | ||
|
31fa6600a1 | ||
|
dc7709a00e | ||
|
4a2e761914 | ||
|
29a2b647b2 | ||
|
dd0b8e4c37 | ||
|
0ddde0c85a | ||
|
e08bd12922 | ||
|
7018ed9218 | ||
|
f75e426222 | ||
|
faaee90cbd | ||
|
3e79a9a5d7 | ||
|
c2899bc00b | ||
|
f353a0e759 | ||
|
281c947e5f | ||
|
855e6c1898 | ||
|
a41d6cb00f | ||
|
b42abeac69 | ||
|
5a1debb5f0 | ||
|
1a5b7e068b | ||
|
0db6f3c5b5 | ||
|
d8ab893dab | ||
|
f2be10fd43 | ||
|
23af627d80 | ||
|
a7f7777907 | ||
|
40db9c88ea | ||
|
4276410a3d | ||
|
0662bc5a69 | ||
|
a66210ebbc | ||
|
c8290f8c55 | ||
|
98f33cd01d | ||
|
a7c4f6100a | ||
|
3577802541 | ||
|
230d3432e9 | ||
|
432c15fb09 | ||
|
2630664fef | ||
|
76b3756d11 | ||
|
97881c88c7 | ||
|
b8ce8d0fbb | ||
|
ed44bc0c90 | ||
|
3300f6c911 |
25 changed files with 4536 additions and 1307 deletions
62
.gitea/issue_template/bug_report.yml
Normal file
62
.gitea/issue_template/bug_report.yml
Normal file
|
@ -0,0 +1,62 @@
|
|||
name: Bug Report
|
||||
about: Something in dwl isn't working correctly
|
||||
title:
|
||||
labels:
|
||||
- 'Kind/Bug'
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
- Only report bugs that can be reproduced on the main (or wlroots-next) branch without patches.
|
||||
- Proprietary graphics drivers, including nvidia, are not supported. Please use the open source equivalents, such as nouveau, if you would like to use dwl.
|
||||
- Report patch issues to their respective authors.
|
||||
|
||||
- type: input
|
||||
id: dwl_version
|
||||
attributes:
|
||||
label: 'dwl version:'
|
||||
placeholder: '`dwl -v`'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: wlroots_version
|
||||
attributes:
|
||||
label: 'wlroots version:'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: distro
|
||||
attributes:
|
||||
label: What distro (and version) are you using?
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
value: |
|
||||
The steps you took to reproduce the problem.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: debug_log
|
||||
attributes:
|
||||
label: Debug Log
|
||||
value: |
|
||||
Run `dwl -d 2> ~/dwl.log` from a TTY and attach the **full** (do not truncate it) file here, or upload it to a pastebin.
|
||||
Please try to keep the reproduction as brief as possible and exit dwl.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: backtrace
|
||||
attributes:
|
||||
label: Stack Trace
|
||||
value: |
|
||||
- Only required if dwl crashes.
|
||||
- If the lines mentioning dwl or wlroots have `??`. Please compile both dwl and wlroots from source (enabling debug symbols) and try to reproduce.
|
||||
validations:
|
||||
required: false
|
9
.gitea/issue_template/enhancement-idea.yml
Normal file
9
.gitea/issue_template/enhancement-idea.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
name: Enhancement idea
|
||||
about: Suggest a feature or improvement
|
||||
title:
|
||||
labels:
|
||||
- 'Kind/Feature'
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
22
.github/ISSUE_TEMPLATE/bug_report.md
vendored
22
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
@ -1,22 +0,0 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Something in dwl isn't working correctly
|
||||
title: ''
|
||||
labels: 'A: bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Info
|
||||
dwl's commit:
|
||||
wlroots version:
|
||||
## Description
|
||||
<!--
|
||||
Only report bugs that can be reproduced on the main line
|
||||
Report patch issues to their respective authors
|
||||
If the patch author doesn't respond within a reasonable time, email me:
|
||||
|
||||
Leonardo Hernández Hernández <leohdz172@protonmail.com>
|
||||
|
||||
but note that I'm NOT making any promises
|
||||
-->
|
10
.github/ISSUE_TEMPLATE/enhancement-idea.md
vendored
10
.github/ISSUE_TEMPLATE/enhancement-idea.md
vendored
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
name: Enhancement idea
|
||||
about: Suggest a feature or improvement
|
||||
title: ''
|
||||
labels: 'A: enhancement'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
1
.mailmap
Normal file
1
.mailmap
Normal file
|
@ -0,0 +1 @@
|
|||
Lennart Jablonka <humm@ljabl.com> <hummsmith42@gmail.com>
|
214
CHANGELOG.md
Normal file
214
CHANGELOG.md
Normal file
|
@ -0,0 +1,214 @@
|
|||
# Changelog
|
||||
|
||||
* [Unreleased](#unreleased)
|
||||
* [0.7](#0.7)
|
||||
* [0.6](#0.6)
|
||||
* [0.5](#0.5)
|
||||
|
||||
|
||||
## Unreleased
|
||||
### Added
|
||||
### Changed
|
||||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
|
||||
* Crash when a client is created while all outputs are disabled.
|
||||
|
||||
### Security
|
||||
### Contributors
|
||||
|
||||
|
||||
## 0.7
|
||||
|
||||
See also [0.6](#0.6) release notes. 0.7 builds against wlroots 0.18.x.
|
||||
|
||||
### Added
|
||||
|
||||
* Add support for the alpha-modifier-v1 protocol ([wlroots!4616][wlroots!4616]).
|
||||
* dwl now will survive GPU resets ([#601][601]).
|
||||
|
||||
[wlroots!4616]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4616
|
||||
[601]: https://codeberg.org/dwl/dwl/issues/601
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
* Crash when re-mapping unmapped clients.
|
||||
|
||||
|
||||
### Contributors
|
||||
|
||||
Guido Cella
|
||||
Lennart Jablonka
|
||||
|
||||
|
||||
## 0.6
|
||||
|
||||
### Added
|
||||
|
||||
* Add `rootcolor` to change the default background color ([#544][544]).
|
||||
* Implement the wlr-virtual-pointer-unstable-v1 protocol ([#574][574]).
|
||||
* Implement the pointer-constraints and relative-pointer protocols ([#317][317])
|
||||
* Implement the wlr-output-power-management protocol ([#599][599])
|
||||
|
||||
[544]: https://codeberg.org/dwl/dwl/pulls/544
|
||||
[574]: https://codeberg.org/dwl/dwl/pulls/574
|
||||
[317]: https://codeberg.org/dwl/dwl/issues/317
|
||||
[599]: https://codeberg.org/dwl/dwl/issues/559
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
* Keyboards are now managed through keyboard groups ([#549][549]).
|
||||
* Only the first matched keybinding is executed.
|
||||
* Allow toggling the layout before selecting a different one ([#570][570]).
|
||||
* Fullscreen clients are now rendered above wlr_layer_surfaces in the top layer
|
||||
([#609][609]).
|
||||
* The default menu was changed from `bemenu-run` to `wmenu-run` ([#553][553]).
|
||||
* The option `sloppyfocus` now replicates the dwm behavior ([#599][599]).
|
||||
* Allow configure position of monitors with negative values. (-1, -1) is
|
||||
used to auto-configure them ([#635][635]).
|
||||
* dwl now kills the entire process group of `startup_cmd`
|
||||
* The O_NONBLOCK flag is set for stdout.
|
||||
|
||||
[549]: https://codeberg.org/dwl/dwl/pulls/549
|
||||
[570]: https://codeberg.org/dwl/dwl/pulls/570
|
||||
[609]: https://codeberg.org/dwl/dwl/pulls/609
|
||||
[553]: https://codeberg.org/dwl/dwl/issues/553
|
||||
[599]: https://codeberg.org/dwl/dwl/pulls/599
|
||||
[635]: https://codeberg.org/dwl/dwl/pulls/635
|
||||
|
||||
|
||||
### Removed
|
||||
|
||||
* The SLOC limit is now removed ([#497][497]).
|
||||
|
||||
[497]: https://codeberg.org/dwl/dwl/pulls/497
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
* Clients not having the correct border color when mapping.
|
||||
* Compliance with the xdg-decoration-unstable-v1 ([#546][546]).
|
||||
* dwl no longer sends negative values in xdg_toplevel.configure events.
|
||||
* Crashes with disabled monitors ([#472][472]).
|
||||
|
||||
[546]: https://codeberg.org/dwl/dwl/pulls/546
|
||||
[472]: https://codeberg.org/dwl/dwl/issues/472
|
||||
|
||||
|
||||
### Contributors
|
||||
|
||||
Ben Jargowsky
|
||||
Benjamin Chausse
|
||||
David Donahue
|
||||
Devin J. Pohly
|
||||
Dima Krasner
|
||||
Emil Miler
|
||||
Forrest Bushstone
|
||||
Guido Cella
|
||||
Peter Hofmann
|
||||
Rutherther
|
||||
Squibid
|
||||
choc
|
||||
fictitiousexistence
|
||||
korei999
|
||||
sewn
|
||||
thanatos
|
||||
|
||||
|
||||
## 0.5
|
||||
|
||||
### Added
|
||||
|
||||
* Allow configure x and y position of outputs ([#301][301])
|
||||
* Implement repeatable keybindings ([#368][368])
|
||||
* Print app id in printstatus() output ([#381][381])
|
||||
* Display client count in monocle symbol ([#387][387])
|
||||
* Export XCURSOR_SIZE to fix apps using an older version of Qt ([#425][425])
|
||||
* Support for wp-fractional-scale-v1 (through wlr_scene: [wlroots!3511][wlroots!3511])
|
||||
* dwl now sends `wl_surface.preferred_buffer_scale` (through wlr_scene: [wlroots!4269][wlroots!4269])
|
||||
* Add support for xdg-shell v6 ([#465][465])
|
||||
* Add support for wp-cursor-shape-v1 ([#444][444])
|
||||
* Add desktop file ([#484][484])
|
||||
* Add macro to easily configure colors ([#466][466])
|
||||
* Color of urgent clients are now red ([#494][494])
|
||||
* New flag `-d` and option `log_level` to change the wlroots debug level
|
||||
* Add CHANGELOG.md ([#501][501])
|
||||
|
||||
[301]: https://github.com/djpohly/dwl/pull/301
|
||||
[368]: https://github.com/djpohly/dwl/pull/368
|
||||
[381]: https://github.com/djpohly/dwl/pull/381
|
||||
[387]: https://github.com/djpohly/dwl/issues/387
|
||||
[425]: https://github.com/djpohly/dwl/pull/425
|
||||
[wlroots!4269]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4269
|
||||
[wlroots!3511]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3511
|
||||
[465]: https://github.com/djpohly/dwl/pull/465
|
||||
[444]: https://github.com/djpohly/dwl/pull/444
|
||||
[484]: https://github.com/djpohly/dwl/pull/484
|
||||
[466]: https://github.com/djpohly/dwl/issues/466
|
||||
[494]: https://github.com/djpohly/dwl/pull/494
|
||||
[501]: https://github.com/djpohly/dwl/pull/501
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
* Replace `tags` with `TAGCOUNT` in config.def.h ([#403][403])
|
||||
* Pop ups are now destroyed when focusing another client ([#408][408])
|
||||
* dwl does not longer respect size hints, instead clip windows if they are
|
||||
larger than they should be ([#455][455])
|
||||
* The version of wlr-layer-shell-unstable-v1 was lowered to 3 (from 4)
|
||||
* Use the same border color as dwm ([#494][494])
|
||||
|
||||
[403]: https://github.com/djpohly/dwl/pull/403
|
||||
[408]: https://github.com/djpohly/dwl/pull/409
|
||||
[455]: https://github.com/djpohly/dwl/pull/455
|
||||
[494]: https://github.com/djpohly/dwl/pull/494
|
||||
|
||||
|
||||
### Removed
|
||||
|
||||
* Remove unused `rootcolor` option ([#401][401])
|
||||
* Remove support for wlr-input-inhibitor-unstable-v1 ([#430][430])
|
||||
* Remove support for KDE idle protocol ([#431][431])
|
||||
|
||||
[401]: https://github.com/djpohly/dwl/pull/401
|
||||
[430]: https://github.com/djpohly/dwl/pull/430
|
||||
[431]: https://github.com/djpohly/dwl/pull/431
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fix crash when creating a layer surface with all outputs disabled
|
||||
([#421][421])
|
||||
* Fix other clients being shown as focused if the focused client have pop ups
|
||||
open ([#408][408])
|
||||
* Resize fullscreen clients when updating monitor mode
|
||||
* dwl no longer crash at exit like sometimes did
|
||||
* Fullscreen background appearing above clients ([#487][487])
|
||||
* Fix a segfault when user provides invalid xkb_rules ([#518][518])
|
||||
|
||||
[421]: https://github.com/djpohly/dwl/pull/421
|
||||
[408]: https://github.com/djpohly/dwl/issues/408
|
||||
[487]: https://github.com/djpohly/dwl/issues/487
|
||||
[518]: https://github.com/djpohly/dwl/pull/518
|
||||
|
||||
|
||||
### Contributors
|
||||
|
||||
* A Frederick Christensen
|
||||
* Angelo Antony
|
||||
* Ben Collerson
|
||||
* Devin J. Pohly
|
||||
* Forrest Bushstone
|
||||
* gan-of-culture
|
||||
* godalming123
|
||||
* Job79
|
||||
* link2xt
|
||||
* Micah Gorrell
|
||||
* Nikita Ivanov
|
||||
* Palanix
|
||||
* pino-desktop
|
||||
* Weiseguy
|
||||
* Yves Zoundi
|
120
Makefile
120
Makefile
|
@ -1,73 +1,79 @@
|
|||
.POSIX:
|
||||
.SUFFIXES:
|
||||
|
||||
include config.mk
|
||||
|
||||
CFLAGS += -I. -DWLR_USE_UNSTABLE -std=c99 -pedantic -DVERSION=\"$(VERSION)\"
|
||||
# flags for compiling
|
||||
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L \
|
||||
-DVERSION=\"$(VERSION)\" $(XWAYLAND)
|
||||
DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement \
|
||||
-Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes \
|
||||
-Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types \
|
||||
-Wfloat-conversion
|
||||
|
||||
WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols)
|
||||
WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner)
|
||||
|
||||
PKGS = wlroots wayland-server xcb xkbcommon libinput
|
||||
CFLAGS += $(foreach p,$(PKGS),$(shell pkg-config --cflags $(p)))
|
||||
LDLIBS += $(foreach p,$(PKGS),$(shell pkg-config --libs $(p)))
|
||||
# CFLAGS / LDFLAGS
|
||||
PKGS = wlroots-0.18 wayland-server xkbcommon libinput pixman-1 fcft $(XLIBS)
|
||||
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
||||
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` -lm $(LIBS)
|
||||
|
||||
all: dwl
|
||||
|
||||
clean:
|
||||
rm -f dwl *.o *-protocol.h *-protocol.c
|
||||
|
||||
dist: clean
|
||||
mkdir -p dwl-$(VERSION)
|
||||
cp -R LICENSE* Makefile README.md generate-version.sh client.h\
|
||||
config.def.h config.mk protocols dwl.1 dwl.c util.c util.h\
|
||||
dwl-$(VERSION)
|
||||
echo "echo $(VERSION)" > dwl-$(VERSION)/generate-version.sh
|
||||
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
|
||||
rm -rf dwl-$(VERSION)
|
||||
|
||||
install: dwl
|
||||
install -Dm755 dwl $(DESTDIR)$(PREFIX)/bin/dwl
|
||||
install -Dm644 dwl.1 $(DESTDIR)$(MANDIR)/man1/dwl.1
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1
|
||||
|
||||
.PHONY: all clean dist install uninstall
|
||||
dwl: dwl.o util.o
|
||||
$(CC) dwl.o util.o $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
|
||||
dwl.o: dwl.c client.h config.h config.mk cursor-shape-v1-protocol.h \
|
||||
pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
|
||||
wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
|
||||
util.o: util.c util.h
|
||||
|
||||
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
||||
# protocols, which are specified in XML. wlroots requires you to rig these up
|
||||
# to your build system yourself and provide them in the include path.
|
||||
WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
|
||||
WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
|
||||
|
||||
cursor-shape-v1-protocol.h:
|
||||
$(WAYLAND_SCANNER) enum-header \
|
||||
$(WAYLAND_PROTOCOLS)/staging/cursor-shape/cursor-shape-v1.xml $@
|
||||
pointer-constraints-unstable-v1-protocol.h:
|
||||
$(WAYLAND_SCANNER) enum-header \
|
||||
$(WAYLAND_PROTOCOLS)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $@
|
||||
wlr-layer-shell-unstable-v1-protocol.h:
|
||||
$(WAYLAND_SCANNER) enum-header \
|
||||
protocols/wlr-layer-shell-unstable-v1.xml $@
|
||||
wlr-output-power-management-unstable-v1-protocol.h:
|
||||
$(WAYLAND_SCANNER) server-header \
|
||||
protocols/wlr-output-power-management-unstable-v1.xml $@
|
||||
xdg-shell-protocol.h:
|
||||
$(WAYLAND_SCANNER) server-header \
|
||||
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
||||
|
||||
xdg-shell-protocol.c:
|
||||
$(WAYLAND_SCANNER) private-code \
|
||||
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
||||
|
||||
xdg-shell-protocol.o: xdg-shell-protocol.h
|
||||
|
||||
wlr-layer-shell-unstable-v1-protocol.h:
|
||||
$(WAYLAND_SCANNER) server-header \
|
||||
protocols/wlr-layer-shell-unstable-v1.xml $@
|
||||
|
||||
wlr-layer-shell-unstable-v1-protocol.c:
|
||||
$(WAYLAND_SCANNER) private-code \
|
||||
protocols/wlr-layer-shell-unstable-v1.xml $@
|
||||
|
||||
wlr-layer-shell-unstable-v1-protocol.o: wlr-layer-shell-unstable-v1-protocol.h
|
||||
|
||||
idle-protocol.h:
|
||||
$(WAYLAND_SCANNER) server-header \
|
||||
protocols/idle.xml $@
|
||||
|
||||
idle-protocol.c:
|
||||
$(WAYLAND_SCANNER) private-code \
|
||||
protocols/idle.xml $@
|
||||
|
||||
idle-protocol.o: idle-protocol.h
|
||||
|
||||
config.h: | config.def.h
|
||||
config.h:
|
||||
cp config.def.h $@
|
||||
clean:
|
||||
rm -f dwl *.o *-protocol.h
|
||||
rm -f result result-man
|
||||
|
||||
dwl.o: config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h idle-protocol.h util.h
|
||||
dist: clean
|
||||
mkdir -p dwl-$(VERSION)
|
||||
cp -R LICENSE* Makefile CHANGELOG.md README.md client.h config.def.h \
|
||||
config.mk protocols dwl.1 dwl.c util.c util.h dwl.desktop \
|
||||
dwl-$(VERSION)
|
||||
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
|
||||
rm -rf dwl-$(VERSION)
|
||||
|
||||
dwl: xdg-shell-protocol.o wlr-layer-shell-unstable-v1-protocol.o idle-protocol.o util.o
|
||||
install: dwl
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f dwl $(DESTDIR)$(PREFIX)/bin
|
||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl
|
||||
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
||||
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
|
||||
chmod 644 $(DESTDIR)$(MANDIR)/man1/dwl.1
|
||||
mkdir -p $(DESTDIR)$(DATADIR)/wayland-sessions
|
||||
cp -f dwl.desktop $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
||||
chmod 644 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 \
|
||||
$(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
||||
|
||||
.SUFFIXES: .c .o
|
||||
.c.o:
|
||||
$(CC) $(CPPFLAGS) $(DWLCFLAGS) -o $@ -c $<
|
||||
|
|
193
README.md
193
README.md
|
@ -1,61 +1,100 @@
|
|||
# dwl - dwm for Wayland
|
||||
|
||||
Join us on our [Discord server](https://discord.gg/jJxZnrGPWN)!
|
||||
Join us on our IRC channel: [#dwl on Libera Chat]
|
||||
Or on our [Discord server].
|
||||
|
||||
dwl is a compact, hackable compositor for Wayland based on [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots/). It is intended to fill the same space in the Wayland world that dwm does in X11, primarily in terms of philosophy, and secondarily in terms of functionality. Like dwm, dwl is:
|
||||
dwl is a compact, hackable compositor for [Wayland] based on [wlroots]. It is
|
||||
intended to fill the same space in the Wayland world that dwm does in X11,
|
||||
primarily in terms of functionality, and secondarily in terms of
|
||||
philosophy. Like dwm, dwl is:
|
||||
|
||||
- Easy to understand, hack on, and extend with patches
|
||||
- One C source file (or a very small number) configurable via `config.h`
|
||||
- Limited to 2000 SLOC to promote hackability
|
||||
- Tied to as few external dependencies as possible
|
||||
|
||||
dwl is not meant to provide every feature under the sun. Instead, like dwm, it sticks to features which are necessary, simple, and straightforward to implement given the base on which it is built. Implemented default features are:
|
||||
## Getting Started:
|
||||
|
||||
- Any features provided by dwm/Xlib: simple window borders, tags, keybindings, client rules, mouse move/resize. Providing a built-in status bar is an exception to this goal, to avoid dependencies on font rendering and/or drawing libraries when an external bar could work well.
|
||||
- Configurable multi-monitor layout support, including position and rotation
|
||||
- Configurable HiDPI/multi-DPI support
|
||||
- Idle-inhibit protocol which lets applications such as mpv disable idle monitoring
|
||||
- Provide information to external status bars via stdout/stdin
|
||||
- Urgency hints via xdg-activate protocol
|
||||
- Support screen lockers via input-inhibitor protocol
|
||||
- Various Wayland protocols
|
||||
- XWayland support as provided by wlroots (can be enabled in `config.mk`)
|
||||
- Zero flickering - Wayland users naturally expect that "every frame is perfect"
|
||||
- Layer shell popups (used by Waybar)
|
||||
- Damage tracking provided by scenegraph API
|
||||
### **dwl branch 0.7 and releases based upon 0.7 build against [wlroots] 0.18**
|
||||
|
||||
Features under consideration (possibly as patches) are:
|
||||
### Latest semi-stable [release]
|
||||
This is probably where you want to start. This builds against the dependent
|
||||
packages' versions currently shipping in major distributions. If your
|
||||
distribution's wlroots version is older, use an earlier dwl [release] or [0.x
|
||||
branch].
|
||||
|
||||
- Protocols made trivial by wlroots
|
||||
- Implement the text-input and input-method protocols to support IME once ibus implements input-method v2 (see https://github.com/ibus/ibus/pull/2256 and https://github.com/djpohly/dwl/pull/12)
|
||||
### Development branch [main]
|
||||
Active development progresses on the `main` branch. The `main` branch is built
|
||||
against a late (and often changing) git commit of wlroots. While the adventurous
|
||||
are welcome to use `main`, it is a rocky road. Using `main` requires that the
|
||||
user be willing to chase git commits of wlroots. Testing development pull
|
||||
requests may involve merging unmerged pull requests in [wlroots]' git repository
|
||||
and/or git commits of wayland.
|
||||
|
||||
Feature *non-goals* for the main codebase include:
|
||||
### Building dwl
|
||||
dwl has the following dependencies:
|
||||
- libinput
|
||||
- wayland
|
||||
- wlroots (compiled with the libinput backend)
|
||||
- xkbcommon
|
||||
- wayland-protocols (compile-time only)
|
||||
- pkg-config (compile-time only)
|
||||
|
||||
- Client-side decoration (any more than is necessary to tell the clients not to)
|
||||
- Client-initiated window management, such as move, resize, and close, which can be done through the compositor
|
||||
- Animations and visual effects
|
||||
dwl has the following additional dependencies if XWayland support is enabled:
|
||||
- libxcb
|
||||
- libxcb-wm
|
||||
- wlroots (compiled with X11 support)
|
||||
- Xwayland (runtime only)
|
||||
|
||||
## Building dwl
|
||||
Install these (and their `-devel` versions if your distro has separate
|
||||
development packages) and run `make`. If you wish to build against a released
|
||||
version of wlroots (*you probably do*), use a [release] or a [0.x branch]. If
|
||||
you want to use the unstable development `main` branch, you need to use the git
|
||||
version of [wlroots].
|
||||
|
||||
dwl has only two dependencies: wlroots and wayland-protocols. Simply install these (and their `-devel` versions if your distro has separate development packages) and run `make`. If you wish to build against a Git version of wlroots, check out the [wlroots-next branch](https://github.com/djpohly/dwl/tree/wlroots-next).
|
||||
|
||||
To enable XWayland, you should also install xorg-xwayland and uncomment its flag in `config.mk`.
|
||||
To enable XWayland, you should uncomment its flags in `config.mk`.
|
||||
|
||||
## Configuration
|
||||
|
||||
All configuration is done by editing `config.h` and recompiling, in the same manner as dwm. There is no way to separately restart the window manager in Wayland without restarting the entire display server, so any changes will take effect the next time dwl is executed.
|
||||
All configuration is done by editing `config.h` and recompiling, in the same
|
||||
manner as dwm. There is no way to separately restart the window manager in
|
||||
Wayland without restarting the entire display server, so any changes will take
|
||||
effect the next time dwl is executed.
|
||||
|
||||
As in the dwm community, we encourage users to share patches they have created. Check out the [patches page on our wiki](https://github.com/djpohly/dwl/wiki/Patches)!
|
||||
As in the dwm community, we encourage users to share patches they have
|
||||
created. Check out the [dwl-patches] repository!
|
||||
|
||||
## Running dwl
|
||||
|
||||
dwl can be run on any of the backends supported by wlroots. This means you can run it as a separate window inside either an X11 or Wayland session, as well as directly from a VT console. Depending on your distro's setup, you may need to add your user to the `video` and `input` groups before you can run dwl on a VT.
|
||||
dwl can be run on any of the backends supported by wlroots. This means you can
|
||||
run it as a separate window inside either an X11 or Wayland session, as well as
|
||||
directly from a VT console. Depending on your distro's setup, you may need to
|
||||
add your user to the `video` and `input` groups before you can run dwl on a
|
||||
VT. If you are using `elogind` or `systemd-logind` you need to install polkit;
|
||||
otherwise you need to add yourself in the `seat` group and enable/start the
|
||||
seatd daemon.
|
||||
|
||||
When dwl is run with no arguments, it will launch the server and begin handling any shortcuts configured in `config.h`. There is no status bar or other decoration initially; these are instead clients that can be run within the Wayland session.
|
||||
When dwl is run with no arguments, it will launch the server and begin handling
|
||||
any shortcuts configured in `config.h`. There is no status bar or other
|
||||
decoration initially; these are instead clients that can be run within the
|
||||
Wayland session. Do note that the default background color is black. This can be
|
||||
modified in `config.h`.
|
||||
|
||||
If you would like to run a script or command automatically at startup, you can specify the command using the `-s` option. This command will be executed as a shell command using `/bin/sh -c`. It serves a similar function to `.xinitrc`, but differs in that the display server will not shut down when this process terminates. Instead, dwl will send this process a SIGTERM at shutdown and wait for it to terminate (if it hasn't already). This makes it ideal for execing into a user service manager like [s6](https://skarnet.org/software/s6/), [anopa](https://jjacky.com/anopa/), [runit](http://smarden.org/runit/faq.html#userservices), or [`systemd --user`](https://wiki.archlinux.org/title/Systemd/User).
|
||||
If you would like to run a script or command automatically at startup, you can
|
||||
specify the command using the `-s` option. This command will be executed as a
|
||||
shell command using `/bin/sh -c`. It serves a similar function to `.xinitrc`,
|
||||
but differs in that the display server will not shut down when this process
|
||||
terminates. Instead, dwl will send this process a SIGTERM at shutdown and wait
|
||||
for it to terminate (if it hasn't already). This makes it ideal for execing into
|
||||
a user service manager like [s6], [anopa], [runit], [dinit], or [`systemd
|
||||
--user`].
|
||||
|
||||
Note: The `-s` command is run as a *child process* of dwl, which means that it does not have the ability to affect the environment of dwl or of any processes that it spawns. If you need to set environment variables that affect the entire dwl session, these must be set prior to running dwl. For example, Wayland requires a valid `XDG_RUNTIME_DIR`, which is usually set up by a session manager such as `elogind` or `systemd-logind`. If your system doesn't do this automatically, you will need to configure it prior to launching `dwl`, e.g.:
|
||||
Note: The `-s` command is run as a *child process* of dwl, which means that it
|
||||
does not have the ability to affect the environment of dwl or of any processes
|
||||
that it spawns. If you need to set environment variables that affect the entire
|
||||
dwl session, these must be set prior to running dwl. For example, Wayland
|
||||
requires a valid `XDG_RUNTIME_DIR`, which is usually set up by a session manager
|
||||
such as `elogind` or `systemd-logind`. If your system doesn't do this
|
||||
automatically, you will need to configure it prior to launching `dwl`, e.g.:
|
||||
|
||||
export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u)
|
||||
mkdir -p $XDG_RUNTIME_DIR
|
||||
|
@ -63,28 +102,100 @@ Note: The `-s` command is run as a *child process* of dwl, which means that it d
|
|||
|
||||
### Status information
|
||||
|
||||
Information about selected layouts, current window title, and selected/occupied/urgent tags is written to the stdin of the `-s` command (see the `printstatus()` function for details). This information can be used to populate an external status bar with a script that parses the information. Failing to read this information will cause dwl to block, so if you do want to run a startup command that does not consume the status information, you can close standard input with the `<&-` shell redirection, for example:
|
||||
Information about selected layouts, current window title, app-id, and
|
||||
selected/occupied/urgent tags is written to the stdin of the `-s` command (see
|
||||
the `printstatus()` function for details). This information can be used to
|
||||
populate an external status bar with a script that parses the
|
||||
information. Failing to read this information will cause dwl to block, so if you
|
||||
do want to run a startup command that does not consume the status information,
|
||||
you can close standard input with the `<&-` shell redirection, for example:
|
||||
|
||||
dwl -s 'foot --server <&-'
|
||||
|
||||
If your startup command is a shell script, you can achieve the same inside the script with the line
|
||||
If your startup command is a shell script, you can achieve the same inside the
|
||||
script with the line
|
||||
|
||||
exec <&-
|
||||
|
||||
To get a list of status bars that work with dwl consult our [wiki].
|
||||
|
||||
## Replacements for X applications
|
||||
|
||||
You can find a [list of Wayland applications on the sway wiki](https://github.com/swaywm/sway/wiki/i3-Migration-Guide).
|
||||
You can find a [list of useful resources on our wiki].
|
||||
|
||||
## IRC channel
|
||||
## Background
|
||||
|
||||
dwl's IRC channel is #dwl on irc.libera.chat.
|
||||
dwl is not meant to provide every feature under the sun. Instead, like dwm, it
|
||||
sticks to features which are necessary, simple, and straightforward to implement
|
||||
given the base on which it is built. Implemented default features are:
|
||||
|
||||
- Any features provided by dwm/Xlib: simple window borders, tags, keybindings,
|
||||
client rules, mouse move/resize. Providing a built-in status bar is an
|
||||
exception to this goal, to avoid dependencies on font rendering and/or drawing
|
||||
libraries when an external bar could work well.
|
||||
- Configurable multi-monitor layout support, including position and rotation
|
||||
- Configurable HiDPI/multi-DPI support
|
||||
- Idle-inhibit protocol which lets applications such as mpv disable idle
|
||||
monitoring
|
||||
- Provide information to external status bars via stdout/stdin
|
||||
- Urgency hints via xdg-activate protocol
|
||||
- Support screen lockers via ext-session-lock-v1 protocol
|
||||
- Various Wayland protocols
|
||||
- XWayland support as provided by wlroots (can be enabled in `config.mk`)
|
||||
- Zero flickering - Wayland users naturally expect that "every frame is perfect"
|
||||
- Layer shell popups (used by Waybar)
|
||||
- Damage tracking provided by scenegraph API
|
||||
|
||||
Given the Wayland architecture, dwl has to implement features from dwm **and**
|
||||
the xorg-server. Because of this, it is impossible to maintain the original
|
||||
project goal of 2000 SLOC and have a reasonably complete compositor with
|
||||
features comparable to dwm. However, this does not mean that the code will grow
|
||||
indiscriminately. We will try to keep the code as small as possible.
|
||||
|
||||
Features under consideration (possibly as patches) are:
|
||||
|
||||
- Protocols made trivial by wlroots
|
||||
- Implement the text-input and input-method protocols to support IME once ibus
|
||||
implements input-method v2 (see https://github.com/ibus/ibus/pull/2256 and
|
||||
https://codeberg.org/dwl/dwl/pulls/235)
|
||||
|
||||
Feature *non-goals* for the main codebase include:
|
||||
|
||||
- Client-side decoration (any more than is necessary to tell the clients not to)
|
||||
- Client-initiated window management, such as move, resize, and close, which can
|
||||
be done through the compositor
|
||||
- Animations and visual effects
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
dwl began by extending the TinyWL example provided (CC0) by the sway/wlroots developers. This was made possible in many cases by looking at how sway accomplished something, then trying to do the same in as suckless a way as possible.
|
||||
dwl began by extending the TinyWL example provided (CC0) by the sway/wlroots
|
||||
developers. This was made possible in many cases by looking at how sway
|
||||
accomplished something, then trying to do the same in as suckless a way as
|
||||
possible.
|
||||
|
||||
Many thanks to suckless.org and the dwm developers and community for the inspiration, and to the various contributors to the project, including:
|
||||
Many thanks to suckless.org and the dwm developers and community for the
|
||||
inspiration, and to the various contributors to the project, including:
|
||||
|
||||
- **Devin J. Pohly for creating and nurturing the fledgling project**
|
||||
- Alexander Courtis for the XWayland implementation
|
||||
- Guido Cella for the layer-shell protocol implementation, patch maintenance, and for helping to keep the project running
|
||||
- Guido Cella for the layer-shell protocol implementation, patch maintenance,
|
||||
and for helping to keep the project running
|
||||
- Stivvo for output management and fullscreen support, and patch maintenance
|
||||
|
||||
|
||||
[`systemd --user`]: https://wiki.archlinux.org/title/Systemd/User
|
||||
[#dwl on Libera Chat]: https://web.libera.chat/?channels=#dwl
|
||||
[0.7-rc1]: https://codeberg.org/dwl/dwl/releases/tag/v0.7-rc1
|
||||
[0.x branch]: https://codeberg.org/dwl/dwl/branches
|
||||
[anopa]: https://jjacky.com/anopa/
|
||||
[dinit]: https://davmac.org/projects/dinit/
|
||||
[dwl-patches]: https://codeberg.org/dwl/dwl-patches
|
||||
[list of useful resources on our wiki]: https://codeberg.org/dwl/dwl/wiki/Home#migrating-from-x
|
||||
[main]: https://codeberg.org/dwl/dwl/src/branch/main
|
||||
[release]: https://codeberg.org/dwl/dwl/releases
|
||||
[runit]: http://smarden.org/runit/faq.html#userservices
|
||||
[s6]: https://skarnet.org/software/s6/
|
||||
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots/
|
||||
[wiki]: https://codeberg.org/dwl/dwl/wiki/Home#compatible-status-bars
|
||||
[Discord server]: https://discord.gg/jJxZnrGPWN
|
||||
[Wayland]: https://wayland.freedesktop.org/
|
||||
|
|
330
client.h
330
client.h
|
@ -10,10 +10,9 @@ static inline int
|
|||
client_is_x11(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
return c->type == X11Managed || c->type == X11Unmanaged;
|
||||
#else
|
||||
return 0;
|
||||
return c->type == X11;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline struct wlr_surface *
|
||||
|
@ -26,34 +25,100 @@ client_surface(Client *c)
|
|||
return c->surface.xdg->surface;
|
||||
}
|
||||
|
||||
static inline int
|
||||
toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
|
||||
{
|
||||
struct wlr_xdg_surface *xdg_surface, *tmp_xdg_surface;
|
||||
struct wlr_surface *root_surface;
|
||||
struct wlr_layer_surface_v1 *layer_surface;
|
||||
Client *c = NULL;
|
||||
LayerSurface *l = NULL;
|
||||
int type = -1;
|
||||
#ifdef XWAYLAND
|
||||
struct wlr_xwayland_surface *xsurface;
|
||||
#endif
|
||||
|
||||
if (!s)
|
||||
return -1;
|
||||
root_surface = wlr_surface_get_root_surface(s);
|
||||
|
||||
#ifdef XWAYLAND
|
||||
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(root_surface))) {
|
||||
c = xsurface->data;
|
||||
type = c->type;
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((layer_surface = wlr_layer_surface_v1_try_from_wlr_surface(root_surface))) {
|
||||
l = layer_surface->data;
|
||||
type = LayerShell;
|
||||
goto end;
|
||||
}
|
||||
|
||||
xdg_surface = wlr_xdg_surface_try_from_wlr_surface(root_surface);
|
||||
while (xdg_surface) {
|
||||
tmp_xdg_surface = NULL;
|
||||
switch (xdg_surface->role) {
|
||||
case WLR_XDG_SURFACE_ROLE_POPUP:
|
||||
if (!xdg_surface->popup || !xdg_surface->popup->parent)
|
||||
return -1;
|
||||
|
||||
tmp_xdg_surface = wlr_xdg_surface_try_from_wlr_surface(xdg_surface->popup->parent);
|
||||
|
||||
if (!tmp_xdg_surface)
|
||||
return toplevel_from_wlr_surface(xdg_surface->popup->parent, pc, pl);
|
||||
|
||||
xdg_surface = tmp_xdg_surface;
|
||||
break;
|
||||
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
||||
c = xdg_surface->data;
|
||||
type = c->type;
|
||||
goto end;
|
||||
case WLR_XDG_SURFACE_ROLE_NONE:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
if (pl)
|
||||
*pl = l;
|
||||
if (pc)
|
||||
*pc = c;
|
||||
return type;
|
||||
}
|
||||
|
||||
/* The others */
|
||||
static inline void
|
||||
client_activate_surface(struct wlr_surface *s, int activated)
|
||||
{
|
||||
struct wlr_xdg_surface *surface;
|
||||
struct wlr_xdg_toplevel *toplevel;
|
||||
#ifdef XWAYLAND
|
||||
struct wlr_xwayland_surface *xsurface;
|
||||
if (wlr_surface_is_xwayland_surface(s)
|
||||
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(s))) {
|
||||
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) {
|
||||
wlr_xwayland_surface_activate(xsurface, activated);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (wlr_surface_is_xdg_surface(s)
|
||||
&& (surface = wlr_xdg_surface_from_wlr_surface(s))
|
||||
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
|
||||
wlr_xdg_toplevel_set_activated(surface, activated);
|
||||
if ((toplevel = wlr_xdg_toplevel_try_from_wlr_surface(s)))
|
||||
wlr_xdg_toplevel_set_activated(toplevel, activated);
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_for_each_surface(Client *c, wlr_surface_iterator_func_t fn, void *data)
|
||||
static inline uint32_t
|
||||
client_set_bounds(Client *c, int32_t width, int32_t height)
|
||||
{
|
||||
wlr_surface_for_each_surface(client_surface(c), fn, data);
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return;
|
||||
return 0;
|
||||
#endif
|
||||
wlr_xdg_surface_for_each_popup_surface(c->surface.xdg, fn, data);
|
||||
if (wl_resource_get_version(c->surface.xdg->toplevel->resource) >=
|
||||
XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION && width >= 0 && height >= 0
|
||||
&& (c->bounds.width != width || c->bounds.height != height)) {
|
||||
c->bounds.width = width;
|
||||
c->bounds.height = height;
|
||||
return wlr_xdg_toplevel_set_bounds(c->surface.xdg->toplevel, width, height);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline const char *
|
||||
|
@ -66,6 +131,27 @@ client_get_appid(Client *c)
|
|||
return c->surface.xdg->toplevel->app_id;
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_get_clip(Client *c, struct wlr_box *clip)
|
||||
{
|
||||
struct wlr_box xdg_geom = {0};
|
||||
*clip = (struct wlr_box){
|
||||
.x = 0,
|
||||
.y = 0,
|
||||
.width = c->geom.width - c->bw,
|
||||
.height = c->geom.height - c->bw,
|
||||
};
|
||||
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return;
|
||||
#endif
|
||||
|
||||
wlr_xdg_surface_get_geometry(c->surface.xdg, &xdg_geom);
|
||||
clip->x = xdg_geom.x;
|
||||
clip->y = xdg_geom.y;
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_get_geometry(Client *c, struct wlr_box *geom)
|
||||
{
|
||||
|
@ -81,6 +167,34 @@ client_get_geometry(Client *c, struct wlr_box *geom)
|
|||
wlr_xdg_surface_get_geometry(c->surface.xdg, geom);
|
||||
}
|
||||
|
||||
static inline Client *
|
||||
client_get_parent(Client *c)
|
||||
{
|
||||
Client *p = NULL;
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
if (c->surface.xwayland->parent)
|
||||
toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
if (c->surface.xdg->toplevel->parent)
|
||||
toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
|
||||
return p;
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_has_children(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return !wl_list_empty(&c->surface.xwayland->children);
|
||||
#endif
|
||||
/* surface.xdg->link is never empty because it always contains at least the
|
||||
* surface itself. */
|
||||
return wl_list_length(&c->surface.xdg->link) > 1;
|
||||
}
|
||||
|
||||
static inline const char *
|
||||
client_get_title(Client *c)
|
||||
{
|
||||
|
@ -100,54 +214,104 @@ client_is_float_type(Client *c)
|
|||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
||||
struct wlr_xwayland_surface_size_hints *size_hints;
|
||||
xcb_size_hints_t *size_hints = surface->size_hints;
|
||||
size_t i;
|
||||
if (surface->modal)
|
||||
return 1;
|
||||
|
||||
for (size_t i = 0; i < surface->window_type_len; i++)
|
||||
if (surface->window_type[i] == netatom[NetWMWindowTypeDialog] ||
|
||||
surface->window_type[i] == netatom[NetWMWindowTypeSplash] ||
|
||||
surface->window_type[i] == netatom[NetWMWindowTypeToolbar] ||
|
||||
surface->window_type[i] == netatom[NetWMWindowTypeUtility])
|
||||
for (i = 0; i < surface->window_type_len; i++)
|
||||
if (surface->window_type[i] == netatom[NetWMWindowTypeDialog]
|
||||
|| surface->window_type[i] == netatom[NetWMWindowTypeSplash]
|
||||
|| surface->window_type[i] == netatom[NetWMWindowTypeToolbar]
|
||||
|| surface->window_type[i] == netatom[NetWMWindowTypeUtility])
|
||||
return 1;
|
||||
|
||||
size_hints = surface->size_hints;
|
||||
if (size_hints && size_hints->min_width > 0 && size_hints->min_height > 0
|
||||
&& (size_hints->max_width == size_hints->min_width ||
|
||||
size_hints->max_height == size_hints->min_height))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
return size_hints && size_hints->min_width > 0 && size_hints->min_height > 0
|
||||
&& (size_hints->max_width == size_hints->min_width
|
||||
|| size_hints->max_height == size_hints->min_height);
|
||||
}
|
||||
#endif
|
||||
|
||||
toplevel = c->surface.xdg->toplevel;
|
||||
state = toplevel->current;
|
||||
return (state.min_width != 0 && state.min_height != 0
|
||||
return toplevel->parent || (state.min_width != 0 && state.min_height != 0
|
||||
&& (state.min_width == state.max_width
|
||||
|| state.min_height == state.max_height))
|
||||
|| toplevel->parent;
|
||||
|| state.min_height == state.max_height));
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_wants_fullscreen(Client *c)
|
||||
client_is_rendered_on_mon(Client *c, Monitor *m)
|
||||
{
|
||||
/* This is needed for when you don't want to check formal assignment,
|
||||
* but rather actual displaying of the pixels.
|
||||
* Usually VISIBLEON suffices and is also faster. */
|
||||
struct wlr_surface_output *s;
|
||||
int unused_lx, unused_ly;
|
||||
if (!wlr_scene_node_coords(&c->scene->node, &unused_lx, &unused_ly))
|
||||
return 0;
|
||||
wl_list_for_each(s, &client_surface(c)->current_outputs, link)
|
||||
if (s->output == m->wlr_output)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_is_stopped(Client *c)
|
||||
{
|
||||
int pid;
|
||||
siginfo_t in = {0};
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->fullscreen;
|
||||
return 0;
|
||||
#endif
|
||||
return c->surface.xdg->toplevel->requested.fullscreen;
|
||||
|
||||
wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
|
||||
if (waitid(P_PID, pid, &in, WNOHANG|WCONTINUED|WSTOPPED|WNOWAIT) < 0) {
|
||||
/* This process is not our child process, while is very unluckely that
|
||||
* it is stopped, in order to do not skip frames assume that it is. */
|
||||
if (errno == ECHILD)
|
||||
return 1;
|
||||
} else if (in.si_pid) {
|
||||
if (in.si_code == CLD_STOPPED || in.si_code == CLD_TRAPPED)
|
||||
return 1;
|
||||
if (in.si_code == CLD_CONTINUED)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_is_unmanaged(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
return c->type == X11Unmanaged;
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->override_redirect;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_notify_enter(struct wlr_surface *s, struct wlr_keyboard *kb)
|
||||
{
|
||||
if (kb)
|
||||
wlr_seat_keyboard_notify_enter(seat, s, kb->keycodes,
|
||||
kb->num_keycodes, &kb->modifiers);
|
||||
else
|
||||
wlr_seat_keyboard_notify_enter(seat, s, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_restack_surface(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
wlr_xwayland_surface_restack(c->surface.xwayland, NULL,
|
||||
XCB_STACK_MODE_ABOVE);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_send_close(Client *c)
|
||||
{
|
||||
|
@ -157,7 +321,15 @@ client_send_close(Client *c)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
wlr_xdg_toplevel_send_close(c->surface.xdg);
|
||||
wlr_xdg_toplevel_send_close(c->surface.xdg->toplevel);
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_set_border_color(Client *c, const float color[static 4])
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 4; i++)
|
||||
wlr_scene_rect_set_color(c->border[i], color);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -169,7 +341,7 @@ client_set_fullscreen(Client *c, int fullscreen)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg, fullscreen);
|
||||
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg->toplevel, fullscreen);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
|
@ -178,11 +350,14 @@ client_set_size(Client *c, uint32_t width, uint32_t height)
|
|||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
wlr_xwayland_surface_configure(c->surface.xwayland,
|
||||
c->geom.x, c->geom.y, width, height);
|
||||
c->geom.x + c->bw, c->geom.y + c->bw, width, height);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return wlr_xdg_toplevel_set_size(c->surface.xdg, width, height);
|
||||
if ((int32_t)width == c->surface.xdg->toplevel->current.width
|
||||
&& (int32_t)height == c->surface.xdg->toplevel->current.height)
|
||||
return 0;
|
||||
return wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, (int32_t)width, (int32_t)height);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -192,69 +367,42 @@ client_set_tiled(Client *c, uint32_t edges)
|
|||
if (client_is_x11(c))
|
||||
return;
|
||||
#endif
|
||||
wlr_xdg_toplevel_set_tiled(c->surface.xdg, edges);
|
||||
}
|
||||
|
||||
static inline struct wlr_surface *
|
||||
client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return wlr_surface_surface_at(c->surface.xwayland->surface,
|
||||
cx, cy, sx, sy);
|
||||
#endif
|
||||
return wlr_xdg_surface_surface_at(c->surface.xdg, cx, cy, sx, sy);
|
||||
if (wl_resource_get_version(c->surface.xdg->toplevel->resource)
|
||||
>= XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) {
|
||||
wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges);
|
||||
} else {
|
||||
wlr_xdg_toplevel_set_maximized(c->surface.xdg->toplevel, edges != WLR_EDGE_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_min_size(Client *c, int *width, int *height)
|
||||
client_set_suspended(Client *c, int suspended)
|
||||
{
|
||||
struct wlr_xdg_toplevel *toplevel;
|
||||
struct wlr_xdg_toplevel_state *state;
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
struct wlr_xwayland_surface_size_hints *size_hints;
|
||||
size_hints = c->surface.xwayland->size_hints;
|
||||
if (size_hints) {
|
||||
*width = size_hints->min_width;
|
||||
*height = size_hints->min_height;
|
||||
} else {
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
}
|
||||
if (client_is_x11(c))
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
toplevel = c->surface.xdg->toplevel;
|
||||
state = &toplevel->current;
|
||||
*width = state->min_width;
|
||||
*height = state->min_height;
|
||||
|
||||
wlr_xdg_toplevel_set_suspended(c->surface.xdg->toplevel, suspended);
|
||||
}
|
||||
|
||||
static inline Client *
|
||||
client_from_wlr_surface(struct wlr_surface *surface)
|
||||
static inline int
|
||||
client_wants_focus(Client *c)
|
||||
{
|
||||
struct wlr_scene_node *n = surface->data;
|
||||
return n ? n->data : NULL;
|
||||
#ifdef XWAYLAND
|
||||
return client_is_unmanaged(c)
|
||||
&& wlr_xwayland_or_surface_wants_focus(c->surface.xwayland)
|
||||
&& wlr_xwayland_icccm_input_model(c->surface.xwayland) != WLR_ICCCM_INPUT_MODEL_NONE;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline Client *
|
||||
client_from_popup(struct wlr_xdg_popup *popup)
|
||||
static inline int
|
||||
client_wants_fullscreen(Client *c)
|
||||
{
|
||||
struct wlr_xdg_surface *surface = popup->base;
|
||||
|
||||
while (1) {
|
||||
switch (surface->role) {
|
||||
case WLR_XDG_SURFACE_ROLE_POPUP:
|
||||
if (!wlr_surface_is_xdg_surface(surface->popup->parent))
|
||||
return NULL;
|
||||
|
||||
surface = wlr_xdg_surface_from_wlr_surface(surface->popup->parent);
|
||||
break;
|
||||
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
||||
return surface->data;
|
||||
case WLR_XDG_SURFACE_ROLE_NONE:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->fullscreen;
|
||||
#endif
|
||||
return c->surface.xdg->toplevel->requested.fullscreen;
|
||||
}
|
||||
|
|
1
compile_commands.json
Normal file
1
compile_commands.json
Normal file
|
@ -0,0 +1 @@
|
|||
[]
|
98
config.def.h
98
config.def.h
|
@ -1,20 +1,37 @@
|
|||
/* Taken from https://github.com/djpohly/dwl/issues/466 */
|
||||
#define COLOR(hex) { ((hex >> 24) & 0xFF) / 255.0f, \
|
||||
((hex >> 16) & 0xFF) / 255.0f, \
|
||||
((hex >> 8) & 0xFF) / 255.0f, \
|
||||
(hex & 0xFF) / 255.0f }
|
||||
/* appearance */
|
||||
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 unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
||||
static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0};
|
||||
static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0};
|
||||
static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0};
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char *fonts[] = {"monospace:size=10"};
|
||||
static const float rootcolor[] = COLOR(0x000000ff);
|
||||
/* 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 uint32_t colors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { 0xbbbbbbff, 0x222222ff, 0x444444ff },
|
||||
[SchemeSel] = { 0xeeeeeeff, 0x005577ff, 0x005577ff },
|
||||
[SchemeUrg] = { 0, 0, 0x770000ff },
|
||||
};
|
||||
|
||||
/* tagging */
|
||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||
static char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
|
||||
/* logging */
|
||||
static int log_level = WLR_ERROR;
|
||||
|
||||
/* 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 monitor */
|
||||
/* examples:
|
||||
{ "Gimp", NULL, 0, 1, -1 },
|
||||
*/
|
||||
{ "firefox", NULL, 1 << 8, 0, -1 },
|
||||
/* examples: */
|
||||
{ "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
|
||||
{ "discord", NULL, 1 << 1, 0, 1 }, /* Start on ONLY tag "9" */
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
|
@ -26,13 +43,20 @@ static const Layout layouts[] = {
|
|||
};
|
||||
|
||||
/* monitors */
|
||||
/* (x=-1, y=-1) is reserved as an "autoconfigure" monitor position indicator
|
||||
* WARNING: negative values other than (-1, -1) cause problems with Xwayland clients
|
||||
* https://gitlab.freedesktop.org/xorg/xserver/-/issues/899
|
||||
*/
|
||||
/* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */
|
||||
static const MonitorRule monrules[] = {
|
||||
/* name mfact nmaster scale layout rotate/reflect */
|
||||
/* name mfact nmaster scale layout rotate/reflect x y */
|
||||
/* example of a HiDPI laptop monitor:
|
||||
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
|
||||
{ "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
||||
*/
|
||||
{ "HDMI-A-1", 0.5f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0 },
|
||||
{ "DP-1", 0.5f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 1920, 0 },
|
||||
/* defaults */
|
||||
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
|
||||
{ NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
||||
};
|
||||
|
||||
/* keyboard */
|
||||
|
@ -41,7 +65,7 @@ static const struct xkb_rule_names xkb_rules = {
|
|||
/* example:
|
||||
.options = "ctrl:nocaps",
|
||||
*/
|
||||
.options = "",
|
||||
.options = NULL,
|
||||
};
|
||||
|
||||
static const int repeat_rate = 25;
|
||||
|
@ -62,12 +86,21 @@ LIBINPUT_CONFIG_SCROLL_EDGE
|
|||
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN
|
||||
*/
|
||||
static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
|
||||
|
||||
/* You can choose between:
|
||||
LIBINPUT_CONFIG_CLICK_METHOD_NONE
|
||||
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS
|
||||
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER
|
||||
*/
|
||||
static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
|
||||
|
||||
/* You can choose between:
|
||||
LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
|
||||
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED
|
||||
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE
|
||||
*/
|
||||
static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
|
||||
|
||||
/* You can choose between:
|
||||
LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT
|
||||
LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
|
||||
|
@ -75,8 +108,15 @@ LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
|
|||
static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
|
||||
static const double accel_speed = 0.0;
|
||||
|
||||
/* If you want to use the windows key change this to WLR_MODIFIER_LOGO */
|
||||
#define MODKEY WLR_MODIFIER_ALT
|
||||
/* You can choose between:
|
||||
LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
|
||||
LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
|
||||
*/
|
||||
static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
|
||||
|
||||
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
|
||||
#define MODKEY WLR_MODIFIER_LOGO
|
||||
|
||||
#define TAGKEYS(KEY,SKEY,TAG) \
|
||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||
|
@ -87,20 +127,21 @@ static const double accel_speed = 0.0;
|
|||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
|
||||
/* commands */
|
||||
static const char *termcmd[] = { "alacritty", NULL };
|
||||
static const char *menucmd[] = { "bemenu-run", NULL };
|
||||
static const char *termcmd[] = { "kitty", NULL };
|
||||
static const char *menucmd[] = { "wmenu-run", NULL };
|
||||
|
||||
static const Key keys[] = {
|
||||
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
|
||||
/* modifier key function argument */
|
||||
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
||||
{ MODKEY, XKB_KEY_b, togglebar, {0} },
|
||||
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
||||
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} },
|
||||
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} },
|
||||
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
||||
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
||||
{ MODKEY, XKB_KEY_Return, zoom, {0} },
|
||||
{ MODKEY, XKB_KEY_Tab, view, {0} },
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
|
||||
|
@ -129,13 +170,24 @@ static const Key keys[] = {
|
|||
|
||||
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
|
||||
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
|
||||
/* Ctrl-Alt-Fx is used to switch to another VT, if you don't know what a VT is
|
||||
* do not remove them.
|
||||
*/
|
||||
#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
|
||||
CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
|
||||
CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
|
||||
};
|
||||
|
||||
static const Button buttons[] = {
|
||||
{ MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
|
||||
{ MODKEY, BTN_MIDDLE, togglefloating, {0} },
|
||||
{ MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
|
||||
{ ClkLtSymbol, 0, BTN_LEFT, setlayout, {.v = &layouts[0]} },
|
||||
{ ClkLtSymbol, 0, BTN_RIGHT, setlayout, {.v = &layouts[2]} },
|
||||
{ ClkTitle, 0, BTN_MIDDLE, zoom, {0} },
|
||||
{ ClkStatus, 0, BTN_MIDDLE, spawn, {.v = termcmd} },
|
||||
{ ClkClient, MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
|
||||
{ ClkClient, MODKEY, BTN_MIDDLE, togglefloating, {0} },
|
||||
{ ClkClient, MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
|
||||
{ ClkTagBar, 0, BTN_LEFT, view, {0} },
|
||||
{ ClkTagBar, 0, BTN_RIGHT, toggleview, {0} },
|
||||
{ ClkTagBar, MODKEY, BTN_LEFT, tag, {0} },
|
||||
{ ClkTagBar, MODKEY, BTN_RIGHT, toggletag, {0} },
|
||||
};
|
||||
|
|
17
config.mk
17
config.mk
|
@ -1,12 +1,17 @@
|
|||
_VERSION = 0.3.1
|
||||
VERSION = $(shell ./generate-version.sh $(_VERSION))
|
||||
_VERSION = 0.7
|
||||
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
|
||||
|
||||
PKG_CONFIG = pkg-config
|
||||
|
||||
# paths
|
||||
PREFIX = /usr/local
|
||||
MANDIR = $(PREFIX)/share/man
|
||||
DATADIR = $(PREFIX)/share
|
||||
|
||||
# Default compile flags (overridable by environment)
|
||||
CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement
|
||||
|
||||
XWAYLAND =
|
||||
XLIBS =
|
||||
# Uncomment to build XWayland support
|
||||
#CFLAGS += -DXWAYLAND
|
||||
#XWAYLAND = -DXWAYLAND
|
||||
#XLIBS = xcb xcb-icccm
|
||||
|
||||
CC = gcc
|
||||
|
|
311
drwl.h
Normal file
311
drwl.h
Normal file
|
@ -0,0 +1,311 @@
|
|||
/*
|
||||
* drwl - https://codeberg.org/sewn/drwl
|
||||
*
|
||||
* Copyright (c) 2023-2024 sewn <sewn@disroot.org>
|
||||
* Copyright (c) 2024 notchoc <notchoc@disroot.org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* The UTF-8 Decoder included is from Bjoern Hoehrmann:
|
||||
* Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>
|
||||
* See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <fcft/fcft.h>
|
||||
#include <pixman-1/pixman.h>
|
||||
|
||||
enum { ColFg, ColBg, ColBorder }; /* colorscheme index */
|
||||
|
||||
typedef struct fcft_font Fnt;
|
||||
typedef pixman_image_t Img;
|
||||
|
||||
typedef struct {
|
||||
Img *image;
|
||||
Fnt *font;
|
||||
uint32_t *scheme;
|
||||
} Drwl;
|
||||
|
||||
#define UTF8_ACCEPT 0
|
||||
#define UTF8_REJECT 12
|
||||
#define UTF8_INVALID 0xFFFD
|
||||
|
||||
static const uint8_t utf8d[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
|
||||
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
|
||||
8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
||||
10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
|
||||
|
||||
0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12,
|
||||
12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,
|
||||
12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,
|
||||
12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,
|
||||
12,36,12,12,12,12,12,12,12,12,12,12,
|
||||
};
|
||||
|
||||
static inline uint32_t
|
||||
utf8decode(uint32_t *state, uint32_t *codep, uint8_t byte)
|
||||
{
|
||||
uint32_t type = utf8d[byte];
|
||||
|
||||
*codep = (*state != UTF8_ACCEPT) ?
|
||||
(byte & 0x3fu) | (*codep << 6) :
|
||||
(0xff >> type) & (byte);
|
||||
|
||||
*state = utf8d[256 + *state + type];
|
||||
return *state;
|
||||
}
|
||||
|
||||
static int
|
||||
drwl_init(void)
|
||||
{
|
||||
fcft_set_scaling_filter(FCFT_SCALING_FILTER_LANCZOS3);
|
||||
return fcft_init(FCFT_LOG_COLORIZE_AUTO, 0, FCFT_LOG_CLASS_ERROR);
|
||||
}
|
||||
|
||||
static Drwl *
|
||||
drwl_create(void)
|
||||
{
|
||||
Drwl *drwl;
|
||||
|
||||
if (!(drwl = calloc(1, sizeof(Drwl))))
|
||||
return NULL;
|
||||
|
||||
return drwl;
|
||||
}
|
||||
|
||||
static void
|
||||
drwl_setfont(Drwl *drwl, Fnt *font)
|
||||
{
|
||||
if (drwl)
|
||||
drwl->font = font;
|
||||
}
|
||||
|
||||
static void
|
||||
drwl_setimage(Drwl *drwl, Img *image)
|
||||
{
|
||||
if (drwl)
|
||||
drwl->image = image;
|
||||
}
|
||||
|
||||
static Fnt *
|
||||
drwl_font_create(Drwl *drwl, size_t count,
|
||||
const char *names[static count], const char *attributes)
|
||||
{
|
||||
Fnt *font = fcft_from_name(count, names, attributes);
|
||||
if (drwl)
|
||||
drwl_setfont(drwl, font);
|
||||
return font;
|
||||
}
|
||||
|
||||
static void
|
||||
drwl_font_destroy(Fnt *font)
|
||||
{
|
||||
fcft_destroy(font);
|
||||
}
|
||||
|
||||
static inline pixman_color_t
|
||||
convert_color(uint32_t clr)
|
||||
{
|
||||
return (pixman_color_t){
|
||||
((clr >> 24) & 0xFF) * 0x101 * (clr & 0xFF) / 0xFF,
|
||||
((clr >> 16) & 0xFF) * 0x101 * (clr & 0xFF) / 0xFF,
|
||||
((clr >> 8) & 0xFF) * 0x101 * (clr & 0xFF) / 0xFF,
|
||||
(clr & 0xFF) * 0x101
|
||||
};
|
||||
}
|
||||
|
||||
static void
|
||||
drwl_setscheme(Drwl *drwl, uint32_t *scm)
|
||||
{
|
||||
if (drwl)
|
||||
drwl->scheme = scm;
|
||||
}
|
||||
|
||||
static Img *
|
||||
drwl_image_create(Drwl *drwl, unsigned int w, unsigned int h, uint32_t *bits)
|
||||
{
|
||||
Img *image;
|
||||
pixman_region32_t clip;
|
||||
|
||||
image = pixman_image_create_bits_no_clear(
|
||||
PIXMAN_a8r8g8b8, w, h, bits, w * 4);
|
||||
if (!image)
|
||||
return NULL;
|
||||
pixman_region32_init_rect(&clip, 0, 0, w, h);
|
||||
pixman_image_set_clip_region32(image, &clip);
|
||||
pixman_region32_fini(&clip);
|
||||
|
||||
if (drwl)
|
||||
drwl_setimage(drwl, image);
|
||||
return image;
|
||||
}
|
||||
|
||||
static void
|
||||
drwl_rect(Drwl *drwl,
|
||||
int x, int y, unsigned int w, unsigned int h,
|
||||
int filled, int invert)
|
||||
{
|
||||
pixman_color_t clr;
|
||||
if (!drwl || !drwl->scheme || !drwl->image)
|
||||
return;
|
||||
|
||||
clr = convert_color(drwl->scheme[invert ? ColBg : ColFg]);
|
||||
if (filled)
|
||||
pixman_image_fill_rectangles(PIXMAN_OP_SRC, drwl->image, &clr, 1,
|
||||
&(pixman_rectangle16_t){x, y, w, h});
|
||||
else
|
||||
pixman_image_fill_rectangles(PIXMAN_OP_SRC, drwl->image, &clr, 4,
|
||||
(pixman_rectangle16_t[4]){
|
||||
{ x, y, w, 1 },
|
||||
{ x, y + h - 1, w, 1 },
|
||||
{ x, y, 1, h },
|
||||
{ x + w - 1, y, 1, h }});
|
||||
}
|
||||
|
||||
static int
|
||||
drwl_text(Drwl *drwl,
|
||||
int x, int y, unsigned int w, unsigned int h,
|
||||
unsigned int lpad, const char *text, int invert)
|
||||
{
|
||||
int ty;
|
||||
int render = x || y || w || h;
|
||||
long x_kern;
|
||||
uint32_t cp = 0, last_cp = 0, state;
|
||||
pixman_color_t clr;
|
||||
pixman_image_t *fg_pix = NULL;
|
||||
int noellipsis = 0;
|
||||
const struct fcft_glyph *glyph, *eg = NULL;
|
||||
int fcft_subpixel_mode = FCFT_SUBPIXEL_DEFAULT;
|
||||
|
||||
if (!drwl || (render && (!drwl->scheme || !w || !drwl->image)) || !text || !drwl->font)
|
||||
return 0;
|
||||
|
||||
if (!render) {
|
||||
w = invert ? invert : ~invert;
|
||||
} else {
|
||||
clr = convert_color(drwl->scheme[invert ? ColBg : ColFg]);
|
||||
fg_pix = pixman_image_create_solid_fill(&clr);
|
||||
|
||||
drwl_rect(drwl, x, y, w, h, 1, !invert);
|
||||
|
||||
x += lpad;
|
||||
w -= lpad;
|
||||
}
|
||||
|
||||
if (render && (drwl->scheme[ColBg] & 0xFF) != 0xFF)
|
||||
fcft_subpixel_mode = FCFT_SUBPIXEL_NONE;
|
||||
|
||||
if (render)
|
||||
eg = fcft_rasterize_char_utf32(drwl->font, 0x2026 /* … */, fcft_subpixel_mode);
|
||||
|
||||
for (const char *p = text, *pp; pp = p, *p; p++) {
|
||||
for (state = UTF8_ACCEPT; *p &&
|
||||
utf8decode(&state, &cp, *p) > UTF8_REJECT; p++)
|
||||
;
|
||||
if (!*p || state == UTF8_REJECT) {
|
||||
cp = UTF8_INVALID;
|
||||
if (p > pp)
|
||||
p--;
|
||||
}
|
||||
|
||||
glyph = fcft_rasterize_char_utf32(drwl->font, cp, fcft_subpixel_mode);
|
||||
if (!glyph)
|
||||
continue;
|
||||
|
||||
x_kern = 0;
|
||||
if (last_cp)
|
||||
fcft_kerning(drwl->font, last_cp, cp, &x_kern, NULL);
|
||||
last_cp = cp;
|
||||
|
||||
ty = y + (h - drwl->font->height) / 2 + drwl->font->ascent;
|
||||
|
||||
if (render && !noellipsis && x_kern + glyph->advance.x + eg->advance.x > w &&
|
||||
*(p + 1) != '\0') {
|
||||
/* cannot fit ellipsis after current codepoint */
|
||||
if (drwl_text(drwl, 0, 0, 0, 0, 0, pp, 0) + x_kern <= w) {
|
||||
noellipsis = 1;
|
||||
} else {
|
||||
w -= eg->advance.x;
|
||||
pixman_image_composite32(
|
||||
PIXMAN_OP_OVER, fg_pix, eg->pix, drwl->image, 0, 0, 0, 0,
|
||||
x + eg->x, ty - eg->y, eg->width, eg->height);
|
||||
}
|
||||
}
|
||||
|
||||
if ((x_kern + glyph->advance.x) > w)
|
||||
break;
|
||||
|
||||
x += x_kern;
|
||||
|
||||
if (render && pixman_image_get_format(glyph->pix) == PIXMAN_a8r8g8b8)
|
||||
/* pre-rendered glyphs (eg. emoji) */
|
||||
pixman_image_composite32(
|
||||
PIXMAN_OP_OVER, glyph->pix, NULL, drwl->image, 0, 0, 0, 0,
|
||||
x + glyph->x, ty - glyph->y, glyph->width, glyph->height);
|
||||
else if (render)
|
||||
pixman_image_composite32(
|
||||
PIXMAN_OP_OVER, fg_pix, glyph->pix, drwl->image, 0, 0, 0, 0,
|
||||
x + glyph->x, ty - glyph->y, glyph->width, glyph->height);
|
||||
|
||||
x += glyph->advance.x;
|
||||
w -= glyph->advance.x;
|
||||
}
|
||||
|
||||
if (render)
|
||||
pixman_image_unref(fg_pix);
|
||||
|
||||
return x + (render ? w : 0);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
drwl_font_getwidth(Drwl *drwl, const char *text)
|
||||
{
|
||||
if (!drwl || !drwl->font || !text)
|
||||
return 0;
|
||||
return drwl_text(drwl, 0, 0, 0, 0, 0, text, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
drwl_image_destroy(Img *image)
|
||||
{
|
||||
pixman_image_unref(image);
|
||||
}
|
||||
|
||||
static void
|
||||
drwl_destroy(Drwl *drwl)
|
||||
{
|
||||
if (drwl->font)
|
||||
drwl_font_destroy(drwl->font);
|
||||
if (drwl->image)
|
||||
drwl_image_destroy(drwl->image);
|
||||
free(drwl);
|
||||
}
|
||||
|
||||
static void
|
||||
drwl_fini(void)
|
||||
{
|
||||
fcft_fini();
|
||||
}
|
19
dwl.1
19
dwl.1
|
@ -7,6 +7,7 @@
|
|||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl v
|
||||
.Op Fl d
|
||||
.Op Fl s Ar startup command
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
|
@ -22,6 +23,12 @@ option,
|
|||
writes its name and version to standard error and exits unsuccessfully.
|
||||
.Pp
|
||||
When given the
|
||||
.Fl d
|
||||
option,
|
||||
.Nm
|
||||
enables full wlroots logging, including debug information.
|
||||
.Pp
|
||||
When given the
|
||||
.Fl s
|
||||
option,
|
||||
.Nm
|
||||
|
@ -48,10 +55,10 @@ Move window to a single tag.
|
|||
Toggle tag for window.
|
||||
.It Mod-p
|
||||
Spawn
|
||||
.Nm bemenu-run .
|
||||
.Nm wmenu-run .
|
||||
.It Mod-Shift-Return
|
||||
Spawn
|
||||
.Nm alacritty .
|
||||
.Nm foot .
|
||||
.It Mod-[jk]
|
||||
Move focus down/up the stack.
|
||||
.It Mod-[id]
|
||||
|
@ -101,7 +108,7 @@ These environment variables are used by
|
|||
A directory where temporary user files, such as the Wayland socket,
|
||||
are stored.
|
||||
.It Ev XDG_CONFIG_DIR
|
||||
A directory containung configuration of various programs and
|
||||
A directory containing configuration of various programs and
|
||||
libraries, including libxkbcommon.
|
||||
.It Ev DISPLAY , WAYLAND_DISPLAY , WAYLAND_SOCKET
|
||||
Tell how to connect to an underlying X11 or Wayland server.
|
||||
|
@ -133,10 +140,10 @@ server.
|
|||
Start
|
||||
.Nm
|
||||
with s6 in the background:
|
||||
.Dl dwl -s 's6-svscan <&-'
|
||||
.Dl dwl \-s \(aqs6\-svscan <&\-\(aq
|
||||
.Sh SEE ALSO
|
||||
.Xr alacritty 1 ,
|
||||
.Xr bemenu 1 ,
|
||||
.Xr foot 1 ,
|
||||
.Xr wmenu 1 ,
|
||||
.Xr dwm 1 ,
|
||||
.Xr xkeyboard-config 7
|
||||
.Sh CAVEATS
|
||||
|
|
5
dwl.desktop
Normal file
5
dwl.desktop
Normal file
|
@ -0,0 +1,5 @@
|
|||
[Desktop Entry]
|
||||
Name=dwl
|
||||
Comment=dwm for Wayland
|
||||
Exec=dwl
|
||||
Type=Application
|
58
flake.lock
Normal file
58
flake.lock
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733312601,
|
||||
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1733759999,
|
||||
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1733096140,
|
||||
"narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
28
flake.nix
Normal file
28
flake.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
description = "dwm for Wayland (requires dwl 0.7)";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
||||
outputs = inputs@{ flake-parts, nixpkgs, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
imports = [
|
||||
flake-parts.flakeModules.easyOverlay
|
||||
];
|
||||
systems = nixpkgs.lib.platforms.unix;
|
||||
perSystem = { config, self', inputs', pkgs, system, ... }: {
|
||||
overlayAttrs = {
|
||||
zdwl = config.packages.default;
|
||||
};
|
||||
packages.default = pkgs.dwl.overrideAttrs (old: {
|
||||
buildInputs = old.buildInputs ++ (with pkgs; [
|
||||
fcft
|
||||
libdrm.dev
|
||||
]);
|
||||
src = ./.;
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if git tag --contains HEAD | grep -q $1; then
|
||||
echo $1
|
||||
else
|
||||
branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
commit="$(git rev-parse --short HEAD)"
|
||||
if [ "${branch}" != "main" ]; then
|
||||
echo $1-$branch-$commit
|
||||
else
|
||||
echo $1-$commit
|
||||
fi
|
||||
fi
|
1245
patches/bar-0.7.patch
Normal file
1245
patches/bar-0.7.patch
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,49 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<protocol name="idle">
|
||||
<copyright><![CDATA[
|
||||
Copyright (C) 2015 Martin Gräßlin
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
]]></copyright>
|
||||
<interface name="org_kde_kwin_idle" version="1">
|
||||
<description summary="User idle time manager">
|
||||
This interface allows to monitor user idle time on a given seat. The interface
|
||||
allows to register timers which trigger after no user activity was registered
|
||||
on the seat for a given interval. It notifies when user activity resumes.
|
||||
|
||||
This is useful for applications wanting to perform actions when the user is not
|
||||
interacting with the system, e.g. chat applications setting the user as away, power
|
||||
management features to dim screen, etc..
|
||||
</description>
|
||||
<request name="get_idle_timeout">
|
||||
<arg name="id" type="new_id" interface="org_kde_kwin_idle_timeout"/>
|
||||
<arg name="seat" type="object" interface="wl_seat"/>
|
||||
<arg name="timeout" type="uint" summary="The idle timeout in msec"/>
|
||||
</request>
|
||||
</interface>
|
||||
<interface name="org_kde_kwin_idle_timeout" version="1">
|
||||
<request name="release" type="destructor">
|
||||
<description summary="release the timeout object"/>
|
||||
</request>
|
||||
<request name="simulate_user_activity">
|
||||
<description summary="Simulates user activity for this timeout, behaves just like real user activity on the seat"/>
|
||||
</request>
|
||||
<event name="idle">
|
||||
<description summary="Triggered when there has not been any user activity in the requested idle time interval"/>
|
||||
</event>
|
||||
<event name="resumed">
|
||||
<description summary="Triggered on the first user activity after an idle event"/>
|
||||
</event>
|
||||
</interface>
|
||||
</protocol>
|
128
protocols/wlr-output-power-management-unstable-v1.xml
Normal file
128
protocols/wlr-output-power-management-unstable-v1.xml
Normal file
|
@ -0,0 +1,128 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<protocol name="wlr_output_power_management_unstable_v1">
|
||||
<copyright>
|
||||
Copyright © 2019 Purism SPC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
</copyright>
|
||||
|
||||
<description summary="Control power management modes of outputs">
|
||||
This protocol allows clients to control power management modes
|
||||
of outputs that are currently part of the compositor space. The
|
||||
intent is to allow special clients like desktop shells to power
|
||||
down outputs when the system is idle.
|
||||
|
||||
To modify outputs not currently part of the compositor space see
|
||||
wlr-output-management.
|
||||
|
||||
Warning! The protocol described in this file is experimental and
|
||||
backward incompatible changes may be made. Backward compatible changes
|
||||
may be added together with the corresponding interface version bump.
|
||||
Backward incompatible changes are done by bumping the version number in
|
||||
the protocol and interface names and resetting the interface version.
|
||||
Once the protocol is to be declared stable, the 'z' prefix and the
|
||||
version number in the protocol and interface names are removed and the
|
||||
interface version number is reset.
|
||||
</description>
|
||||
|
||||
<interface name="zwlr_output_power_manager_v1" version="1">
|
||||
<description summary="manager to create per-output power management">
|
||||
This interface is a manager that allows creating per-output power
|
||||
management mode controls.
|
||||
</description>
|
||||
|
||||
<request name="get_output_power">
|
||||
<description summary="get a power management for an output">
|
||||
Create a output power management mode control that can be used to
|
||||
adjust the power management mode for a given output.
|
||||
</description>
|
||||
<arg name="id" type="new_id" interface="zwlr_output_power_v1"/>
|
||||
<arg name="output" type="object" interface="wl_output"/>
|
||||
</request>
|
||||
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="destroy the manager">
|
||||
All objects created by the manager will still remain valid, until their
|
||||
appropriate destroy request has been called.
|
||||
</description>
|
||||
</request>
|
||||
</interface>
|
||||
|
||||
<interface name="zwlr_output_power_v1" version="1">
|
||||
<description summary="adjust power management mode for an output">
|
||||
This object offers requests to set the power management mode of
|
||||
an output.
|
||||
</description>
|
||||
|
||||
<enum name="mode">
|
||||
<entry name="off" value="0"
|
||||
summary="Output is turned off."/>
|
||||
<entry name="on" value="1"
|
||||
summary="Output is turned on, no power saving"/>
|
||||
</enum>
|
||||
|
||||
<enum name="error">
|
||||
<entry name="invalid_mode" value="1" summary="inexistent power save mode"/>
|
||||
</enum>
|
||||
|
||||
<request name="set_mode">
|
||||
<description summary="Set an outputs power save mode">
|
||||
Set an output's power save mode to the given mode. The mode change
|
||||
is effective immediately. If the output does not support the given
|
||||
mode a failed event is sent.
|
||||
</description>
|
||||
<arg name="mode" type="uint" enum="mode" summary="the power save mode to set"/>
|
||||
</request>
|
||||
|
||||
<event name="mode">
|
||||
<description summary="Report a power management mode change">
|
||||
Report the power management mode change of an output.
|
||||
|
||||
The mode event is sent after an output changed its power
|
||||
management mode. The reason can be a client using set_mode or the
|
||||
compositor deciding to change an output's mode.
|
||||
This event is also sent immediately when the object is created
|
||||
so the client is informed about the current power management mode.
|
||||
</description>
|
||||
<arg name="mode" type="uint" enum="mode"
|
||||
summary="the output's new power management mode"/>
|
||||
</event>
|
||||
|
||||
<event name="failed">
|
||||
<description summary="object no longer valid">
|
||||
This event indicates that the output power management mode control
|
||||
is no longer valid. This can happen for a number of reasons,
|
||||
including:
|
||||
- The output doesn't support power management
|
||||
- Another client already has exclusive power management mode control
|
||||
for this output
|
||||
- The output disappeared
|
||||
|
||||
Upon receiving this event, the client should destroy this object.
|
||||
</description>
|
||||
</event>
|
||||
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="destroy this power management">
|
||||
Destroys the output power management mode control object.
|
||||
</description>
|
||||
</request>
|
||||
</interface>
|
||||
</protocol>
|
2
shell.fish
Executable file
2
shell.fish
Executable file
|
@ -0,0 +1,2 @@
|
|||
nix-shell -p bear --command fish
|
||||
nix develop nixpkgs#dwl --command fish
|
36
util.c
36
util.c
|
@ -3,19 +3,10 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
void *
|
||||
ecalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
if (!(p = calloc(nmemb, size)))
|
||||
die("calloc:");
|
||||
return p;
|
||||
}
|
||||
|
||||
void
|
||||
die(const char *fmt, ...) {
|
||||
va_list ap;
|
||||
|
@ -33,3 +24,28 @@ die(const char *fmt, ...) {
|
|||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void *
|
||||
ecalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
if (!(p = calloc(nmemb, size)))
|
||||
die("calloc:");
|
||||
return p;
|
||||
}
|
||||
|
||||
int
|
||||
fd_set_nonblock(int fd) {
|
||||
int flags = fcntl(fd, F_GETFL);
|
||||
if (flags < 0) {
|
||||
perror("fcntl(F_GETFL):");
|
||||
return -1;
|
||||
}
|
||||
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
|
||||
perror("fcntl(F_SETFL):");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
1
util.h
1
util.h
|
@ -2,3 +2,4 @@
|
|||
|
||||
void die(const char *fmt, ...);
|
||||
void *ecalloc(size_t nmemb, size_t size);
|
||||
int fd_set_nonblock(int fd);
|
||||
|
|
Loading…
Reference in a new issue