Pi66

dots
My personal Linux configuration files and dotfiles.
git clone https://git.pi66.xyz/dots

← back to log

Init commit

author: pi66
date: 2026-04-15 23:56
hash: f7d60228a321a9da78f1c0c6394939ce65a6b43f

Diffstat:

M

README.md
266 --

A

colorscheme
16

D

config.def.h
228 --

D

config.def.h.orig
215 --

D

config.def.h.rej
12

D

config.h
228 --

D

dwl.c.orig
3585 ------------------------------

A

dwl/.mailmap
3

M

CHANGELOG.md => dwl/CHANGELOG.md
0

M

LICENSE => dwl/LICENSES/LICENSE
0

M

LICENSE.dwm => dwl/LICENSES/LICENSE.dwm
0

M

LICENSE.sway => dwl/LICENSES/LICENSE.sway
0

M

LICENSE.tinywl => dwl/LICENSES/LICENSE.tinywl
0

M

Makefile => dwl/Makefile
6

A

dwl/README.md
216 ++

M

client.h => dwl/client.h
12

A

dwl/config.def.h
242 ++

M

config.mk => dwl/config.mk
0

M

drwl.h => dwl/drwl.h
0

M

dwl.1 => dwl/dwl.1
0

M

dwl.c => dwl/dwl.c
846 ++++++-

M

dwl.desktop => dwl/dwl.desktop
0

A

dwl/patches/alwayscenter/README.md
9

A

dwl/patches/alwayscenter/alwayscenter.patch
25

A

dwl/patches/bar-notitle/README.md
14

A

dwl/patches/bar-notitle/bar-notitle.patch
38

A

dwl/patches/bar-recolr/README.md
16

A

dwl/patches/bar-recolr/bar-recolr.patch
80 +

A

dwl/patches/bar/README.md
34

A

dwl/patches/bar/bar-0.6.patch
1245 ++++++++++

A

dwl/patches/bar/bar-0.7.patch
1245 ++++++++++

M

{patches => dwl/patches/bar}/bar.patch
150 +

A

dwl/patches/bar/bar.png
0

A

dwl/patches/customfloat/README.md
24

A

dwl/patches/customfloat/customfloat-0.8.patch
95 +

A

dwl/patches/customfloat/customfloat-wlroots-next-f4249db.patch
95 +

A

dwl/patches/gaps/README.md
14

M

patches/gap.patch => dwl/patches/gaps/gaps.patch
1

A

dwl/patches/hide-behind-fullscreen/README.md
12

A

dwl/patches/hide-behind-fullscreen/hide-behind-fullscreen-0.7.patch
73 +

A

dwl/patches/hide-behind-fullscreen/hide-behind-fullscreen.patch
73 +

A

dwl/patches/hide-behind-monocle/README.md
10

A

dwl/patches/hide-behind-monocle/hide-behind-monocle-0.7.patch
332 +++

A

dwl/patches/hide-behind-monocle/hide-behind-monocle.patch
332 +++

A

dwl/patches/hide-cursor-when-typing/README.md
15

A

dwl/patches/hide-cursor-when-typing/hide-cursor-when-typing.patch
170 +

A

dwl/patches/pertag/README.md
12

A

dwl/patches/pertag/pertag.patch
170 +

A

dwl/patches/restore-monitor/README.md
8

A

dwl/patches/restore-monitor/restore-monitor.patch
82 +

A

dwl/patches/smartborders/README.md
14

A

dwl/patches/smartborders/smartborders-0.7.patch
204 ++

A

dwl/patches/smartborders/smartborders.patch
203 ++

A

dwl/patches/swallow/README.md
53

A

dwl/patches/swallow/swallow-freebsd.patch
54

A

dwl/patches/swallow/swallow.patch
351 +++

A

dwl/patches/tablet-input/README.md
19

A

dwl/patches/tablet-input/tablet-input-0.8.patch
484 ++++

A

dwl/patches/tablet-input/tablet-input-main-a2d03cf.patch
484 ++++

A

dwl/patches/tablet-input/tablet-input-wlroots-next-f4249db.patch
378 +++

A

dwl/patches/warpcursor/README.md
15

A

dwl/patches/warpcursor/warpcursor.patch
71 +

M

{protocols => dwl/protocols}/wlr-layer-shell-unstable-v1.xml
0

M

{protocols => dwl/protocols}/wlr-output-power-management-unstable-v1.xml
0

M

util.c => dwl/util.c
0

M

util.h => dwl/util.h
0

A

nvim/colors/wired.vim
286 ++

A

nvim/init.lua
21

A

nvim/lua/binds.lua
32

A

nvim/lua/commands.lua
12

A

nvim/lua/functions.lua
51

A

nvim/lua/globals.lua
6

A

nvim/lua/lsp.lua
49

A

nvim/lua/options.lua
33

A

nvim/lua/packages.lua
15

A

nvim/lua/setup.lua
75 +

D

patches/bar-center.patch
47

D

patches/clrreload.patch
66 -

A

screenshots/dwl-00.png
0

A

screenshots/dwl-01.png
0

A

screenshots/nvim-00.png
0

A

screenshots/nvim-01.png
0

A

sta/LICENSE
47

A

sta/Makefile
13

A

sta/README.md
29

A

sta/components/battery.c
257 ++

A

sta/components/cpu.c
162 +

A

sta/components/datetime.c
20

A

sta/components/disk.c
62 +

A

sta/components/ram.c
220 ++

A

sta/components/run_command.c
29

A

sta/components/temperature.c
75 +

A

sta/components/util.c
146 +

A

sta/components/wifi.c
275 ++

A

sta/config.def.h
21

A

sta/sta.c
256 ++

A

sta/util.h
99 +
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
  161
  162
  163
  164
  165
  166
  167
  168
  169
  170
  171
  172
  173
  174
  175
  176
  177
  178
  179
  180
  181
  182
  183
  184
  185
  186
  187
  188
  189
  190
  191
  192
  193
  194
  195
  196
  197
  198
  199
  200
  201
  202
  203
  204
  205
  206
  207
  208
  209
  210
  211
  212
  213
  214
  215
  216
  217
  218
  219
  220
  221
  222
  223
  224
  225
  226
  227
  228
  229
  230
  231
  232
  233
  234
  235
  236
  237
  238
  239
  240
  241
  242
  243
  244
  245
  246
  247
  248
  249
  250
  251
  252
  253
  254
  255
  256
  257
  258
  259
  260
  261
  262
  263
  264
  265
  266
  267
  268
  269
  270
  271
  272
  273
  274
  275
  276
  277
  278
  279
  280
  281
  282
  283
  284
  285
  286
  287
  288
  289
  290
  291
  292
  293
  294
  295
  296
  297
  298
  299
  300
  301
  302
  303
  304
  305
  306
  307
  308
  309
  310
  311
  312
  313
  314
  315
  316
  317
  318
  319
  320
  321
  322
  323
  324
  325
  326
  327
  328
  329
  330
  331
  332
  333
  334
  335
  336
  337
  338
  339
  340
  341
  342
  343
  344
  345
  346
  347
  348
  349
  350
  351
  352
  353
  354
  355
  356
  357
  358
  359
  360
  361
  362
  363
  364
  365
  366
  367
  368
  369
  370
  371
  372
  373
  374
  375
  376
  377
  378
  379
  380
  381
  382
  383
  384
  385
  386
  387
  388
  389
  390
  391
  392
  393
  394
  395
  396
  397
  398
  399
  400
  401
  402
  403
  404
  405
  406
  407
  408
  409
  410
  411
  412
  413
  414
  415
  416
  417
  418
  419
  420
  421
  422
  423
  424
  425
  426
  427
  428
  429
  430
  431
  432
  433
  434
  435
  436
  437
  438
  439
  440
  441
  442
  443
  444
  445
  446
  447
  448
  449
  450
  451
  452
  453
  454
  455
  456
  457
  458
  459
  460
  461
  462
  463
  464
  465
  466
  467
  468
  469
  470
  471
  472
  473
  474
  475
  476
  477
  478
  479
  480
  481
  482
  483
  484
  485
  486
  487
  488
  489
  490
  491
  492
  493
  494
  495
  496
  497
  498
  499
  500
  501
  502
  503
  504
  505
  506
  507
  508
  509
  510
  511
  512
  513
  514
  515
  516
  517
  518
  519
  520
  521
  522
  523
  524
  525
  526
  527
  528
  529
  530
  531
  532
  533
  534
  535
  536
  537
  538
  539
  540
  541
  542
  543
  544
  545
  546
  547
  548
  549
  550
  551
  552
  553
  554
  555
  556
  557
  558
  559
  560
  561
  562
  563
  564
  565
  566
  567
  568
  569
  570
  571
  572
  573
  574
  575
  576
  577
  578
  579
  580
  581
  582
  583
  584
  585
  586
  587
  588
  589
  590
  591
  592
  593
  594
  595
  596
  597
  598
  599
  600
  601
  602
  603
  604
  605
  606
  607
  608
  609
  610
  611
  612
  613
  614
  615
  616
  617
  618
  619
  620
  621
  622
  623
  624
  625
  626
  627
  628
  629
  630
  631
  632
  633
  634
  635
  636
  637
  638
  639
  640
  641
  642
  643
  644
  645
  646
  647
  648
  649
  650
  651
  652
  653
  654
  655
  656
  657
  658
  659
  660
  661
  662
  663
  664
  665
  666
  667
  668
  669
  670
  671
  672
  673
  674
  675
  676
  677
  678
  679
  680
  681
  682
  683
  684
  685
  686
  687
  688
  689
  690
  691
  692
  693
  694
  695
  696
  697
  698
  699
  700
  701
  702
  703
  704
  705
  706
  707
  708
  709
  710
  711
  712
  713
  714
  715
  716
  717
  718
  719
  720
  721
  722
  723
  724
  725
  726
  727
  728
  729
  730
  731
  732
  733
  734
  735
  736
  737
  738
  739
  740
  741
  742
  743
  744
  745
  746
  747
  748
  749
  750
  751
  752
  753
  754
  755
  756
  757
  758
  759
  760
  761
  762
  763
  764
  765
  766
  767
  768
  769
  770
  771
  772
  773
  774
  775
  776
  777
  778
  779
  780
  781
  782
  783
  784
  785
  786
  787
  788
  789
  790
  791
  792
  793
  794
  795
  796
  797
  798
  799
  800
  801
  802
  803
  804
  805
  806
  807
  808
  809
  810
  811
  812
  813
  814
  815
  816
  817
  818
  819
  820
  821
  822
  823
  824
  825
  826
  827
  828
  829
  830
  831
  832
  833
  834
  835
  836
  837
  838
  839
  840
  841
  842
  843
  844
  845
  846
  847
  848
  849
  850
  851
  852
  853
  854
  855
  856
  857
  858
  859
  860
  861
  862
  863
  864
  865
  866
  867
  868
  869
  870
  871
  872
  873
  874
  875
  876
  877
  878
  879
  880
  881
  882
  883
  884
  885
  886
  887
  888
  889
  890
  891
  892
  893
  894
  895
  896
  897
  898
  899
  900
  901
  902
  903
  904
  905
  906
  907
  908
  909
  910
  911
  912
  913
  914
  915
  916
  917
  918
  919
  920
  921
  922
  923
  924
  925
  926
  927
  928
  929
  930
  931
  932
  933
  934
  935
  936
  937
  938
  939
  940
  941
  942
  943
  944
  945
  946
  947
  948
  949
  950
  951
  952
  953
  954
  955
  956
  957
  958
  959
  960
  961
  962
  963
  964
  965
  966
  967
  968
  969
  970
  971
  972
  973
  974
  975
  976
  977
  978
  979
  980
  981
  982
  983
  984
  985
  986
  987
  988
  989
  990
  991
  992
  993
  994
  995
  996
  997
  998
  999
 1000
 1001
 1002
 1003
 1004
 1005
 1006
 1007
 1008
 1009
 1010
 1011
 1012
 1013
 1014
 1015
 1016
 1017
 1018
 1019
 1020
 1021
 1022
 1023
 1024
 1025
 1026
 1027
 1028
 1029
 1030
 1031
 1032
 1033
 1034
 1035
 1036
 1037
 1038
 1039
 1040
 1041
 1042
 1043
 1044
 1045
 1046
 1047
 1048
 1049
 1050
 1051
 1052
 1053
 1054
 1055
 1056
 1057
 1058
 1059
 1060
 1061
 1062
 1063
 1064
 1065
 1066
 1067
 1068
 1069
 1070
 1071
 1072
 1073
 1074
 1075
 1076
 1077
 1078
 1079
 1080
 1081
 1082
 1083
 1084
 1085
 1086
 1087
 1088
 1089
 1090
 1091
 1092
 1093
 1094
 1095
 1096
 1097
 1098
 1099
 1100
 1101
 1102
 1103
 1104
 1105
 1106
 1107
 1108
 1109
 1110
 1111
 1112
 1113
 1114
 1115
 1116
 1117
 1118
 1119
 1120
 1121
 1122
 1123
 1124
 1125
 1126
 1127
 1128
 1129
 1130
 1131
 1132
 1133
 1134
 1135
 1136
 1137
 1138
 1139
 1140
 1141
 1142
 1143
 1144
 1145
 1146
 1147
 1148
 1149
 1150
 1151
 1152
 1153
 1154
 1155
 1156
 1157
 1158
 1159
 1160
 1161
 1162
 1163
 1164
 1165
 1166
 1167
 1168
 1169
 1170
 1171
 1172
 1173
 1174
 1175
 1176
 1177
 1178
 1179
 1180
 1181
 1182
 1183
 1184
 1185
 1186
 1187
 1188
 1189
 1190
 1191
 1192
 1193
 1194
 1195
 1196
 1197
 1198
 1199
 1200
 1201
 1202
 1203
 1204
 1205
 1206
 1207
 1208
 1209
 1210
 1211
 1212
 1213
 1214
 1215
 1216
 1217
 1218
 1219
 1220
 1221
 1222
 1223
 1224
 1225
 1226
 1227
 1228
 1229
 1230
 1231
 1232
 1233
 1234
 1235
 1236
 1237
 1238
 1239
 1240
 1241
 1242
 1243
 1244
 1245
 1246
 1247
 1248
 1249
 1250
 1251
 1252
 1253
 1254
 1255
 1256
 1257
 1258
 1259
 1260
 1261
 1262
 1263
 1264
 1265
 1266
 1267
 1268
 1269
 1270
 1271
 1272
 1273
 1274
 1275
 1276
 1277
 1278
 1279
 1280
 1281
 1282
 1283
 1284
 1285
 1286
 1287
 1288
 1289
 1290
 1291
 1292
 1293
 1294
 1295
 1296
 1297
 1298
 1299
 1300
 1301
 1302
 1303
 1304
 1305
 1306
 1307
 1308
 1309
 1310
 1311
 1312
 1313
 1314
 1315
 1316
 1317
 1318
 1319
 1320
 1321
 1322
 1323
 1324
 1325
 1326
 1327
 1328
 1329
 1330
 1331
 1332
 1333
 1334
 1335
 1336
 1337
 1338
 1339
 1340
 1341
 1342
 1343
 1344
 1345
 1346
 1347
 1348
 1349
 1350
 1351
 1352
 1353
 1354
 1355
 1356
 1357
 1358
 1359
 1360
 1361
 1362
 1363
 1364
 1365
 1366
 1367
 1368
 1369
 1370
 1371
 1372
 1373
 1374
 1375
 1376
 1377
 1378
 1379
 1380
 1381
 1382
 1383
 1384
 1385
 1386
 1387
 1388
 1389
 1390
 1391
 1392
 1393
 1394
 1395
 1396
 1397
 1398
 1399
 1400
 1401
 1402
 1403
 1404
 1405
 1406
 1407
 1408
 1409
 1410
 1411
 1412
 1413
 1414
 1415
 1416
 1417
 1418
 1419
 1420
 1421
 1422
 1423
 1424
 1425
 1426
 1427
 1428
 1429
 1430
 1431
 1432
 1433
 1434
 1435
 1436
 1437
 1438
 1439
 1440
 1441
 1442
 1443
 1444
 1445
 1446
 1447
 1448
 1449
 1450
 1451
 1452
 1453
 1454
 1455
 1456
 1457
 1458
 1459
 1460
 1461
 1462
 1463
 1464
 1465
 1466
 1467
 1468
 1469
 1470
 1471
 1472
 1473
 1474
 1475
 1476
 1477
 1478
 1479
 1480
 1481
 1482
 1483
 1484
 1485
 1486
 1487
 1488
 1489
 1490
 1491
 1492
 1493
 1494
 1495
 1496
 1497
 1498
 1499
 1500
 1501
 1502
 1503
 1504
 1505
 1506
 1507
 1508
 1509
 1510
 1511
 1512
 1513
 1514
 1515
 1516
 1517
 1518
 1519
 1520
 1521
 1522
 1523
 1524
 1525
 1526
 1527
 1528
 1529
 1530
 1531
 1532
 1533
 1534
 1535
 1536
 1537
 1538
 1539
 1540
 1541
 1542
 1543
 1544
 1545
 1546
 1547
 1548
 1549
 1550
 1551
 1552
 1553
 1554
 1555
 1556
 1557
 1558
 1559
 1560
 1561
 1562
 1563
 1564
 1565
 1566
 1567
 1568
 1569
 1570
 1571
 1572
 1573
 1574
 1575
 1576
 1577
 1578
 1579
 1580
 1581
 1582
 1583
 1584
 1585
 1586
 1587
 1588
 1589
 1590
 1591
 1592
 1593
 1594
 1595
 1596
 1597
 1598
 1599
 1600
 1601
 1602
 1603
 1604
 1605
 1606
 1607
 1608
 1609
 1610
 1611
 1612
 1613
 1614
 1615
 1616
 1617
 1618
 1619
 1620
 1621
 1622
 1623
 1624
 1625
 1626
 1627
 1628
 1629
 1630
 1631
 1632
 1633
 1634
 1635
 1636
 1637
 1638
 1639
 1640
 1641
 1642
 1643
 1644
 1645
 1646
 1647
 1648
 1649
 1650
 1651
 1652
 1653
 1654
 1655
 1656
 1657
 1658
 1659
 1660
 1661
 1662
 1663
 1664
 1665
 1666
 1667
 1668
 1669
 1670
 1671
 1672
 1673
 1674
 1675
 1676
 1677
 1678
 1679
 1680
 1681
 1682
 1683
 1684
 1685
 1686
 1687
 1688
 1689
 1690
 1691
 1692
 1693
 1694
 1695
 1696
 1697
 1698
 1699
 1700
 1701
 1702
 1703
 1704
 1705
 1706
 1707
 1708
 1709
 1710
 1711
 1712
 1713
 1714
 1715
 1716
 1717
 1718
 1719
 1720
 1721
 1722
 1723
 1724
 1725
 1726
 1727
 1728
 1729
 1730
 1731
 1732
 1733
 1734
 1735
 1736
 1737
 1738
 1739
 1740
 1741
 1742
 1743
 1744
 1745
 1746
 1747
 1748
 1749
 1750
 1751
 1752
 1753
 1754
 1755
 1756
 1757
 1758
 1759
 1760
 1761
 1762
 1763
 1764
 1765
 1766
 1767
 1768
 1769
 1770
 1771
 1772
 1773
 1774
 1775
 1776
 1777
 1778
 1779
 1780
 1781
 1782
 1783
 1784
 1785
 1786
 1787
 1788
 1789
 1790
 1791
 1792
 1793
 1794
 1795
 1796
 1797
 1798
 1799
 1800
 1801
 1802
 1803
 1804
 1805
 1806
 1807
 1808
 1809
 1810
 1811
 1812
 1813
 1814
 1815
 1816
 1817
 1818
 1819
 1820
 1821
 1822
 1823
 1824
 1825
 1826
 1827
 1828
 1829
 1830
 1831
 1832
 1833
 1834
 1835
 1836
 1837
 1838
 1839
 1840
 1841
 1842
 1843
 1844
 1845
 1846
 1847
 1848
 1849
 1850
 1851
 1852
 1853
 1854
 1855
 1856
 1857
 1858
 1859
 1860
 1861
 1862
 1863
 1864
 1865
 1866
 1867
 1868
 1869
 1870
 1871
 1872
 1873
 1874
 1875
 1876
 1877
 1878
 1879
 1880
 1881
 1882
 1883
 1884
 1885
 1886
 1887
 1888
 1889
 1890
 1891
 1892
 1893
 1894
 1895
 1896
 1897
 1898
 1899
 1900
 1901
 1902
 1903
 1904
 1905
 1906
 1907
 1908
 1909
 1910
 1911
 1912
 1913
 1914
 1915
 1916
 1917
 1918
 1919
 1920
 1921
 1922
 1923
 1924
 1925
 1926
 1927
 1928
 1929
 1930
 1931
 1932
 1933
 1934
 1935
 1936
 1937
 1938
 1939
 1940
 1941
 1942
 1943
 1944
 1945
 1946
 1947
 1948
 1949
 1950
 1951
 1952
 1953
 1954
 1955
 1956
 1957
 1958
 1959
 1960
 1961
 1962
 1963
 1964
 1965
 1966
 1967
 1968
 1969
 1970
 1971
 1972
 1973
 1974
 1975
 1976
 1977
 1978
 1979
 1980
 1981
 1982
 1983
 1984
 1985
 1986
 1987
 1988
 1989
 1990
 1991
 1992
 1993
 1994
 1995
 1996
 1997
 1998
 1999
 2000
 2001
 2002
 2003
 2004
 2005
 2006
 2007
 2008
 2009
 2010
 2011
 2012
 2013
 2014
 2015
 2016
 2017
 2018
 2019
 2020
 2021
 2022
 2023
 2024
 2025
 2026
 2027
 2028
 2029
 2030
 2031
 2032
 2033
 2034
 2035
 2036
 2037
 2038
 2039
 2040
 2041
 2042
 2043
 2044
 2045
 2046
 2047
 2048
 2049
 2050
 2051
 2052
 2053
 2054
 2055
 2056
 2057
 2058
 2059
 2060
 2061
 2062
 2063
 2064
 2065
 2066
 2067
 2068
 2069
 2070
 2071
 2072
 2073
 2074
 2075
 2076
 2077
 2078
 2079
 2080
 2081
 2082
 2083
 2084
 2085
 2086
 2087
 2088
 2089
 2090
 2091
 2092
 2093
 2094
 2095
 2096
 2097
 2098
 2099
 2100
 2101
 2102
 2103
 2104
 2105
 2106
 2107
 2108
 2109
 2110
 2111
 2112
 2113
 2114
 2115
 2116
 2117
 2118
 2119
 2120
 2121
 2122
 2123
 2124
 2125
 2126
 2127
 2128
 2129
 2130
 2131
 2132
 2133
 2134
 2135
 2136
 2137
 2138
 2139
 2140
 2141
 2142
 2143
 2144
 2145
 2146
 2147
 2148
 2149
 2150
 2151
 2152
 2153
 2154
 2155
 2156
 2157
 2158
 2159
 2160
 2161
 2162
 2163
 2164
 2165
 2166
 2167
 2168
 2169
 2170
 2171
 2172
 2173
 2174
 2175
 2176
 2177
 2178
 2179
 2180
 2181
 2182
 2183
 2184
 2185
 2186
 2187
 2188
 2189
 2190
 2191
 2192
 2193
 2194
 2195
 2196
 2197
 2198
 2199
 2200
 2201
 2202
 2203
 2204
 2205
 2206
 2207
 2208
 2209
 2210
 2211
 2212
 2213
 2214
 2215
 2216
 2217
 2218
 2219
 2220
 2221
 2222
 2223
 2224
 2225
 2226
 2227
 2228
 2229
 2230
 2231
 2232
 2233
 2234
 2235
 2236
 2237
 2238
 2239
 2240
 2241
 2242
 2243
 2244
 2245
 2246
 2247
 2248
 2249
 2250
 2251
 2252
 2253
 2254
 2255
 2256
 2257
 2258
 2259
 2260
 2261
 2262
 2263
 2264
 2265
 2266
 2267
 2268
 2269
 2270
 2271
 2272
 2273
 2274
 2275
 2276
 2277
 2278
 2279
 2280
 2281
 2282
 2283
 2284
 2285
 2286
 2287
 2288
 2289
 2290
 2291
 2292
 2293
 2294
 2295
 2296
 2297
 2298
 2299
 2300
 2301
 2302
 2303
 2304
 2305
 2306
 2307
 2308
 2309
 2310
 2311
 2312
 2313
 2314
 2315
 2316
 2317
 2318
 2319
 2320
 2321
 2322
 2323
 2324
 2325
 2326
 2327
 2328
 2329
 2330
 2331
 2332
 2333
 2334
 2335
 2336
 2337
 2338
 2339
 2340
 2341
 2342
 2343
 2344
 2345
 2346
 2347
 2348
 2349
 2350
 2351
 2352
 2353
 2354
 2355
 2356
 2357
 2358
 2359
 2360
 2361
 2362
 2363
 2364
 2365
 2366
 2367
 2368
 2369
 2370
 2371
 2372
 2373
 2374
 2375
 2376
 2377
 2378
 2379
 2380
 2381
 2382
 2383
 2384
 2385
 2386
 2387
 2388
 2389
 2390
 2391
 2392
 2393
 2394
 2395
 2396
 2397
 2398
 2399
 2400
 2401
 2402
 2403
 2404
 2405
 2406
 2407
 2408
 2409
 2410
 2411
 2412
 2413
 2414
 2415
 2416
 2417
 2418
 2419
 2420
 2421
 2422
 2423
 2424
 2425
 2426
 2427
 2428
 2429
 2430
 2431
 2432
 2433
 2434
 2435
 2436
 2437
 2438
 2439
 2440
 2441
 2442
 2443
 2444
 2445
 2446
 2447
 2448
 2449
 2450
 2451
 2452
 2453
 2454
 2455
 2456
 2457
 2458
 2459
 2460
 2461
 2462
 2463
 2464
 2465
 2466
 2467
 2468
 2469
 2470
 2471
 2472
 2473
 2474
 2475
 2476
 2477
 2478
 2479
 2480
 2481
 2482
 2483
 2484
 2485
 2486
 2487
 2488
 2489
 2490
 2491
 2492
 2493
 2494
 2495
 2496
 2497
 2498
 2499
 2500
 2501
 2502
 2503
 2504
 2505
 2506
 2507
 2508
 2509
 2510
 2511
 2512
 2513
 2514
 2515
 2516
 2517
 2518
 2519
 2520
 2521
 2522
 2523
 2524
 2525
 2526
 2527
 2528
 2529
 2530
 2531
 2532
 2533
 2534
 2535
 2536
 2537
 2538
 2539
 2540
 2541
 2542
 2543
 2544
 2545
 2546
 2547
 2548
 2549
 2550
 2551
 2552
 2553
 2554
 2555
 2556
 2557
 2558
 2559
 2560
 2561
 2562
 2563
 2564
 2565
 2566
 2567
 2568
 2569
 2570
 2571
 2572
 2573
 2574
 2575
 2576
 2577
 2578
 2579
 2580
 2581
 2582
 2583
 2584
 2585
 2586
 2587
 2588
 2589
 2590
 2591
 2592
 2593
 2594
 2595
 2596
 2597
 2598
 2599
 2600
 2601
 2602
 2603
 2604
 2605
 2606
 2607
 2608
 2609
 2610
 2611
 2612
 2613
 2614
 2615
 2616
 2617
 2618
 2619
 2620
 2621
 2622
 2623
 2624
 2625
 2626
 2627
 2628
 2629
 2630
 2631
 2632
 2633
 2634
 2635
 2636
 2637
 2638
 2639
 2640
 2641
 2642
 2643
 2644
 2645
 2646
 2647
 2648
 2649
 2650
 2651
 2652
 2653
 2654
 2655
 2656
 2657
 2658
 2659
 2660
 2661
 2662
 2663
 2664
 2665
 2666
 2667
 2668
 2669
 2670
 2671
 2672
 2673
 2674
 2675
 2676
 2677
 2678
 2679
 2680
 2681
 2682
 2683
 2684
 2685
 2686
 2687
 2688
 2689
 2690
 2691
 2692
 2693
 2694
 2695
 2696
 2697
 2698
 2699
 2700
 2701
 2702
 2703
 2704
 2705
 2706
 2707
 2708
 2709
 2710
 2711
 2712
 2713
 2714
 2715
 2716
 2717
 2718
 2719
 2720
 2721
 2722
 2723
 2724
 2725
 2726
 2727
 2728
 2729
 2730
 2731
 2732
 2733
 2734
 2735
 2736
 2737
 2738
 2739
 2740
 2741
 2742
 2743
 2744
 2745
 2746
 2747
 2748
 2749
 2750
 2751
 2752
 2753
 2754
 2755
 2756
 2757
 2758
 2759
 2760
 2761
 2762
 2763
 2764
 2765
 2766
 2767
 2768
 2769
 2770
 2771
 2772
 2773
 2774
 2775
 2776
 2777
 2778
 2779
 2780
 2781
 2782
 2783
 2784
 2785
 2786
 2787
 2788
 2789
 2790
 2791
 2792
 2793
 2794
 2795
 2796
 2797
 2798
 2799
 2800
 2801
 2802
 2803
 2804
 2805
 2806
 2807
 2808
 2809
 2810
 2811
 2812
 2813
 2814
 2815
 2816
 2817
 2818
 2819
 2820
 2821
 2822
 2823
 2824
 2825
 2826
 2827
 2828
 2829
 2830
 2831
 2832
 2833
 2834
 2835
 2836
 2837
 2838
 2839
 2840
 2841
 2842
 2843
 2844
 2845
 2846
 2847
 2848
 2849
 2850
 2851
 2852
 2853
 2854
 2855
 2856
 2857
 2858
 2859
 2860
 2861
 2862
 2863
 2864
 2865
 2866
 2867
 2868
 2869
 2870
 2871
 2872
 2873
 2874
 2875
 2876
 2877
 2878
 2879
 2880
 2881
 2882
 2883
 2884
 2885
 2886
 2887
 2888
 2889
 2890
 2891
 2892
 2893
 2894
 2895
 2896
 2897
 2898
 2899
 2900
 2901
 2902
 2903
 2904
 2905
 2906
 2907
 2908
 2909
 2910
 2911
 2912
 2913
 2914
 2915
 2916
 2917
 2918
 2919
 2920
 2921
 2922
 2923
 2924
 2925
 2926
 2927
 2928
 2929
 2930
 2931
 2932
 2933
 2934
 2935
 2936
 2937
 2938
 2939
 2940
 2941
 2942
 2943
 2944
 2945
 2946
 2947
 2948
 2949
 2950
 2951
 2952
 2953
 2954
 2955
 2956
 2957
 2958
 2959
 2960
 2961
 2962
 2963
 2964
 2965
 2966
 2967
 2968
 2969
 2970
 2971
 2972
 2973
 2974
 2975
 2976
 2977
 2978
 2979
 2980
 2981
 2982
 2983
 2984
 2985
 2986
 2987
 2988
 2989
 2990
 2991
 2992
 2993
 2994
 2995
 2996
 2997
 2998
 2999
 3000
 3001
 3002
 3003
 3004
 3005
 3006
 3007
 3008
 3009
 3010
 3011
 3012
 3013
 3014
 3015
 3016
 3017
 3018
 3019
 3020
 3021
 3022
 3023
 3024
 3025
 3026
 3027
 3028
 3029
 3030
 3031
 3032
 3033
 3034
 3035
 3036
 3037
 3038
 3039
 3040
 3041
 3042
 3043
 3044
 3045
 3046
 3047
 3048
 3049
 3050
 3051
 3052
 3053
 3054
 3055
 3056
 3057
 3058
 3059
 3060
 3061
 3062
 3063
 3064
 3065
 3066
 3067
 3068
 3069
 3070
 3071
 3072
 3073
 3074
 3075
 3076
 3077
 3078
 3079
 3080
 3081
 3082
 3083
 3084
 3085
 3086
 3087
 3088
 3089
 3090
 3091
 3092
 3093
 3094
 3095
 3096
 3097
 3098
 3099
 3100
 3101
 3102
 3103
 3104
 3105
 3106
 3107
 3108
 3109
 3110
 3111
 3112
 3113
 3114
 3115
 3116
 3117
 3118
 3119
 3120
 3121
 3122
 3123
 3124
 3125
 3126
 3127
 3128
 3129
 3130
 3131
 3132
 3133
 3134
 3135
 3136
 3137
 3138
 3139
 3140
 3141
 3142
 3143
 3144
 3145
 3146
 3147
 3148
 3149
 3150
 3151
 3152
 3153
 3154
 3155
 3156
 3157
 3158
 3159
 3160
 3161
 3162
 3163
 3164
 3165
 3166
 3167
 3168
 3169
 3170
 3171
 3172
 3173
 3174
 3175
 3176
 3177
 3178
 3179
 3180
 3181
 3182
 3183
 3184
 3185
 3186
 3187
 3188
 3189
 3190
 3191
 3192
 3193
 3194
 3195
 3196
 3197
 3198
 3199
 3200
 3201
 3202
 3203
 3204
 3205
 3206
 3207
 3208
 3209
 3210
 3211
 3212
 3213
 3214
 3215
 3216
 3217
 3218
 3219
 3220
 3221
 3222
 3223
 3224
 3225
 3226
 3227
 3228
 3229
 3230
 3231
 3232
 3233
 3234
 3235
 3236
 3237
 3238
 3239
 3240
 3241
 3242
 3243
 3244
 3245
 3246
 3247
 3248
 3249
 3250
 3251
 3252
 3253
 3254
 3255
 3256
 3257
 3258
 3259
 3260
 3261
 3262
 3263
 3264
 3265
 3266
 3267
 3268
 3269
 3270
 3271
 3272
 3273
 3274
 3275
 3276
 3277
 3278
 3279
 3280
 3281
 3282
 3283
 3284
 3285
 3286
 3287
 3288
 3289
 3290
 3291
 3292
 3293
 3294
 3295
 3296
 3297
 3298
 3299
 3300
 3301
 3302
 3303
 3304
 3305
 3306
 3307
 3308
 3309
 3310
 3311
 3312
 3313
 3314
 3315
 3316
 3317
 3318
 3319
 3320
 3321
 3322
 3323
 3324
 3325
 3326
 3327
 3328
 3329
 3330
 3331
 3332
 3333
 3334
 3335
 3336
 3337
 3338
 3339
 3340
 3341
 3342
 3343
 3344
 3345
 3346
 3347
 3348
 3349
 3350
 3351
 3352
 3353
 3354
 3355
 3356
 3357
 3358
 3359
 3360
 3361
 3362
 3363
 3364
 3365
 3366
 3367
 3368
 3369
 3370
 3371
 3372
 3373
 3374
 3375
 3376
 3377
 3378
 3379
 3380
 3381
 3382
 3383
 3384
 3385
 3386
 3387
 3388
 3389
 3390
 3391
 3392
 3393
 3394
 3395
 3396
 3397
 3398
 3399
 3400
 3401
 3402
 3403
 3404
 3405
 3406
 3407
 3408
 3409
 3410
 3411
 3412
 3413
 3414
 3415
 3416
 3417
 3418
 3419
 3420
 3421
 3422
 3423
 3424
 3425
 3426
 3427
 3428
 3429
 3430
 3431
 3432
 3433
 3434
 3435
 3436
 3437
 3438
 3439
 3440
 3441
 3442
 3443
 3444
 3445
 3446
 3447
 3448
 3449
 3450
 3451
 3452
 3453
 3454
 3455
 3456
 3457
 3458
 3459
 3460
 3461
 3462
 3463
 3464
 3465
 3466
 3467
 3468
 3469
 3470
 3471
 3472
 3473
 3474
 3475
 3476
 3477
 3478
 3479
 3480
 3481
 3482
 3483
 3484
 3485
 3486
 3487
 3488
 3489
 3490
 3491
 3492
 3493
 3494
 3495
 3496
 3497
 3498
 3499
 3500
 3501
 3502
 3503
 3504
 3505
 3506
 3507
 3508
 3509
 3510
 3511
 3512
 3513
 3514
 3515
 3516
 3517
 3518
 3519
 3520
 3521
 3522
 3523
 3524
 3525
 3526
 3527
 3528
 3529
 3530
 3531
 3532
 3533
 3534
 3535
 3536
 3537
 3538
 3539
 3540
 3541
 3542
 3543
 3544
 3545
 3546
 3547
 3548
 3549
 3550
 3551
 3552
 3553
 3554
 3555
 3556
 3557
 3558
 3559
 3560
 3561
 3562
 3563
 3564
 3565
 3566
 3567
 3568
 3569
 3570
 3571
 3572
 3573
 3574
 3575
 3576
 3577
 3578
 3579
 3580
 3581
 3582
 3583
 3584
 3585
 3586
 3587
 3588
 3589
 3590
 3591
 3592
 3593
 3594
 3595
 3596
 3597
 3598
 3599
 3600
 3601
 3602
 3603
 3604
 3605
 3606
 3607
 3608
 3609
 3610
 3611
 3612
 3613
 3614
 3615
 3616
 3617
 3618
 3619
 3620
 3621
 3622
 3623
 3624
 3625
 3626
 3627
 3628
 3629
 3630
 3631
 3632
 3633
 3634
 3635
 3636
 3637
 3638
 3639
 3640
 3641
 3642
 3643
 3644
 3645
 3646
 3647
 3648
 3649
 3650
 3651
 3652
 3653
 3654
 3655
 3656
 3657
 3658
 3659
 3660
 3661
 3662
 3663
 3664
 3665
 3666
 3667
 3668
 3669
 3670
 3671
 3672
 3673
 3674
 3675
 3676
 3677
 3678
 3679
 3680
 3681
 3682
 3683
 3684
 3685
 3686
 3687
 3688
 3689
 3690
 3691
 3692
 3693
 3694
 3695
 3696
 3697
 3698
 3699
 3700
 3701
 3702
 3703
 3704
 3705
 3706
 3707
 3708
 3709
 3710
 3711
 3712
 3713
 3714
 3715
 3716
 3717
 3718
 3719
 3720
 3721
 3722
 3723
 3724
 3725
 3726
 3727
 3728
 3729
 3730
 3731
 3732
 3733
 3734
 3735
 3736
 3737
 3738
 3739
 3740
 3741
 3742
 3743
 3744
 3745
 3746
 3747
 3748
 3749
 3750
 3751
 3752
 3753
 3754
 3755
 3756
 3757
 3758
 3759
 3760
 3761
 3762
 3763
 3764
 3765
 3766
 3767
 3768
 3769
 3770
 3771
 3772
 3773
 3774
 3775
 3776
 3777
 3778
 3779
 3780
 3781
 3782
 3783
 3784
 3785
 3786
 3787
 3788
 3789
 3790
 3791
 3792
 3793
 3794
 3795
 3796
 3797
 3798
 3799
 3800
 3801
 3802
 3803
 3804
 3805
 3806
 3807
 3808
 3809
 3810
 3811
 3812
 3813
 3814
 3815
 3816
 3817
 3818
 3819
 3820
 3821
 3822
 3823
 3824
 3825
 3826
 3827
 3828
 3829
 3830
 3831
 3832
 3833
 3834
 3835
 3836
 3837
 3838
 3839
 3840
 3841
 3842
 3843
 3844
 3845
 3846
 3847
 3848
 3849
 3850
 3851
 3852
 3853
 3854
 3855
 3856
 3857
 3858
 3859
 3860
 3861
 3862
 3863
 3864
 3865
 3866
 3867
 3868
 3869
 3870
 3871
 3872
 3873
 3874
 3875
 3876
 3877
 3878
 3879
 3880
 3881
 3882
 3883
 3884
 3885
 3886
 3887
 3888
 3889
 3890
 3891
 3892
 3893
 3894
 3895
 3896
 3897
 3898
 3899
 3900
 3901
 3902
 3903
 3904
 3905
 3906
 3907
 3908
 3909
 3910
 3911
 3912
 3913
 3914
 3915
 3916
 3917
 3918
 3919
 3920
 3921
 3922
 3923
 3924
 3925
 3926
 3927
 3928
 3929
 3930
 3931
 3932
 3933
 3934
 3935
 3936
 3937
 3938
 3939
 3940
 3941
 3942
 3943
 3944
 3945
 3946
 3947
 3948
 3949
 3950
 3951
 3952
 3953
 3954
 3955
 3956
 3957
 3958
 3959
 3960
 3961
 3962
 3963
 3964
 3965
 3966
 3967
 3968
 3969
 3970
 3971
 3972
 3973
 3974
 3975
 3976
 3977
 3978
 3979
 3980
 3981
 3982
 3983
 3984
 3985
 3986
 3987
 3988
 3989
 3990
 3991
 3992
 3993
 3994
 3995
 3996
 3997
 3998
 3999
 4000
 4001
 4002
 4003
 4004
 4005
 4006
 4007
 4008
 4009
 4010
 4011
 4012
 4013
 4014
 4015
 4016
 4017
 4018
 4019
 4020
 4021
 4022
 4023
 4024
 4025
 4026
 4027
 4028
 4029
 4030
 4031
 4032
 4033
 4034
 4035
 4036
 4037
 4038
 4039
 4040
 4041
 4042
 4043
 4044
 4045
 4046
 4047
 4048
 4049
 4050
 4051
 4052
 4053
 4054
 4055
 4056
 4057
 4058
 4059
 4060
 4061
 4062
 4063
 4064
 4065
 4066
 4067
 4068
 4069
 4070
 4071
 4072
 4073
 4074
 4075
 4076
 4077
 4078
 4079
 4080
 4081
 4082
 4083
 4084
 4085
 4086
 4087
 4088
 4089
 4090
 4091
 4092
 4093
 4094
 4095
 4096
 4097
 4098
 4099
 4100
 4101
 4102
 4103
 4104
 4105
 4106
 4107
 4108
 4109
 4110
 4111
 4112
 4113
 4114
 4115
 4116
 4117
 4118
 4119
 4120
 4121
 4122
 4123
 4124
 4125
 4126
 4127
 4128
 4129
 4130
 4131
 4132
 4133
 4134
 4135
 4136
 4137
 4138
 4139
 4140
 4141
 4142
 4143
 4144
 4145
 4146
 4147
 4148
 4149
 4150
 4151
 4152
 4153
 4154
 4155
 4156
 4157
 4158
 4159
 4160
 4161
 4162
 4163
 4164
 4165
 4166
 4167
 4168
 4169
 4170
 4171
 4172
 4173
 4174
 4175
 4176
 4177
 4178
 4179
 4180
 4181
 4182
 4183
 4184
 4185
 4186
 4187
 4188
 4189
 4190
 4191
 4192
 4193
 4194
 4195
 4196
 4197
 4198
 4199
 4200
 4201
 4202
 4203
 4204
 4205
 4206
 4207
 4208
 4209
 4210
 4211
 4212
 4213
 4214
 4215
 4216
 4217
 4218
 4219
 4220
 4221
 4222
 4223
 4224
 4225
 4226
 4227
 4228
 4229
 4230
 4231
 4232
 4233
 4234
 4235
 4236
 4237
 4238
 4239
 4240
 4241
 4242
 4243
 4244
 4245
 4246
 4247
 4248
 4249
 4250
 4251
 4252
 4253
 4254
 4255
 4256
 4257
 4258
 4259
 4260
 4261
 4262
 4263
 4264
 4265
 4266
 4267
 4268
 4269
 4270
 4271
 4272
 4273
 4274
 4275
 4276
 4277
 4278
 4279
 4280
 4281
 4282
 4283
 4284
 4285
 4286
 4287
 4288
 4289
 4290
 4291
 4292
 4293
 4294
 4295
 4296
 4297
 4298
 4299
 4300
 4301
 4302
 4303
 4304
 4305
 4306
 4307
 4308
 4309
 4310
 4311
 4312
 4313
 4314
 4315
 4316
 4317
 4318
 4319
 4320
 4321
 4322
 4323
 4324
 4325
 4326
 4327
 4328
 4329
 4330
 4331
 4332
 4333
 4334
 4335
 4336
 4337
 4338
 4339
 4340
 4341
 4342
 4343
 4344
 4345
 4346
 4347
 4348
 4349
 4350
 4351
 4352
 4353
 4354
 4355
 4356
 4357
 4358
 4359
 4360
 4361
 4362
 4363
 4364
 4365
 4366
 4367
 4368
 4369
 4370
 4371
 4372
 4373
 4374
 4375
 4376
 4377
 4378
 4379
 4380
 4381
 4382
 4383
 4384
 4385
 4386
 4387
 4388
 4389
 4390
 4391
 4392
 4393
 4394
 4395
 4396
 4397
 4398
 4399
 4400
 4401
 4402
 4403
 4404
 4405
 4406
 4407
 4408
 4409
 4410
 4411
 4412
 4413
 4414
 4415
 4416
 4417
 4418
 4419
 4420
 4421
 4422
 4423
 4424
 4425
 4426
 4427
 4428
 4429
 4430
 4431
 4432
 4433
 4434
 4435
 4436
 4437
 4438
 4439
 4440
 4441
 4442
 4443
 4444
 4445
 4446
 4447
 4448
 4449
 4450
 4451
 4452
 4453
 4454
 4455
 4456
 4457
 4458
 4459
 4460
 4461
 4462
 4463
 4464
 4465
 4466
 4467
 4468
 4469
 4470
 4471
 4472
 4473
 4474
 4475
 4476
 4477
 4478
 4479
 4480
 4481
 4482
 4483
 4484
 4485
 4486
 4487
 4488
 4489
 4490
 4491
 4492
 4493
 4494
 4495
 4496
 4497
 4498
 4499
 4500
 4501
 4502
 4503
 4504
 4505
 4506
 4507
 4508
 4509
 4510
 4511
 4512
 4513
 4514
 4515
 4516
 4517
 4518
 4519
 4520
 4521
 4522
 4523
 4524
 4525
 4526
 4527
 4528
 4529
 4530
 4531
 4532
 4533
 4534
 4535
 4536
 4537
 4538
 4539
 4540
 4541
 4542
 4543
 4544
 4545
 4546
 4547
 4548
 4549
 4550
 4551
 4552
 4553
 4554
 4555
 4556
 4557
 4558
 4559
 4560
 4561
 4562
 4563
 4564
 4565
 4566
 4567
 4568
 4569
 4570
 4571
 4572
 4573
 4574
 4575
 4576
 4577
 4578
 4579
 4580
 4581
 4582
 4583
 4584
 4585
 4586
 4587
 4588
 4589
 4590
 4591
 4592
 4593
 4594
 4595
 4596
 4597
 4598
 4599
 4600
 4601
 4602
 4603
 4604
 4605
 4606
 4607
 4608
 4609
 4610
 4611
 4612
 4613
 4614
 4615
 4616
 4617
 4618
 4619
 4620
 4621
 4622
 4623
 4624
 4625
 4626
 4627
 4628
 4629
 4630
 4631
 4632
 4633
 4634
 4635
 4636
 4637
 4638
 4639
 4640
 4641
 4642
 4643
 4644
 4645
 4646
 4647
 4648
 4649
 4650
 4651
 4652
 4653
 4654
 4655
 4656
 4657
 4658
 4659
 4660
 4661
 4662
 4663
 4664
 4665
 4666
 4667
 4668
 4669
 4670
 4671
 4672
 4673
 4674
 4675
 4676
 4677
 4678
 4679
 4680
 4681
 4682
 4683
 4684
 4685
 4686
 4687
 4688
 4689
 4690
 4691
 4692
 4693
 4694
 4695
 4696
 4697
 4698
 4699
 4700
 4701
 4702
 4703
 4704
 4705
 4706
 4707
 4708
 4709
 4710
 4711
 4712
 4713
 4714
 4715
 4716
 4717
 4718
 4719
 4720
 4721
 4722
 4723
 4724
 4725
 4726
 4727
 4728
 4729
 4730
 4731
 4732
 4733
 4734
 4735
 4736
 4737
 4738
 4739
 4740
 4741
 4742
 4743
 4744
 4745
 4746
 4747
 4748
 4749
 4750
 4751
 4752
 4753
 4754
 4755
 4756
 4757
 4758
 4759
 4760
 4761
 4762
 4763
 4764
 4765
 4766
 4767
 4768
 4769
 4770
 4771
 4772
 4773
 4774
 4775
 4776
 4777
 4778
 4779
 4780
 4781
 4782
 4783
 4784
 4785
 4786
 4787
 4788
 4789
 4790
 4791
 4792
 4793
 4794
 4795
 4796
 4797
 4798
 4799
 4800
 4801
 4802
 4803
 4804
 4805
 4806
 4807
 4808
 4809
 4810
 4811
 4812
 4813
 4814
 4815
 4816
 4817
 4818
 4819
 4820
 4821
 4822
 4823
 4824
 4825
 4826
 4827
 4828
 4829
 4830
 4831
 4832
 4833
 4834
 4835
 4836
 4837
 4838
 4839
 4840
 4841
 4842
 4843
 4844
 4845
 4846
 4847
 4848
 4849
 4850
 4851
 4852
 4853
 4854
 4855
 4856
 4857
 4858
 4859
 4860
 4861
 4862
 4863
 4864
 4865
 4866
 4867
 4868
 4869
 4870
 4871
 4872
 4873
 4874
 4875
 4876
 4877
 4878
 4879
 4880
 4881
 4882
 4883
 4884
 4885
 4886
 4887
 4888
 4889
 4890
 4891
 4892
 4893
 4894
 4895
 4896
 4897
 4898
 4899
 4900
 4901
 4902
 4903
 4904
 4905
 4906
 4907
 4908
 4909
 4910
 4911
 4912
 4913
 4914
 4915
 4916
 4917
 4918
 4919
 4920
 4921
 4922
 4923
 4924
 4925
 4926
 4927
 4928
 4929
 4930
 4931
 4932
 4933
 4934
 4935
 4936
 4937
 4938
 4939
 4940
 4941
 4942
 4943
 4944
 4945
 4946
 4947
 4948
 4949
 4950
 4951
 4952
 4953
 4954
 4955
 4956
 4957
 4958
 4959
 4960
 4961
 4962
 4963
 4964
 4965
 4966
 4967
 4968
 4969
 4970
 4971
 4972
 4973
 4974
 4975
 4976
 4977
 4978
 4979
 4980
 4981
 4982
 4983
 4984
 4985
 4986
 4987
 4988
 4989
 4990
 4991
 4992
 4993
 4994
 4995
 4996
 4997
 4998
 4999
 5000
 5001
 5002
 5003
 5004
 5005
 5006
 5007
 5008
 5009
 5010
 5011
 5012
 5013
 5014
 5015
 5016
 5017
 5018
 5019
 5020
 5021
 5022
 5023
 5024
 5025
 5026
 5027
 5028
 5029
 5030
 5031
 5032
 5033
 5034
 5035
 5036
 5037
 5038
 5039
 5040
 5041
 5042
 5043
 5044
 5045
 5046
 5047
 5048
 5049
 5050
 5051
 5052
 5053
 5054
 5055
 5056
 5057
 5058
 5059
 5060
 5061
 5062
 5063
 5064
 5065
 5066
 5067
 5068
 5069
 5070
 5071
 5072
 5073
 5074
 5075
 5076
 5077
 5078
 5079
 5080
 5081
 5082
 5083
 5084
 5085
 5086
 5087
 5088
 5089
 5090
 5091
 5092
 5093
 5094
 5095
 5096
 5097
 5098
 5099
 5100
 5101
 5102
 5103
 5104
 5105
 5106
 5107
 5108
 5109
 5110
 5111
 5112
 5113
 5114
 5115
 5116
 5117
 5118
 5119
 5120
 5121
 5122
 5123
 5124
 5125
 5126
 5127
 5128
 5129
 5130
 5131
 5132
 5133
 5134
 5135
 5136
 5137
 5138
 5139
 5140
 5141
 5142
 5143
 5144
 5145
 5146
 5147
 5148
 5149
 5150
 5151
 5152
 5153
 5154
 5155
 5156
 5157
 5158
 5159
 5160
 5161
 5162
 5163
 5164
 5165
 5166
 5167
 5168
 5169
 5170
 5171
 5172
 5173
 5174
 5175
 5176
 5177
 5178
 5179
 5180
 5181
 5182
 5183
 5184
 5185
 5186
 5187
 5188
 5189
 5190
 5191
 5192
 5193
 5194
 5195
 5196
 5197
 5198
 5199
 5200
 5201
 5202
 5203
 5204
 5205
 5206
 5207
 5208
 5209
 5210
 5211
 5212
 5213
 5214
 5215
 5216
 5217
 5218
 5219
 5220
 5221
 5222
 5223
 5224
 5225
 5226
 5227
 5228
 5229
 5230
 5231
 5232
 5233
 5234
 5235
 5236
 5237
 5238
 5239
 5240
 5241
 5242
 5243
 5244
 5245
 5246
 5247
 5248
 5249
 5250
 5251
 5252
 5253
 5254
 5255
 5256
 5257
 5258
 5259
 5260
 5261
 5262
 5263
 5264
 5265
 5266
 5267
 5268
 5269
 5270
 5271
 5272
 5273
 5274
 5275
 5276
 5277
 5278
 5279
 5280
 5281
 5282
 5283
 5284
 5285
 5286
 5287
 5288
 5289
 5290
 5291
 5292
 5293
 5294
 5295
 5296
 5297
 5298
 5299
 5300
 5301
 5302
 5303
 5304
 5305
 5306
 5307
 5308
 5309
 5310
 5311
 5312
 5313
 5314
 5315
 5316
 5317
 5318
 5319
 5320
 5321
 5322
 5323
 5324
 5325
 5326
 5327
 5328
 5329
 5330
 5331
 5332
 5333
 5334
 5335
 5336
 5337
 5338
 5339
 5340
 5341
 5342
 5343
 5344
 5345
 5346
 5347
 5348
 5349
 5350
 5351
 5352
 5353
 5354
 5355
 5356
 5357
 5358
 5359
 5360
 5361
 5362
 5363
 5364
 5365
 5366
 5367
 5368
 5369
 5370
 5371
 5372
 5373
 5374
 5375
 5376
 5377
 5378
 5379
 5380
 5381
 5382
 5383
 5384
 5385
 5386
 5387
 5388
 5389
 5390
 5391
 5392
 5393
 5394
 5395
 5396
 5397
 5398
 5399
 5400
 5401
 5402
 5403
 5404
 5405
 5406
 5407
 5408
 5409
 5410
 5411
 5412
 5413
 5414
 5415
 5416
 5417
 5418
 5419
 5420
 5421
 5422
 5423
 5424
 5425
 5426
 5427
 5428
 5429
 5430
 5431
 5432
 5433
 5434
 5435
 5436
 5437
 5438
 5439
 5440
 5441
 5442
 5443
 5444
 5445
 5446
 5447
 5448
 5449
 5450
 5451
 5452
 5453
 5454
 5455
 5456
 5457
 5458
 5459
 5460
 5461
 5462
 5463
 5464
 5465
 5466
 5467
 5468
 5469
 5470
 5471
 5472
 5473
 5474
 5475
 5476
 5477
 5478
 5479
 5480
 5481
 5482
 5483
 5484
 5485
 5486
 5487
 5488
 5489
 5490
 5491
 5492
 5493
 5494
 5495
 5496
 5497
 5498
 5499
 5500
 5501
 5502
 5503
 5504
 5505
 5506
 5507
 5508
 5509
 5510
 5511
 5512
 5513
 5514
 5515
 5516
 5517
 5518
 5519
 5520
 5521
 5522
 5523
 5524
 5525
 5526
 5527
 5528
 5529
 5530
 5531
 5532
 5533
 5534
 5535
 5536
 5537
 5538
 5539
 5540
 5541
 5542
 5543
 5544
 5545
 5546
 5547
 5548
 5549
 5550
 5551
 5552
 5553
 5554
 5555
 5556
 5557
 5558
 5559
 5560
 5561
 5562
 5563
 5564
 5565
 5566
 5567
 5568
 5569
 5570
 5571
 5572
 5573
 5574
 5575
 5576
 5577
 5578
 5579
 5580
 5581
 5582
 5583
 5584
 5585
 5586
 5587
 5588
 5589
 5590
 5591
 5592
 5593
 5594
 5595
 5596
 5597
 5598
 5599
 5600
 5601
 5602
 5603
 5604
 5605
 5606
 5607
 5608
 5609
 5610
 5611
 5612
 5613
 5614
 5615
 5616
 5617
 5618
 5619
 5620
 5621
 5622
 5623
 5624
 5625
 5626
 5627
 5628
 5629
 5630
 5631
 5632
 5633
 5634
 5635
 5636
 5637
 5638
 5639
 5640
 5641
 5642
 5643
 5644
 5645
 5646
 5647
 5648
 5649
 5650
 5651
 5652
 5653
 5654
 5655
 5656
 5657
 5658
 5659
 5660
 5661
 5662
 5663
 5664
 5665
 5666
 5667
 5668
 5669
 5670
 5671
 5672
 5673
 5674
 5675
 5676
 5677
 5678
 5679
 5680
 5681
 5682
 5683
 5684
 5685
 5686
 5687
 5688
 5689
 5690
 5691
 5692
 5693
 5694
 5695
 5696
 5697
 5698
 5699
 5700
 5701
 5702
 5703
 5704
 5705
 5706
 5707
 5708
 5709
 5710
 5711
 5712
 5713
 5714
 5715
 5716
 5717
 5718
 5719
 5720
 5721
 5722
 5723
 5724
 5725
 5726
 5727
 5728
 5729
 5730
 5731
 5732
 5733
 5734
 5735
 5736
 5737
 5738
 5739
 5740
 5741
 5742
 5743
 5744
 5745
 5746
 5747
 5748
 5749
 5750
 5751
 5752
 5753
 5754
 5755
 5756
 5757
 5758
 5759
 5760
 5761
 5762
 5763
 5764
 5765
 5766
 5767
 5768
 5769
 5770
 5771
 5772
 5773
 5774
 5775
 5776
 5777
 5778
 5779
 5780
 5781
 5782
 5783
 5784
 5785
 5786
 5787
 5788
 5789
 5790
 5791
 5792
 5793
 5794
 5795
 5796
 5797
 5798
 5799
 5800
 5801
 5802
 5803
 5804
 5805
 5806
 5807
 5808
 5809
 5810
 5811
 5812
 5813
 5814
 5815
 5816
 5817
 5818
 5819
 5820
 5821
 5822
 5823
 5824
 5825
 5826
 5827
 5828
 5829
 5830
 5831
 5832
 5833
 5834
 5835
 5836
 5837
 5838
 5839
 5840
 5841
 5842
 5843
 5844
 5845
 5846
 5847
 5848
 5849
 5850
 5851
 5852
 5853
 5854
 5855
 5856
 5857
 5858
 5859
 5860
 5861
 5862
 5863
 5864
 5865
 5866
 5867
 5868
 5869
 5870
 5871
 5872
 5873
 5874
 5875
 5876
 5877
 5878
 5879
 5880
 5881
 5882
 5883
 5884
 5885
 5886
 5887
 5888
 5889
 5890
 5891
 5892
 5893
 5894
 5895
 5896
 5897
 5898
 5899
 5900
 5901
 5902
 5903
 5904
 5905
 5906
 5907
 5908
 5909
 5910
 5911
 5912
 5913
 5914
 5915
 5916
 5917
 5918
 5919
 5920
 5921
 5922
 5923
 5924
 5925
 5926
 5927
 5928
 5929
 5930
 5931
 5932
 5933
 5934
 5935
 5936
 5937
 5938
 5939
 5940
 5941
 5942
 5943
 5944
 5945
 5946
 5947
 5948
 5949
 5950
 5951
 5952
 5953
 5954
 5955
 5956
 5957
 5958
 5959
 5960
 5961
 5962
 5963
 5964
 5965
 5966
 5967
 5968
 5969
 5970
 5971
 5972
 5973
 5974
 5975
 5976
 5977
 5978
 5979
 5980
 5981
 5982
 5983
 5984
 5985
 5986
 5987
 5988
 5989
 5990
 5991
 5992
 5993
 5994
 5995
 5996
 5997
 5998
 5999
 6000
 6001
 6002
 6003
 6004
 6005
 6006
 6007
 6008
 6009
 6010
 6011
 6012
 6013
 6014
 6015
 6016
 6017
 6018
 6019
 6020
 6021
 6022
 6023
 6024
 6025
 6026
 6027
 6028
 6029
 6030
 6031
 6032
 6033
 6034
 6035
 6036
 6037
 6038
 6039
 6040
 6041
 6042
 6043
 6044
 6045
 6046
 6047
 6048
 6049
 6050
 6051
 6052
 6053
 6054
 6055
 6056
 6057
 6058
 6059
 6060
 6061
 6062
 6063
 6064
 6065
 6066
 6067
 6068
 6069
 6070
 6071
 6072
 6073
 6074
 6075
 6076
 6077
 6078
 6079
 6080
 6081
 6082
 6083
 6084
 6085
 6086
 6087
 6088
 6089
 6090
 6091
 6092
 6093
 6094
 6095
 6096
 6097
 6098
 6099
 6100
 6101
 6102
 6103
 6104
 6105
 6106
 6107
 6108
 6109
 6110
 6111
 6112
 6113
 6114
 6115
 6116
 6117
 6118
 6119
 6120
 6121
 6122
 6123
 6124
 6125
 6126
 6127
 6128
 6129
 6130
 6131
 6132
 6133
 6134
 6135
 6136
 6137
 6138
 6139
 6140
 6141
 6142
 6143
 6144
 6145
 6146
 6147
 6148
 6149
 6150
 6151
 6152
 6153
 6154
 6155
 6156
 6157
 6158
 6159
 6160
 6161
 6162
 6163
 6164
 6165
 6166
 6167
 6168
 6169
 6170
 6171
 6172
 6173
 6174
 6175
 6176
 6177
 6178
 6179
 6180
 6181
 6182
 6183
 6184
 6185
 6186
 6187
 6188
 6189
 6190
 6191
 6192
 6193
 6194
 6195
 6196
 6197
 6198
 6199
 6200
 6201
 6202
 6203
 6204
 6205
 6206
 6207
 6208
 6209
 6210
 6211
 6212
 6213
 6214
 6215
 6216
 6217
 6218
 6219
 6220
 6221
 6222
 6223
 6224
 6225
 6226
 6227
 6228
 6229
 6230
 6231
 6232
 6233
 6234
 6235
 6236
 6237
 6238
 6239
 6240
 6241
 6242
 6243
 6244
 6245
 6246
 6247
 6248
 6249
 6250
 6251
 6252
 6253
 6254
 6255
 6256
 6257
 6258
 6259
 6260
 6261
 6262
 6263
 6264
 6265
 6266
 6267
 6268
 6269
 6270
 6271
 6272
 6273
 6274
 6275
 6276
 6277
 6278
 6279
 6280
 6281
 6282
 6283
 6284
 6285
 6286
 6287
 6288
 6289
 6290
 6291
 6292
 6293
 6294
 6295
 6296
 6297
 6298
 6299
 6300
 6301
 6302
 6303
 6304
 6305
 6306
 6307
 6308
 6309
 6310
 6311
 6312
 6313
 6314
 6315
 6316
 6317
 6318
 6319
 6320
 6321
 6322
 6323
 6324
 6325
 6326
 6327
 6328
 6329
 6330
 6331
 6332
 6333
 6334
 6335
 6336
 6337
 6338
 6339
 6340
 6341
 6342
 6343
 6344
 6345
 6346
 6347
 6348
 6349
 6350
 6351
 6352
 6353
 6354
 6355
 6356
 6357
 6358
 6359
 6360
 6361
 6362
 6363
 6364
 6365
 6366
 6367
 6368
 6369
 6370
 6371
 6372
 6373
 6374
 6375
 6376
 6377
 6378
 6379
 6380
 6381
 6382
 6383
 6384
 6385
 6386
 6387
 6388
 6389
 6390
 6391
 6392
 6393
 6394
 6395
 6396
 6397
 6398
 6399
 6400
 6401
 6402
 6403
 6404
 6405
 6406
 6407
 6408
 6409
 6410
 6411
 6412
 6413
 6414
 6415
 6416
 6417
 6418
 6419
 6420
 6421
 6422
 6423
 6424
 6425
 6426
 6427
 6428
 6429
 6430
 6431
 6432
 6433
 6434
 6435
 6436
 6437
 6438
 6439
 6440
 6441
 6442
 6443
 6444
 6445
 6446
 6447
 6448
 6449
 6450
 6451
 6452
 6453
 6454
 6455
 6456
 6457
 6458
 6459
 6460
 6461
 6462
 6463
 6464
 6465
 6466
 6467
 6468
 6469
 6470
 6471
 6472
 6473
 6474
 6475
 6476
 6477
 6478
 6479
 6480
 6481
 6482
 6483
 6484
 6485
 6486
 6487
 6488
 6489
 6490
 6491
 6492
 6493
 6494
 6495
 6496
 6497
 6498
 6499
 6500
 6501
 6502
 6503
 6504
 6505
 6506
 6507
 6508
 6509
 6510
 6511
 6512
 6513
 6514
 6515
 6516
 6517
 6518
 6519
 6520
 6521
 6522
 6523
 6524
 6525
 6526
 6527
 6528
 6529
 6530
 6531
 6532
 6533
 6534
 6535
 6536
 6537
 6538
 6539
 6540
 6541
 6542
 6543
 6544
 6545
 6546
 6547
 6548
 6549
 6550
 6551
 6552
 6553
 6554
 6555
 6556
 6557
 6558
 6559
 6560
 6561
 6562
 6563
 6564
 6565
 6566
 6567
 6568
 6569
 6570
 6571
 6572
 6573
 6574
 6575
 6576
 6577
 6578
 6579
 6580
 6581
 6582
 6583
 6584
 6585
 6586
 6587
 6588
 6589
 6590
 6591
 6592
 6593
 6594
 6595
 6596
 6597
 6598
 6599
 6600
 6601
 6602
 6603
 6604
 6605
 6606
 6607
 6608
 6609
 6610
 6611
 6612
 6613
 6614
 6615
 6616
 6617
 6618
 6619
 6620
 6621
 6622
 6623
 6624
 6625
 6626
 6627
 6628
 6629
 6630
 6631
 6632
 6633
 6634
 6635
 6636
 6637
 6638
 6639
 6640
 6641
 6642
 6643
 6644
 6645
 6646
 6647
 6648
 6649
 6650
 6651
 6652
 6653
 6654
 6655
 6656
 6657
 6658
 6659
 6660
 6661
 6662
 6663
 6664
 6665
 6666
 6667
 6668
 6669
 6670
 6671
 6672
 6673
 6674
 6675
 6676
 6677
 6678
 6679
 6680
 6681
 6682
 6683
 6684
 6685
 6686
 6687
 6688
 6689
 6690
 6691
 6692
 6693
 6694
 6695
 6696
 6697
 6698
 6699
 6700
 6701
 6702
 6703
 6704
 6705
 6706
 6707
 6708
 6709
 6710
 6711
 6712
 6713
 6714
 6715
 6716
 6717
 6718
 6719
 6720
 6721
 6722
 6723
 6724
 6725
 6726
 6727
 6728
 6729
 6730
 6731
 6732
 6733
 6734
 6735
 6736
 6737
 6738
 6739
 6740
 6741
 6742
 6743
 6744
 6745
 6746
 6747
 6748
 6749
 6750
 6751
 6752
 6753
 6754
 6755
 6756
 6757
 6758
 6759
 6760
 6761
 6762
 6763
 6764
 6765
 6766
 6767
 6768
 6769
 6770
 6771
 6772
 6773
 6774
 6775
 6776
 6777
 6778
 6779
 6780
 6781
 6782
 6783
 6784
 6785
 6786
 6787
 6788
 6789
 6790
 6791
 6792
 6793
 6794
 6795
 6796
 6797
 6798
 6799
 6800
 6801
 6802
 6803
 6804
 6805
 6806
 6807
 6808
 6809
 6810
 6811
 6812
 6813
 6814
 6815
 6816
 6817
 6818
 6819
 6820
 6821
 6822
 6823
 6824
 6825
 6826
 6827
 6828
 6829
 6830
 6831
 6832
 6833
 6834
 6835
 6836
 6837
 6838
 6839
 6840
 6841
 6842
 6843
 6844
 6845
 6846
 6847
 6848
 6849
 6850
 6851
 6852
 6853
 6854
 6855
 6856
 6857
 6858
 6859
 6860
 6861
 6862
 6863
 6864
 6865
 6866
 6867
 6868
 6869
 6870
 6871
 6872
 6873
 6874
 6875
 6876
 6877
 6878
 6879
 6880
 6881
 6882
 6883
 6884
 6885
 6886
 6887
 6888
 6889
 6890
 6891
 6892
 6893
 6894
 6895
 6896
 6897
 6898
 6899
 6900
 6901
 6902
 6903
 6904
 6905
 6906
 6907
 6908
 6909
 6910
 6911
 6912
 6913
 6914
 6915
 6916
 6917
 6918
 6919
 6920
 6921
 6922
 6923
 6924
 6925
 6926
 6927
 6928
 6929
 6930
 6931
 6932
 6933
 6934
 6935
 6936
 6937
 6938
 6939
 6940
 6941
 6942
 6943
 6944
 6945
 6946
 6947
 6948
 6949
 6950
 6951
 6952
 6953
 6954
 6955
 6956
 6957
 6958
 6959
 6960
 6961
 6962
 6963
 6964
 6965
 6966
 6967
 6968
 6969
 6970
 6971
 6972
 6973
 6974
 6975
 6976
 6977
 6978
 6979
 6980
 6981
 6982
 6983
 6984
 6985
 6986
 6987
 6988
 6989
 6990
 6991
 6992
 6993
 6994
 6995
 6996
 6997
 6998
 6999
 7000
 7001
 7002
 7003
 7004
 7005
 7006
 7007
 7008
 7009
 7010
 7011
 7012
 7013
 7014
 7015
 7016
 7017
 7018
 7019
 7020
 7021
 7022
 7023
 7024
 7025
 7026
 7027
 7028
 7029
 7030
 7031
 7032
 7033
 7034
 7035
 7036
 7037
 7038
 7039
 7040
 7041
 7042
 7043
 7044
 7045
 7046
 7047
 7048
 7049
 7050
 7051
 7052
 7053
 7054
 7055
 7056
 7057
 7058
 7059
 7060
 7061
 7062
 7063
 7064
 7065
 7066
 7067
 7068
 7069
 7070
 7071
 7072
 7073
 7074
 7075
 7076
 7077
 7078
 7079
 7080
 7081
 7082
 7083
 7084
 7085
 7086
 7087
 7088
 7089
 7090
 7091
 7092
 7093
 7094
 7095
 7096
 7097
 7098
 7099
 7100
 7101
 7102
 7103
 7104
 7105
 7106
 7107
 7108
 7109
 7110
 7111
 7112
 7113
 7114
 7115
 7116
 7117
 7118
 7119
 7120
 7121
 7122
 7123
 7124
 7125
 7126
 7127
 7128
 7129
 7130
 7131
 7132
 7133
 7134
 7135
 7136
 7137
 7138
 7139
 7140
 7141
 7142
 7143
 7144
 7145
 7146
 7147
 7148
 7149
 7150
 7151
 7152
 7153
 7154
 7155
 7156
 7157
 7158
 7159
 7160
 7161
 7162
 7163
 7164
 7165
 7166
 7167
 7168
 7169
 7170
 7171
 7172
 7173
 7174
 7175
 7176
 7177
 7178
 7179
 7180
 7181
 7182
 7183
 7184
 7185
 7186
 7187
 7188
 7189
 7190
 7191
 7192
 7193
 7194
 7195
 7196
 7197
 7198
 7199
 7200
 7201
 7202
 7203
 7204
 7205
 7206
 7207
 7208
 7209
 7210
 7211
 7212
 7213
 7214
 7215
 7216
 7217
 7218
 7219
 7220
 7221
 7222
 7223
 7224
 7225
 7226
 7227
 7228
 7229
 7230
 7231
 7232
 7233
 7234
 7235
 7236
 7237
 7238
 7239
 7240
 7241
 7242
 7243
 7244
 7245
 7246
 7247
 7248
 7249
 7250
 7251
 7252
 7253
 7254
 7255
 7256
 7257
 7258
 7259
 7260
 7261
 7262
 7263
 7264
 7265
 7266
 7267
 7268
 7269
 7270
 7271
 7272
 7273
 7274
 7275
 7276
 7277
 7278
 7279
 7280
 7281
 7282
 7283
 7284
 7285
 7286
 7287
 7288
 7289
 7290
 7291
 7292
 7293
 7294
 7295
 7296
 7297
 7298
 7299
 7300
 7301
 7302
 7303
 7304
 7305
 7306
 7307
 7308
 7309
 7310
 7311
 7312
 7313
 7314
 7315
 7316
 7317
 7318
 7319
 7320
 7321
 7322
 7323
 7324
 7325
 7326
 7327
 7328
 7329
 7330
 7331
 7332
 7333
 7334
 7335
 7336
 7337
 7338
 7339
 7340
 7341
 7342
 7343
 7344
 7345
 7346
 7347
 7348
 7349
 7350
 7351
 7352
 7353
 7354
 7355
 7356
 7357
 7358
 7359
 7360
 7361
 7362
 7363
 7364
 7365
 7366
 7367
 7368
 7369
 7370
 7371
 7372
 7373
 7374
 7375
 7376
 7377
 7378
 7379
 7380
 7381
 7382
 7383
 7384
 7385
 7386
 7387
 7388
 7389
 7390
 7391
 7392
 7393
 7394
 7395
 7396
 7397
 7398
 7399
 7400
 7401
 7402
 7403
 7404
 7405
 7406
 7407
 7408
 7409
 7410
 7411
 7412
 7413
 7414
 7415
 7416
 7417
 7418
 7419
 7420
 7421
 7422
 7423
 7424
 7425
 7426
 7427
 7428
 7429
 7430
 7431
 7432
 7433
 7434
 7435
 7436
 7437
 7438
 7439
 7440
 7441
 7442
 7443
 7444
 7445
 7446
 7447
 7448
 7449
 7450
 7451
 7452
 7453
 7454
 7455
 7456
 7457
 7458
 7459
 7460
 7461
 7462
 7463
 7464
 7465
 7466
 7467
 7468
 7469
 7470
 7471
 7472
 7473
 7474
 7475
 7476
 7477
 7478
 7479
 7480
 7481
 7482
 7483
 7484
 7485
 7486
 7487
 7488
 7489
 7490
 7491
 7492
 7493
 7494
 7495
 7496
 7497
 7498
 7499
 7500
 7501
 7502
 7503
 7504
 7505
 7506
 7507
 7508
 7509
 7510
 7511
 7512
 7513
 7514
 7515
 7516
 7517
 7518
 7519
 7520
 7521
 7522
 7523
 7524
 7525
 7526
 7527
 7528
 7529
 7530
 7531
 7532
 7533
 7534
 7535
 7536
 7537
 7538
 7539
 7540
 7541
 7542
 7543
 7544
 7545
 7546
 7547
 7548
 7549
 7550
 7551
 7552
 7553
 7554
 7555
 7556
 7557
 7558
 7559
 7560
 7561
 7562
 7563
 7564
 7565
 7566
 7567
 7568
 7569
 7570
 7571
 7572
 7573
 7574
 7575
 7576
 7577
 7578
 7579
 7580
 7581
 7582
 7583
 7584
 7585
 7586
 7587
 7588
 7589
 7590
 7591
 7592
 7593
 7594
 7595
 7596
 7597
 7598
 7599
 7600
 7601
 7602
 7603
 7604
 7605
 7606
 7607
 7608
 7609
 7610
 7611
 7612
 7613
 7614
 7615
 7616
 7617
 7618
 7619
 7620
 7621
 7622
 7623
 7624
 7625
 7626
 7627
 7628
 7629
 7630
 7631
 7632
 7633
 7634
 7635
 7636
 7637
 7638
 7639
 7640
 7641
 7642
 7643
 7644
 7645
 7646
 7647
 7648
 7649
 7650
 7651
 7652
 7653
 7654
 7655
 7656
 7657
 7658
 7659
 7660
 7661
 7662
 7663
 7664
 7665
 7666
 7667
 7668
 7669
 7670
 7671
 7672
 7673
 7674
 7675
 7676
 7677
 7678
 7679
 7680
 7681
 7682
 7683
 7684
 7685
 7686
 7687
 7688
 7689
 7690
 7691
 7692
 7693
 7694
 7695
 7696
 7697
 7698
 7699
 7700
 7701
 7702
 7703
 7704
 7705
 7706
 7707
 7708
 7709
 7710
 7711
 7712
 7713
 7714
 7715
 7716
 7717
 7718
 7719
 7720
 7721
 7722
 7723
 7724
 7725
 7726
 7727
 7728
 7729
 7730
 7731
 7732
 7733
 7734
 7735
 7736
 7737
 7738
 7739
 7740
 7741
 7742
 7743
 7744
 7745
 7746
 7747
 7748
 7749
 7750
 7751
 7752
 7753
 7754
 7755
 7756
 7757
 7758
 7759
 7760
 7761
 7762
 7763
 7764
 7765
 7766
 7767
 7768
 7769
 7770
 7771
 7772
 7773
 7774
 7775
 7776
 7777
 7778
 7779
 7780
 7781
 7782
 7783
 7784
 7785
 7786
 7787
 7788
 7789
 7790
 7791
 7792
 7793
 7794
 7795
 7796
 7797
 7798
 7799
 7800
 7801
 7802
 7803
 7804
 7805
 7806
 7807
 7808
 7809
 7810
 7811
 7812
 7813
 7814
 7815
 7816
 7817
 7818
 7819
 7820
 7821
 7822
 7823
 7824
 7825
 7826
 7827
 7828
 7829
 7830
 7831
 7832
 7833
 7834
 7835
 7836
 7837
 7838
 7839
 7840
 7841
 7842
 7843
 7844
 7845
 7846
 7847
 7848
 7849
 7850
 7851
 7852
 7853
 7854
 7855
 7856
 7857
 7858
 7859
 7860
 7861
 7862
 7863
 7864
 7865
 7866
 7867
 7868
 7869
 7870
 7871
 7872
 7873
 7874
 7875
 7876
 7877
 7878
 7879
 7880
 7881
 7882
 7883
 7884
 7885
 7886
 7887
 7888
 7889
 7890
 7891
 7892
 7893
 7894
 7895
 7896
 7897
 7898
 7899
 7900
 7901
 7902
 7903
 7904
 7905
 7906
 7907
 7908
 7909
 7910
 7911
 7912
 7913
 7914
 7915
 7916
 7917
 7918
 7919
 7920
 7921
 7922
 7923
 7924
 7925
 7926
 7927
 7928
 7929
 7930
 7931
 7932
 7933
 7934
 7935
 7936
 7937
 7938
 7939
 7940
 7941
 7942
 7943
 7944
 7945
 7946
 7947
 7948
 7949
 7950
 7951
 7952
 7953
 7954
 7955
 7956
 7957
 7958
 7959
 7960
 7961
 7962
 7963
 7964
 7965
 7966
 7967
 7968
 7969
 7970
 7971
 7972
 7973
 7974
 7975
 7976
 7977
 7978
 7979
 7980
 7981
 7982
 7983
 7984
 7985
 7986
 7987
 7988
 7989
 7990
 7991
 7992
 7993
 7994
 7995
 7996
 7997
 7998
 7999
 8000
 8001
 8002
 8003
 8004
 8005
 8006
 8007
 8008
 8009
 8010
 8011
 8012
 8013
 8014
 8015
 8016
 8017
 8018
 8019
 8020
 8021
 8022
 8023
 8024
 8025
 8026
 8027
 8028
 8029
 8030
 8031
 8032
 8033
 8034
 8035
 8036
 8037
 8038
 8039
 8040
 8041
 8042
 8043
 8044
 8045
 8046
 8047
 8048
 8049
 8050
 8051
 8052
 8053
 8054
 8055
 8056
 8057
 8058
 8059
 8060
 8061
 8062
 8063
 8064
 8065
 8066
 8067
 8068
 8069
 8070
 8071
 8072
 8073
 8074
 8075
 8076
 8077
 8078
 8079
 8080
 8081
 8082
 8083
 8084
 8085
 8086
 8087
 8088
 8089
 8090
 8091
 8092
 8093
 8094
 8095
 8096
 8097
 8098
 8099
 8100
 8101
 8102
 8103
 8104
 8105
 8106
 8107
 8108
 8109
 8110
 8111
 8112
 8113
 8114
 8115
 8116
 8117
 8118
 8119
 8120
 8121
 8122
 8123
 8124
 8125
 8126
 8127
 8128
 8129
 8130
 8131
 8132
 8133
 8134
 8135
 8136
 8137
 8138
 8139
 8140
 8141
 8142
 8143
 8144
 8145
 8146
 8147
 8148
 8149
 8150
 8151
 8152
 8153
 8154
 8155
 8156
 8157
 8158
 8159
 8160
 8161
 8162
 8163
 8164
 8165
 8166
 8167
 8168
 8169
 8170
 8171
 8172
 8173
 8174
 8175
 8176
 8177
 8178
 8179
 8180
 8181
 8182
 8183
 8184
 8185
 8186
 8187
 8188
 8189
 8190
 8191
 8192
 8193
 8194
 8195
 8196
 8197
 8198
 8199
 8200
 8201
 8202
 8203
 8204
 8205
 8206
 8207
 8208
 8209
 8210
 8211
 8212
 8213
 8214
 8215
 8216
 8217
 8218
 8219
 8220
 8221
 8222
 8223
 8224
 8225
 8226
 8227
 8228
 8229
 8230
 8231
 8232
 8233
 8234
 8235
 8236
 8237
 8238
 8239
 8240
 8241
 8242
 8243
 8244
 8245
 8246
 8247
 8248
 8249
 8250
 8251
 8252
 8253
 8254
 8255
 8256
 8257
 8258
 8259
 8260
 8261
 8262
 8263
 8264
 8265
 8266
 8267
 8268
 8269
 8270
 8271
 8272
 8273
 8274
 8275
 8276
 8277
 8278
 8279
 8280
 8281
 8282
 8283
 8284
 8285
 8286
 8287
 8288
 8289
 8290
 8291
 8292
 8293
 8294
 8295
 8296
 8297
 8298
 8299
 8300
 8301
 8302
 8303
 8304
 8305
 8306
 8307
 8308
 8309
 8310
 8311
 8312
 8313
 8314
 8315
 8316
 8317
 8318
 8319
 8320
 8321
 8322
 8323
 8324
 8325
 8326
 8327
 8328
 8329
 8330
 8331
 8332
 8333
 8334
 8335
 8336
 8337
 8338
 8339
 8340
 8341
 8342
 8343
 8344
 8345
 8346
 8347
 8348
 8349
 8350
 8351
 8352
 8353
 8354
 8355
 8356
 8357
 8358
 8359
 8360
 8361
 8362
 8363
 8364
 8365
 8366
 8367
 8368
 8369
 8370
 8371
 8372
 8373
 8374
 8375
 8376
 8377
 8378
 8379
 8380
 8381
 8382
 8383
 8384
 8385
 8386
 8387
 8388
 8389
 8390
 8391
 8392
 8393
 8394
 8395
 8396
 8397
 8398
 8399
 8400
 8401
 8402
 8403
 8404
 8405
 8406
 8407
 8408
 8409
 8410
 8411
 8412
 8413
 8414
 8415
 8416
 8417
 8418
 8419
 8420
 8421
 8422
 8423
 8424
 8425
 8426
 8427
 8428
 8429
 8430
 8431
 8432
 8433
 8434
 8435
 8436
 8437
 8438
 8439
 8440
 8441
 8442
 8443
 8444
 8445
 8446
 8447
 8448
 8449
 8450
 8451
 8452
 8453
 8454
 8455
 8456
 8457
 8458
 8459
 8460
 8461
 8462
 8463
 8464
 8465
 8466
 8467
 8468
 8469
 8470
 8471
 8472
 8473
 8474
 8475
 8476
 8477
 8478
 8479
 8480
 8481
 8482
 8483
 8484
 8485
 8486
 8487
 8488
 8489
 8490
 8491
 8492
 8493
 8494
 8495
 8496
 8497
 8498
 8499
 8500
 8501
 8502
 8503
 8504
 8505
 8506
 8507
 8508
 8509
 8510
 8511
 8512
 8513
 8514
 8515
 8516
 8517
 8518
 8519
 8520
 8521
 8522
 8523
 8524
 8525
 8526
 8527
 8528
 8529
 8530
 8531
 8532
 8533
 8534
 8535
 8536
 8537
 8538
 8539
 8540
 8541
 8542
 8543
 8544
 8545
 8546
 8547
 8548
 8549
 8550
 8551
 8552
 8553
 8554
 8555
 8556
 8557
 8558
 8559
 8560
 8561
 8562
 8563
 8564
 8565
 8566
 8567
 8568
 8569
 8570
 8571
 8572
 8573
 8574
 8575
 8576
 8577
 8578
 8579
 8580
 8581
 8582
 8583
 8584
 8585
 8586
 8587
 8588
 8589
 8590
 8591
 8592
 8593
 8594
 8595
 8596
 8597
 8598
 8599
 8600
 8601
 8602
 8603
 8604
 8605
 8606
 8607
 8608
 8609
 8610
 8611
 8612
 8613
 8614
 8615
 8616
 8617
 8618
 8619
 8620
 8621
 8622
 8623
 8624
 8625
 8626
 8627
 8628
 8629
 8630
 8631
 8632
 8633
 8634
 8635
 8636
 8637
 8638
 8639
 8640
 8641
 8642
 8643
 8644
 8645
 8646
 8647
 8648
 8649
 8650
 8651
 8652
 8653
 8654
 8655
 8656
 8657
 8658
 8659
 8660
 8661
 8662
 8663
 8664
 8665
 8666
 8667
 8668
 8669
 8670
 8671
 8672
 8673
 8674
 8675
 8676
 8677
 8678
 8679
 8680
 8681
 8682
 8683
 8684
 8685
 8686
 8687
 8688
 8689
 8690
 8691
 8692
 8693
 8694
 8695
 8696
 8697
 8698
 8699
 8700
 8701
 8702
 8703
 8704
 8705
 8706
 8707
 8708
 8709
 8710
 8711
 8712
 8713
 8714
 8715
 8716
 8717
 8718
 8719
 8720
 8721
 8722
 8723
 8724
 8725
 8726
 8727
 8728
 8729
 8730
 8731
 8732
 8733
 8734
 8735
 8736
 8737
 8738
 8739
 8740
 8741
 8742
 8743
 8744
 8745
 8746
 8747
 8748
 8749
 8750
 8751
 8752
 8753
 8754
 8755
 8756
 8757
 8758
 8759
 8760
 8761
 8762
 8763
 8764
 8765
 8766
 8767
 8768
 8769
 8770
 8771
 8772
 8773
 8774
 8775
 8776
 8777
 8778
 8779
 8780
 8781
 8782
 8783
 8784
 8785
 8786
 8787
 8788
 8789
 8790
 8791
 8792
 8793
 8794
 8795
 8796
 8797
 8798
 8799
 8800
 8801
 8802
 8803
 8804
 8805
 8806
 8807
 8808
 8809
 8810
 8811
 8812
 8813
 8814
 8815
 8816
 8817
 8818
 8819
 8820
 8821
 8822
 8823
 8824
 8825
 8826
 8827
 8828
 8829
 8830
 8831
 8832
 8833
 8834
 8835
 8836
 8837
 8838
 8839
 8840
 8841
 8842
 8843
 8844
 8845
 8846
 8847
 8848
 8849
 8850
 8851
 8852
 8853
 8854
 8855
 8856
 8857
 8858
 8859
 8860
 8861
 8862
 8863
 8864
 8865
 8866
 8867
 8868
 8869
 8870
 8871
 8872
 8873
 8874
 8875
 8876
 8877
 8878
 8879
 8880
 8881
 8882
 8883
 8884
 8885
 8886
 8887
 8888
 8889
 8890
 8891
 8892
 8893
 8894
 8895
 8896
 8897
 8898
 8899
 8900
 8901
 8902
 8903
 8904
 8905
 8906
 8907
 8908
 8909
 8910
 8911
 8912
 8913
 8914
 8915
 8916
 8917
 8918
 8919
 8920
 8921
 8922
 8923
 8924
 8925
 8926
 8927
 8928
 8929
 8930
 8931
 8932
 8933
 8934
 8935
 8936
 8937
 8938
 8939
 8940
 8941
 8942
 8943
 8944
 8945
 8946
 8947
 8948
 8949
 8950
 8951
 8952
 8953
 8954
 8955
 8956
 8957
 8958
 8959
 8960
 8961
 8962
 8963
 8964
 8965
 8966
 8967
 8968
 8969
 8970
 8971
 8972
 8973
 8974
 8975
 8976
 8977
 8978
 8979
 8980
 8981
 8982
 8983
 8984
 8985
 8986
 8987
 8988
 8989
 8990
 8991
 8992
 8993
 8994
 8995
 8996
 8997
 8998
 8999
 9000
 9001
 9002
 9003
 9004
 9005
 9006
 9007
 9008
 9009
 9010
 9011
 9012
 9013
 9014
 9015
 9016
 9017
 9018
 9019
 9020
 9021
 9022
 9023
 9024
 9025
 9026
 9027
 9028
 9029
 9030
 9031
 9032
 9033
 9034
 9035
 9036
 9037
 9038
 9039
 9040
 9041
 9042
 9043
 9044
 9045
 9046
 9047
 9048
 9049
 9050
 9051
 9052
 9053
 9054
 9055
 9056
 9057
 9058
 9059
 9060
 9061
 9062
 9063
 9064
 9065
 9066
 9067
 9068
 9069
 9070
 9071
 9072
 9073
 9074
 9075
 9076
 9077
 9078
 9079
 9080
 9081
 9082
 9083
 9084
 9085
 9086
 9087
 9088
 9089
 9090
 9091
 9092
 9093
 9094
 9095
 9096
 9097
 9098
 9099
 9100
 9101
 9102
 9103
 9104
 9105
 9106
 9107
 9108
 9109
 9110
 9111
 9112
 9113
 9114
 9115
 9116
 9117
 9118
 9119
 9120
 9121
 9122
 9123
 9124
 9125
 9126
 9127
 9128
 9129
 9130
 9131
 9132
 9133
 9134
 9135
 9136
 9137
 9138
 9139
 9140
 9141
 9142
 9143
 9144
 9145
 9146
 9147
 9148
 9149
 9150
 9151
 9152
 9153
 9154
 9155
 9156
 9157
 9158
 9159
 9160
 9161
 9162
 9163
 9164
 9165
 9166
 9167
 9168
 9169
 9170
 9171
 9172
 9173
 9174
 9175
 9176
 9177
 9178
 9179
 9180
 9181
 9182
 9183
 9184
 9185
 9186
 9187
 9188
 9189
 9190
 9191
 9192
 9193
 9194
 9195
 9196
 9197
 9198
 9199
 9200
 9201
 9202
 9203
 9204
 9205
 9206
 9207
 9208
 9209
 9210
 9211
 9212
 9213
 9214
 9215
 9216
 9217
 9218
 9219
 9220
 9221
 9222
 9223
 9224
 9225
 9226
 9227
 9228
 9229
 9230
 9231
 9232
 9233
 9234
 9235
 9236
 9237
 9238
 9239
 9240
 9241
 9242
 9243
 9244
 9245
 9246
 9247
 9248
 9249
 9250
 9251
 9252
 9253
 9254
 9255
 9256
 9257
 9258
 9259
 9260
 9261
 9262
 9263
 9264
 9265
 9266
 9267
 9268
 9269
 9270
 9271
 9272
 9273
 9274
 9275
 9276
 9277
 9278
 9279
 9280
 9281
 9282
 9283
 9284
 9285
 9286
 9287
 9288
 9289
 9290
 9291
 9292
 9293
 9294
 9295
 9296
 9297
 9298
 9299
 9300
 9301
 9302
 9303
 9304
 9305
 9306
 9307
 9308
 9309
 9310
 9311
 9312
 9313
 9314
 9315
 9316
 9317
 9318
 9319
 9320
 9321
 9322
 9323
 9324
 9325
 9326
 9327
 9328
 9329
 9330
 9331
 9332
 9333
 9334
 9335
 9336
 9337
 9338
 9339
 9340
 9341
 9342
 9343
 9344
 9345
 9346
 9347
 9348
 9349
 9350
 9351
 9352
 9353
 9354
 9355
 9356
 9357
 9358
 9359
 9360
 9361
 9362
 9363
 9364
 9365
 9366
 9367
 9368
 9369
 9370
 9371
 9372
 9373
 9374
 9375
 9376
 9377
 9378
 9379
 9380
 9381
 9382
 9383
 9384
 9385
 9386
 9387
 9388
 9389
 9390
 9391
 9392
 9393
 9394
 9395
 9396
 9397
 9398
 9399
 9400
 9401
 9402
 9403
 9404
 9405
 9406
 9407
 9408
 9409
 9410
 9411
 9412
 9413
 9414
 9415
 9416
 9417
 9418
 9419
 9420
 9421
 9422
 9423
 9424
 9425
 9426
 9427
 9428
 9429
 9430
 9431
 9432
 9433
 9434
 9435
 9436
 9437
 9438
 9439
 9440
 9441
 9442
 9443
 9444
 9445
 9446
 9447
 9448
 9449
 9450
 9451
 9452
 9453
 9454
 9455
 9456
 9457
 9458
 9459
 9460
 9461
 9462
 9463
 9464
 9465
 9466
 9467
 9468
 9469
 9470
 9471
 9472
 9473
 9474
 9475
 9476
 9477
 9478
 9479
 9480
 9481
 9482
 9483
 9484
 9485
 9486
 9487
 9488
 9489
 9490
 9491
 9492
 9493
 9494
 9495
 9496
 9497
 9498
 9499
 9500
 9501
 9502
 9503
 9504
 9505
 9506
 9507
 9508
 9509
 9510
 9511
 9512
 9513
 9514
 9515
 9516
 9517
 9518
 9519
 9520
 9521
 9522
 9523
 9524
 9525
 9526
 9527
 9528
 9529
 9530
 9531
 9532
 9533
 9534
 9535
 9536
 9537
 9538
 9539
 9540
 9541
 9542
 9543
 9544
 9545
 9546
 9547
 9548
 9549
 9550
 9551
 9552
 9553
 9554
 9555
 9556
 9557
 9558
 9559
 9560
 9561
 9562
 9563
 9564
 9565
 9566
 9567
 9568
 9569
 9570
 9571
 9572
 9573
 9574
 9575
 9576
 9577
 9578
 9579
 9580
 9581
 9582
 9583
 9584
 9585
 9586
 9587
 9588
 9589
 9590
 9591
 9592
 9593
 9594
 9595
 9596
 9597
 9598
 9599
 9600
 9601
 9602
 9603
 9604
 9605
 9606
 9607
 9608
 9609
 9610
 9611
 9612
 9613
 9614
 9615
 9616
 9617
 9618
 9619
 9620
 9621
 9622
 9623
 9624
 9625
 9626
 9627
 9628
 9629
 9630
 9631
 9632
 9633
 9634
 9635
 9636
 9637
 9638
 9639
 9640
 9641
 9642
 9643
 9644
 9645
 9646
 9647
 9648
 9649
 9650
 9651
 9652
 9653
 9654
 9655
 9656
 9657
 9658
 9659
 9660
 9661
 9662
 9663
 9664
 9665
 9666
 9667
 9668
 9669
 9670
 9671
 9672
 9673
 9674
 9675
 9676
 9677
 9678
 9679
 9680
 9681
 9682
 9683
 9684
 9685
 9686
 9687
 9688
 9689
 9690
 9691
 9692
 9693
 9694
 9695
 9696
 9697
 9698
 9699
 9700
 9701
 9702
 9703
 9704
 9705
 9706
 9707
 9708
 9709
 9710
 9711
 9712
 9713
 9714
 9715
 9716
 9717
 9718
 9719
 9720
 9721
 9722
 9723
 9724
 9725
 9726
 9727
 9728
 9729
 9730
 9731
 9732
 9733
 9734
 9735
 9736
 9737
 9738
 9739
 9740
 9741
 9742
 9743
 9744
 9745
 9746
 9747
 9748
 9749
 9750
 9751
 9752
 9753
 9754
 9755
 9756
 9757
 9758
 9759
 9760
 9761
 9762
 9763
 9764
 9765
 9766
 9767
 9768
 9769
 9770
 9771
 9772
 9773
 9774
 9775
 9776
 9777
 9778
 9779
 9780
 9781
 9782
 9783
 9784
 9785
 9786
 9787
 9788
 9789
 9790
 9791
 9792
 9793
 9794
 9795
 9796
 9797
 9798
 9799
 9800
 9801
 9802
 9803
 9804
 9805
 9806
 9807
 9808
 9809
 9810
 9811
 9812
 9813
 9814
 9815
 9816
 9817
 9818
 9819
 9820
 9821
 9822
 9823
 9824
 9825
 9826
 9827
 9828
 9829
 9830
 9831
 9832
 9833
 9834
 9835
 9836
 9837
 9838
 9839
 9840
 9841
 9842
 9843
 9844
 9845
 9846
 9847
 9848
 9849
 9850
 9851
 9852
 9853
 9854
 9855
 9856
 9857
 9858
 9859
 9860
 9861
 9862
 9863
 9864
 9865
 9866
 9867
 9868
 9869
 9870
 9871
 9872
 9873
 9874
 9875
 9876
 9877
 9878
 9879
 9880
 9881
 9882
 9883
 9884
 9885
 9886
 9887
 9888
 9889
 9890
 9891
 9892
 9893
 9894
 9895
 9896
 9897
 9898
 9899
 9900
 9901
 9902
 9903
 9904
 9905
 9906
 9907
 9908
 9909
 9910
 9911
 9912
 9913
 9914
 9915
 9916
 9917
 9918
 9919
 9920
 9921
 9922
 9923
 9924
 9925
 9926
 9927
 9928
 9929
 9930
 9931
 9932
 9933
 9934
 9935
 9936
 9937
 9938
 9939
 9940
 9941
 9942
 9943
 9944
 9945
 9946
 9947
 9948
 9949
 9950
 9951
 9952
 9953
 9954
 9955
 9956
 9957
 9958
 9959
 9960
 9961
 9962
 9963
 9964
 9965
 9966
 9967
 9968
 9969
 9970
 9971
 9972
 9973
 9974
 9975
 9976
 9977
 9978
 9979
 9980
 9981
 9982
 9983
 9984
 9985
 9986
 9987
 9988
 9989
 9990
 9991
 9992
 9993
 9994
 9995
 9996
 9997
 9998
 9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
diff --git a/README.md b/README.md
index 364e3ca..5507239 100644
--- a/README.md
+++ b/README.md
@@ -1,201 +1,67 @@
-# dwl - dwm for Wayland
+# DWL
+dynamic window manager for wayland (dwm for wayland).
+
+> **patches**:
+- alwayscenter
+- bar
+- bar-notitle
+- bar-recolr
+- customfloat
+- gaps
+- hide-behind-fullscreen
+- hide-behind-monocle
+- hide-cursor-when-typing
+- pertag
+- restore-monitor
+- smartborders
+- swallow
+- tablet-input
+- warpcursor
+[repo](https://codebergo.org/dwl)
+
+# Neovim
+options.lua, globals.lua, commands.lua, binds.lua, are just data files.
+Neovim runs init.lua, which loads tables from other files; each table is looped and applied to vim.opt, vim.g, vim.cmd, keymaps, plugins, and LSP setup in order.
+Everything is processed by simple for loops calling Neovim APIs.
+
+Plugins setup and LSP are separated modules that run after core config is loaded.
+
+> **Plugins**:
+- [Comment.nvim](https://github.com/numToStr/Comment.nvim)
+- [cmp-nvim-lsp](https://github.com/hrsh7th/cmp-nvim-lsp)
+- [cmp-path](https://github.com/hrsh7th/cmp-path)
+- [cord.nvim](https://github.com/vyfor/cord.nvim)
+- [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim)
+- [neo-img](https://github.com/Skardyy/neo-img)
+- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
+- [nvim-colorizer.lua](https://github.com/Pixel2175/nvim-colorizer.lua)
+- [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
+- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
+- [toggleterm.nvim](https://github.com/akinsho/toggleterm.nvim)
+- [vim-closetag](https://github.com/alvan/vim-closetag)
+- [vim-tpipeline](https://github.com/vimpostor/vim-tpipeline)
+
+# Sta
+A simple monitoring app inspired by slstatus.
+It adds a new feature: it can send an update signal instead of waiting for the delay countdown.
+[repo](https://codeberg.org/pi66/sta)
+
+# Colorscheme
+I created a custom system-wide colorscheme and apply it to the whole system using a tool called [Walrs](https://codeberg.org/pi66/walrs).
+It is used across the window manager, terminal, neovim, and even Krita to keep a consistent look.
+
+## Palette
+check `colorscheme` file 
+
+# Preview
+<table>
+  <tr>
+    <td><img src="./screenshots/dwl-00.png" width="100%"></td>
+    <td><img src="./screenshots/dwl-01.png" width="100%"></td>
+  </tr>
+  <tr>
+    <td><img src="./screenshots/nvim-00.png" width="100%"></td>
+    <td><img src="./screenshots/nvim-01.png" width="100%"></td>
+  </tr>
+</table>

-Join us on our IRC channel: [#dwl on Libera Chat]  
-Or on the community-maintained [Discord server].
-
-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`
-- Tied to as few external dependencies as possible
-
-## Getting Started:
-
-### Latest semi-stable [release]
-This is probably where you want to start. This builds against the [wlroots]
-versions currently shipping in major distributions. If your
-distribution's `wlroots` version is older, use an earlier dwl [release].
-The `wlroots` version against which a given `dwl` release builds is specified
-with each release on the [release] page
-
-### 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.
-  
-### 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)
-
-dwl has the following additional dependencies if XWayland support is enabled:
-- libxcb
-- libxcb-wm
-- wlroots (compiled with X11 support)
-- Xwayland (runtime only)
-
-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].
-
-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.
-
-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. 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. Do note that the default background color is grey. 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], [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.:
-
-    export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u)
-    mkdir -p $XDG_RUNTIME_DIR
-    dwl
-
-### Status information
-
-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 `STATUS INFORMATION` section in `_dwl_(1)`).  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
-
-    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 useful resources on our wiki].
-
-## Background
-
-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.
-
-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
-- Stivvo for output management and fullscreen support, and patch maintenance
-
-
-[wlroots]: https://gitlab.freedesktop.org/wlroots
-[`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/
diff --git a/colorscheme b/colorscheme
new file mode 100644
index 0000000..99ddb9c
--- /dev/null
+++ b/colorscheme
@@ -0,0 +1,16 @@
+#000000
+#8f404b
+#4a6a50
+#7a5830
+#3d5a72
+#943f52
+#4e7070
+#b89090
+#1a0a10
+#c05060
+#6a9870
+#b07840
+#5a80a0
+#e76485
+#70a0a0
+#e7d0cd
diff --git a/config.def.h b/config.def.h
deleted file mode 100644
index 05a1164..0000000
--- a/config.def.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/* 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  */
-// Replace colors_dir with your own path, e.g /home/yourname/.cache/dwl-colors
-static const char *colors_dir               = "/home/pixel/.cache/wal/colors-dwl"; 
-static const int smartgaps                 = 0;  /* 1 means no outer gap when there is only one window */
-static int gaps                            = 1;  /* 1 means gaps between windows are added */
-static const unsigned int gappx            = 10; /* gap pixel between windows */
-static const unsigned int borderpx         = 3;  /* border pixel of windows */
-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 char *fonts[] = {"CaskaydiaMonoNerdFont-Bold:size=8:style:Bold"};
-
-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.0f, 0.0f, 0.0f, 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[] = { "","","","","","",""};
-
-/* logging */
-static int log_level = WLR_ERROR;
-
-/* window resizing */
-/* resize_corner:
- * 0: top-left
- * 1: top-right
- * 2: bottom-left
- * 3: bottom-right
- * 4: closest to the cursor
- */
-static const int resize_corner = 4;
-static const int warp_cursor = 1;  /* 1: warp to corner, 0: don’t warp */
-static const int lock_cursor = 0;  /* 1: lock cursor, 0: don't lock */
-
-/* Autostart */
-static const char *const autostart[] = {
-         // "/home/pixel/.config/startup/start.sh",
-         "pipewire-pulse",NULL,
-         "pipewire",NULL,
-         "wireplumber",NULL,
-         "walrs","-r",
-         "swhks",NULL,
-         "swhkd",NULL,
-         NULL
-};
-
-
-/* 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_EXAMPLE",     NULL,       0,            1,           -1 }, /* Start on currently visible tags floating, not tiled */
-   { "firefox_EXAMPLE",  NULL,       1 << 8,       0,           -1 }, /* Start on ONLY tag "9" */
-};
-
-/* layout(s) */
-static const Layout layouts[] = {
-    /* symbol     arrange function */
-    {"", tile},  /* first entry is default */
-    {"󰭩", NULL}, /* no layout function means floating behavior */
-    {"", monocle},
-};
-
-
-/* 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                x    y */
-   /* example of a HiDPI laptop monitor:
-   { "eDP-1",    0.5f,  1,      2,    &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL,   -1,  -1 },
-   */
-   /* defaults */
-   { NULL,       0.55f, 1,      1,    &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL,   -1,  -1 },
-};
-
-/* keyboard */
-static const struct xkb_rule_names xkb_rules = {
-   /* can specify fields: rules, model, layout, variant, options */
-   /* example:
-   .options = "ctrl:nocaps",
-   */
-   .options = NULL,
-};
-
-static const int repeat_rate = 25;
-static const int repeat_delay = 600;
-
-/* Trackpad */
-static const int tap_to_click = 1;
-static const int tap_and_drag = 1;
-static const int drag_lock = 1;
-static const int natural_scrolling = 0;
-static const int disable_while_typing = 1;
-static const int left_handed = 0;
-static const int middle_button_emulation = 0;
-/* You can choose between:
-LIBINPUT_CONFIG_SCROLL_NO_SCROLL
-LIBINPUT_CONFIG_SCROLL_2FG
-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
-*/
-static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
-static const double accel_speed = 0.0;
-
-/* 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_ALT
-#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} }, \
-   { MODKEY|WLR_MODIFIER_SHIFT, SKEY,           tag,             {.ui = 1 << TAG} }, \
-   { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }
-
-/* helper for spawning shell commands in the pre dwm-5.0 fashion */
-#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
-
-/* commands */
-static const char *termcmd[] = { "foot", 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_n,          reload_colors,  {0} },
-   { 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.05f} },
-   { MODKEY,                    XKB_KEY_l,          setmfact,       {.f = +0.05f} },
-   { MODKEY,                    XKB_KEY_Return,     zoom,           {0} },
-   { MODKEY,                    XKB_KEY_Tab,        view,           {0} },
-   { MODKEY,                    XKB_KEY_g,          togglegaps,     {0} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C,          killclient,     {0} },
-   { MODKEY,                    XKB_KEY_t,          setlayout,      {.v = &layouts[0]} },
-   { MODKEY,                    XKB_KEY_f,          setlayout,      {.v = &layouts[1]} },
-   { MODKEY,                    XKB_KEY_m,          setlayout,      {.v = &layouts[2]} },
-   { MODKEY,                    XKB_KEY_space,      setlayout,      {0} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space,      togglefloating, {0} },
-   { MODKEY,                    XKB_KEY_e,         togglefullscreen, {0} },
-   { MODKEY,                    XKB_KEY_0,          view,           {.ui = ~0} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag,            {.ui = ~0} },
-   { MODKEY,                    XKB_KEY_comma,      focusmon,       {.i = WLR_DIRECTION_LEFT} },
-   { MODKEY,                    XKB_KEY_period,     focusmon,       {.i = WLR_DIRECTION_RIGHT} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less,       tagmon,         {.i = WLR_DIRECTION_LEFT} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater,    tagmon,         {.i = WLR_DIRECTION_RIGHT} },
-   TAGKEYS(          XKB_KEY_1, XKB_KEY_exclam,                     0),
-   TAGKEYS(          XKB_KEY_2, XKB_KEY_at,                         1),
-   TAGKEYS(          XKB_KEY_3, XKB_KEY_numbersign,                 2),
-   TAGKEYS(          XKB_KEY_4, XKB_KEY_dollar,                     3),
-   TAGKEYS(          XKB_KEY_5, XKB_KEY_percent,                    4),
-   TAGKEYS(          XKB_KEY_6, XKB_KEY_asciicircum,                5),
-   TAGKEYS(          XKB_KEY_7, XKB_KEY_ampersand,                  6),
-   TAGKEYS(          XKB_KEY_8, XKB_KEY_asterisk,                   7),
-   TAGKEYS(          XKB_KEY_9, XKB_KEY_parenleft,                  8),
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q,          quit,           {0} },
-
-   /* 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[] = {
-   { 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} },
-};
diff --git a/config.def.h.orig b/config.def.h.orig
deleted file mode 100644
index de6f96a..0000000
--- a/config.def.h.orig
+++ /dev/null
@@ -1,215 +0,0 @@
-/* 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  */
-// Replace colors_dir with your own path, e.g /home/yourname/.cache/dwl-colors
-static const char *colors_dir               = "/home/pixel/.cache/wal/colors-dwl"; 
-static const int smartgaps                 = 0;  /* 1 means no outer gap when there is only one window */
-static int gaps                            = 1;  /* 1 means gaps between windows are added */
-static const unsigned int gappx            = 10; /* gap pixel between windows */
-static const unsigned int borderpx         = 3;  /* border pixel of windows */
-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 char *fonts[] = {"CaskaydiaMonoNerdFont-Bold:size=8:style:Bold"};
-
-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.0f, 0.0f, 0.0f, 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[] = { "","","","","","",""};
-
-/* logging */
-static int log_level = WLR_ERROR;
-
-/* window resizing */
-/* resize_corner:
- * 0: top-left
- * 1: top-right
- * 2: bottom-left
- * 3: bottom-right
- * 4: closest to the cursor
- */
-static const int resize_corner = 4;
-static const int warp_cursor = 1;  /* 1: warp to corner, 0: don’t warp */
-static const int lock_cursor = 0;  /* 1: lock cursor, 0: don't lock */
-
-/* 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_EXAMPLE",     NULL,       0,            1,           -1 }, /* Start on currently visible tags floating, not tiled */
-   { "firefox_EXAMPLE",  NULL,       1 << 8,       0,           -1 }, /* Start on ONLY tag "9" */
-};
-
-/* layout(s) */
-static const Layout layouts[] = {
-    /* symbol     arrange function */
-    {"", tile},  /* first entry is default */
-    {"󰭩", NULL}, /* no layout function means floating behavior */
-    {"", monocle},
-};
-
-
-/* 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                x    y */
-   /* example of a HiDPI laptop monitor:
-   { "eDP-1",    0.5f,  1,      2,    &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL,   -1,  -1 },
-   */
-   /* defaults */
-   { NULL,       0.55f, 1,      1,    &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL,   -1,  -1 },
-};
-
-/* keyboard */
-static const struct xkb_rule_names xkb_rules = {
-   /* can specify fields: rules, model, layout, variant, options */
-   /* example:
-   .options = "ctrl:nocaps",
-   */
-   .options = NULL,
-};
-
-static const int repeat_rate = 25;
-static const int repeat_delay = 600;
-
-/* Trackpad */
-static const int tap_to_click = 1;
-static const int tap_and_drag = 1;
-static const int drag_lock = 1;
-static const int natural_scrolling = 0;
-static const int disable_while_typing = 1;
-static const int left_handed = 0;
-static const int middle_button_emulation = 0;
-/* You can choose between:
-LIBINPUT_CONFIG_SCROLL_NO_SCROLL
-LIBINPUT_CONFIG_SCROLL_2FG
-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
-*/
-static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
-static const double accel_speed = 0.0;
-
-/* 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_ALT
-#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} }, \
-   { MODKEY|WLR_MODIFIER_SHIFT, SKEY,           tag,             {.ui = 1 << TAG} }, \
-   { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }
-
-/* helper for spawning shell commands in the pre dwm-5.0 fashion */
-#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
-
-/* commands */
-static const char *termcmd[] = { "foot", 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_n,          reload_colors,  {0} },
-   { 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.05f} },
-   { MODKEY,                    XKB_KEY_l,          setmfact,       {.f = +0.05f} },
-   { MODKEY,                    XKB_KEY_Return,     zoom,           {0} },
-   { MODKEY,                    XKB_KEY_Tab,        view,           {0} },
-   { MODKEY,                    XKB_KEY_g,          togglegaps,     {0} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C,          killclient,     {0} },
-   { MODKEY,                    XKB_KEY_t,          setlayout,      {.v = &layouts[0]} },
-   { MODKEY,                    XKB_KEY_f,          setlayout,      {.v = &layouts[1]} },
-   { MODKEY,                    XKB_KEY_m,          setlayout,      {.v = &layouts[2]} },
-   { MODKEY,                    XKB_KEY_space,      setlayout,      {0} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space,      togglefloating, {0} },
-   { MODKEY,                    XKB_KEY_e,         togglefullscreen, {0} },
-   { MODKEY,                    XKB_KEY_0,          view,           {.ui = ~0} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag,            {.ui = ~0} },
-   { MODKEY,                    XKB_KEY_comma,      focusmon,       {.i = WLR_DIRECTION_LEFT} },
-   { MODKEY,                    XKB_KEY_period,     focusmon,       {.i = WLR_DIRECTION_RIGHT} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less,       tagmon,         {.i = WLR_DIRECTION_LEFT} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater,    tagmon,         {.i = WLR_DIRECTION_RIGHT} },
-   TAGKEYS(          XKB_KEY_1, XKB_KEY_exclam,                     0),
-   TAGKEYS(          XKB_KEY_2, XKB_KEY_at,                         1),
-   TAGKEYS(          XKB_KEY_3, XKB_KEY_numbersign,                 2),
-   TAGKEYS(          XKB_KEY_4, XKB_KEY_dollar,                     3),
-   TAGKEYS(          XKB_KEY_5, XKB_KEY_percent,                    4),
-   TAGKEYS(          XKB_KEY_6, XKB_KEY_asciicircum,                5),
-   TAGKEYS(          XKB_KEY_7, XKB_KEY_ampersand,                  6),
-   TAGKEYS(          XKB_KEY_8, XKB_KEY_asterisk,                   7),
-   TAGKEYS(          XKB_KEY_9, XKB_KEY_parenleft,                  8),
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q,          quit,           {0} },
-
-   /* 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[] = {
-   { 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} },
-};
diff --git a/config.def.h.rej b/config.def.h.rej
deleted file mode 100644
index e271196..0000000
--- a/config.def.h.rej
+++ /dev/null
@@ -1,12 +0,0 @@
---- config.def.h
-+++ config.def.h
-@@ -6,6 +6,9 @@
- /* 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 int smartgaps                 = 0;  /* 1 means no outer gap when there is only one window */
-+static int gaps                            = 1;  /* 1 means gaps between windows are added */
-+static const unsigned int gappx            = 10; /* gap pixel between windows */
- static const unsigned int borderpx         = 1;  /* border pixel of windows */
- static const float rootcolor[]             = COLOR(0x222222ff);
- static const float bordercolor[]           = COLOR(0x444444ff);
diff --git a/config.h b/config.h
deleted file mode 100644
index 05a1164..0000000
--- a/config.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/* 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  */
-// Replace colors_dir with your own path, e.g /home/yourname/.cache/dwl-colors
-static const char *colors_dir               = "/home/pixel/.cache/wal/colors-dwl"; 
-static const int smartgaps                 = 0;  /* 1 means no outer gap when there is only one window */
-static int gaps                            = 1;  /* 1 means gaps between windows are added */
-static const unsigned int gappx            = 10; /* gap pixel between windows */
-static const unsigned int borderpx         = 3;  /* border pixel of windows */
-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 char *fonts[] = {"CaskaydiaMonoNerdFont-Bold:size=8:style:Bold"};
-
-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.0f, 0.0f, 0.0f, 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[] = { "","","","","","",""};
-
-/* logging */
-static int log_level = WLR_ERROR;
-
-/* window resizing */
-/* resize_corner:
- * 0: top-left
- * 1: top-right
- * 2: bottom-left
- * 3: bottom-right
- * 4: closest to the cursor
- */
-static const int resize_corner = 4;
-static const int warp_cursor = 1;  /* 1: warp to corner, 0: don’t warp */
-static const int lock_cursor = 0;  /* 1: lock cursor, 0: don't lock */
-
-/* Autostart */
-static const char *const autostart[] = {
-         // "/home/pixel/.config/startup/start.sh",
-         "pipewire-pulse",NULL,
-         "pipewire",NULL,
-         "wireplumber",NULL,
-         "walrs","-r",
-         "swhks",NULL,
-         "swhkd",NULL,
-         NULL
-};
-
-
-/* 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_EXAMPLE",     NULL,       0,            1,           -1 }, /* Start on currently visible tags floating, not tiled */
-   { "firefox_EXAMPLE",  NULL,       1 << 8,       0,           -1 }, /* Start on ONLY tag "9" */
-};
-
-/* layout(s) */
-static const Layout layouts[] = {
-    /* symbol     arrange function */
-    {"", tile},  /* first entry is default */
-    {"󰭩", NULL}, /* no layout function means floating behavior */
-    {"", monocle},
-};
-
-
-/* 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                x    y */
-   /* example of a HiDPI laptop monitor:
-   { "eDP-1",    0.5f,  1,      2,    &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL,   -1,  -1 },
-   */
-   /* defaults */
-   { NULL,       0.55f, 1,      1,    &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL,   -1,  -1 },
-};
-
-/* keyboard */
-static const struct xkb_rule_names xkb_rules = {
-   /* can specify fields: rules, model, layout, variant, options */
-   /* example:
-   .options = "ctrl:nocaps",
-   */
-   .options = NULL,
-};
-
-static const int repeat_rate = 25;
-static const int repeat_delay = 600;
-
-/* Trackpad */
-static const int tap_to_click = 1;
-static const int tap_and_drag = 1;
-static const int drag_lock = 1;
-static const int natural_scrolling = 0;
-static const int disable_while_typing = 1;
-static const int left_handed = 0;
-static const int middle_button_emulation = 0;
-/* You can choose between:
-LIBINPUT_CONFIG_SCROLL_NO_SCROLL
-LIBINPUT_CONFIG_SCROLL_2FG
-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
-*/
-static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
-static const double accel_speed = 0.0;
-
-/* 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_ALT
-#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} }, \
-   { MODKEY|WLR_MODIFIER_SHIFT, SKEY,           tag,             {.ui = 1 << TAG} }, \
-   { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }
-
-/* helper for spawning shell commands in the pre dwm-5.0 fashion */
-#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
-
-/* commands */
-static const char *termcmd[] = { "foot", 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_n,          reload_colors,  {0} },
-   { 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.05f} },
-   { MODKEY,                    XKB_KEY_l,          setmfact,       {.f = +0.05f} },
-   { MODKEY,                    XKB_KEY_Return,     zoom,           {0} },
-   { MODKEY,                    XKB_KEY_Tab,        view,           {0} },
-   { MODKEY,                    XKB_KEY_g,          togglegaps,     {0} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C,          killclient,     {0} },
-   { MODKEY,                    XKB_KEY_t,          setlayout,      {.v = &layouts[0]} },
-   { MODKEY,                    XKB_KEY_f,          setlayout,      {.v = &layouts[1]} },
-   { MODKEY,                    XKB_KEY_m,          setlayout,      {.v = &layouts[2]} },
-   { MODKEY,                    XKB_KEY_space,      setlayout,      {0} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space,      togglefloating, {0} },
-   { MODKEY,                    XKB_KEY_e,         togglefullscreen, {0} },
-   { MODKEY,                    XKB_KEY_0,          view,           {.ui = ~0} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag,            {.ui = ~0} },
-   { MODKEY,                    XKB_KEY_comma,      focusmon,       {.i = WLR_DIRECTION_LEFT} },
-   { MODKEY,                    XKB_KEY_period,     focusmon,       {.i = WLR_DIRECTION_RIGHT} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less,       tagmon,         {.i = WLR_DIRECTION_LEFT} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater,    tagmon,         {.i = WLR_DIRECTION_RIGHT} },
-   TAGKEYS(          XKB_KEY_1, XKB_KEY_exclam,                     0),
-   TAGKEYS(          XKB_KEY_2, XKB_KEY_at,                         1),
-   TAGKEYS(          XKB_KEY_3, XKB_KEY_numbersign,                 2),
-   TAGKEYS(          XKB_KEY_4, XKB_KEY_dollar,                     3),
-   TAGKEYS(          XKB_KEY_5, XKB_KEY_percent,                    4),
-   TAGKEYS(          XKB_KEY_6, XKB_KEY_asciicircum,                5),
-   TAGKEYS(          XKB_KEY_7, XKB_KEY_ampersand,                  6),
-   TAGKEYS(          XKB_KEY_8, XKB_KEY_asterisk,                   7),
-   TAGKEYS(          XKB_KEY_9, XKB_KEY_parenleft,                  8),
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q,          quit,           {0} },
-
-   /* 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[] = {
-   { 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} },
-};
diff --git a/dwl.c.orig b/dwl.c.orig
deleted file mode 100644
index 0d1d13b..0000000
--- a/dwl.c.orig
+++ /dev/null
@@ -1,3585 +0,0 @@
-/*
- * See LICENSE file for copyright and license details.
- */
-#include <getopt.h>
-#include <libinput.h>
-#include <linux/input-event-codes.h>
-#include <math.h>
-#include <libdrm/drm_fourcc.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/wait.h>
-#include <time.h>
-#include <unistd.h>
-#include <wayland-server-core.h>
-#include <wlr/backend.h>
-#include <wlr/backend/libinput.h>
-#include <wlr/render/allocator.h>
-#include <wlr/render/wlr_renderer.h>
-#include <wlr/types/wlr_alpha_modifier_v1.h>
-#include <wlr/types/wlr_compositor.h>
-#include <wlr/types/wlr_cursor.h>
-#include <wlr/types/wlr_cursor_shape_v1.h>
-#include <wlr/types/wlr_data_control_v1.h>
-#include <wlr/types/wlr_data_device.h>
-#include <wlr/types/wlr_drm.h>
-#include <wlr/types/wlr_export_dmabuf_v1.h>
-#include <wlr/types/wlr_fractional_scale_v1.h>
-#include <wlr/types/wlr_gamma_control_v1.h>
-#include <wlr/types/wlr_idle_inhibit_v1.h>
-#include <wlr/types/wlr_idle_notify_v1.h>
-#include <wlr/types/wlr_input_device.h>
-#include <wlr/types/wlr_keyboard.h>
-#include <wlr/types/wlr_keyboard_group.h>
-#include <wlr/types/wlr_layer_shell_v1.h>
-#include <wlr/types/wlr_linux_dmabuf_v1.h>
-#include <wlr/types/wlr_linux_drm_syncobj_v1.h>
-#include <wlr/types/wlr_output.h>
-#include <wlr/types/wlr_output_layout.h>
-#include <wlr/types/wlr_output_management_v1.h>
-#include <wlr/types/wlr_output_power_management_v1.h>
-#include <wlr/types/wlr_pointer.h>
-#include <wlr/types/wlr_pointer_constraints_v1.h>
-#include <wlr/types/wlr_presentation_time.h>
-#include <wlr/types/wlr_primary_selection.h>
-#include <wlr/types/wlr_primary_selection_v1.h>
-#include <wlr/types/wlr_relative_pointer_v1.h>
-#include <wlr/types/wlr_scene.h>
-#include <wlr/types/wlr_screencopy_v1.h>
-#include <wlr/types/wlr_seat.h>
-#include <wlr/types/wlr_server_decoration.h>
-#include <wlr/types/wlr_session_lock_v1.h>
-#include <wlr/types/wlr_single_pixel_buffer_v1.h>
-#include <wlr/types/wlr_subcompositor.h>
-#include <wlr/types/wlr_viewporter.h>
-#include <wlr/types/wlr_virtual_keyboard_v1.h>
-#include <wlr/types/wlr_virtual_pointer_v1.h>
-#include <wlr/types/wlr_xcursor_manager.h>
-#include <wlr/types/wlr_xdg_activation_v1.h>
-#include <wlr/types/wlr_xdg_decoration_v1.h>
-#include <wlr/types/wlr_xdg_output_v1.h>
-#include <wlr/types/wlr_xdg_shell.h>
-#include <wlr/interfaces/wlr_buffer.h>
-#include <wlr/util/log.h>
-#include <wlr/util/region.h>
-#include <xkbcommon/xkbcommon.h>
-#ifdef XWAYLAND
-#include <wlr/xwayland.h>
-#include <xcb/xcb.h>
-#include <xcb/xcb_icccm.h>
-#endif
-
-#include "util.h"
-#include "drwl.h"
-
-/* macros */
-#define MAX(A, B)               ((A) > (B) ? (A) : (B))
-#define MIN(A, B)               ((A) < (B) ? (A) : (B))
-#define CLEANMASK(mask)         (mask & ~WLR_MODIFIER_CAPS)
-#define VISIBLEON(C, M)         ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
-#define LENGTH(X)               (sizeof X / sizeof X[0])
-#define END(A)                  ((A) + LENGTH(A))
-#define TAGMASK                 ((1u << LENGTH(tags)) - 1)
-#define LISTEN(E, L, H)         wl_signal_add((E), ((L)->notify = (H), (L)))
-#define LISTEN_STATIC(E, H)     do { struct wl_listener *_l = ecalloc(1, sizeof(*_l)); _l->notify = (H); wl_signal_add((E), _l); } while (0)
-#define TEXTW(mon, text)        (drwl_font_getwidth(mon->drw, text) + mon->lrpad)
-
-/* enums */
-enum { SchemeNorm, SchemeSel, SchemeUrg }; /* color schemes */
-enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
-enum { XDGShell, LayerShell, X11 }; /* client types */
-enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock, NUM_LAYERS }; /* scene layers */
-enum { ClkTagBar, ClkLtSymbol, ClkStatus, ClkTitle, ClkClient, ClkRoot }; /* clicks */
-
-typedef union {
-   int i;
-   uint32_t ui;
-   float f;
-   const void *v;
-} Arg;
-
-typedef struct {
-   unsigned int click;
-   unsigned int mod;
-   unsigned int button;
-   void (*func)(const Arg *);
-   const Arg arg;
-} Button;
-
-typedef struct Monitor Monitor;
-typedef struct {
-   /* Must keep this field first */
-   unsigned int type; /* XDGShell or X11* */
-
-   Monitor *mon;
-   struct wlr_scene_tree *scene;
-   struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
-   struct wlr_scene_tree *scene_surface;
-   struct wl_list link;
-   struct wl_list flink;
-   struct wlr_box geom; /* layout-relative, includes border */
-   struct wlr_box prev; /* layout-relative, includes border */
-   struct wlr_box bounds; /* only width and height are used */
-   union {
-       struct wlr_xdg_surface *xdg;
-       struct wlr_xwayland_surface *xwayland;
-   } surface;
-   struct wlr_xdg_toplevel_decoration_v1 *decoration;
-   struct wl_listener commit;
-   struct wl_listener map;
-   struct wl_listener maximize;
-   struct wl_listener unmap;
-   struct wl_listener destroy;
-   struct wl_listener set_title;
-   struct wl_listener fullscreen;
-   struct wl_listener set_decoration_mode;
-   struct wl_listener destroy_decoration;
-#ifdef XWAYLAND
-   struct wl_listener activate;
-   struct wl_listener associate;
-   struct wl_listener dissociate;
-   struct wl_listener configure;
-   struct wl_listener set_hints;
-#endif
-   unsigned int bw;
-   uint32_t tags;
-   int isfloating, isurgent, isfullscreen;
-   uint32_t resize; /* configure serial of a pending resize */
-} Client;
-
-typedef struct {
-   uint32_t mod;
-   xkb_keysym_t keysym;
-   void (*func)(const Arg *);
-   const Arg arg;
-} Key;
-
-typedef struct {
-   struct wlr_keyboard_group *wlr_group;
-
-   int nsyms;
-   const xkb_keysym_t *keysyms; /* invalid if nsyms == 0 */
-   uint32_t mods; /* invalid if nsyms == 0 */
-   struct wl_event_source *key_repeat_source;
-
-   struct wl_listener modifiers;
-   struct wl_listener key;
-   struct wl_listener destroy;
-} KeyboardGroup;
-
-typedef struct {
-   /* Must keep this field first */
-   unsigned int type; /* LayerShell */
-
-   Monitor *mon;
-   struct wlr_scene_tree *scene;
-   struct wlr_scene_tree *popups;
-   struct wlr_scene_layer_surface_v1 *scene_layer;
-   struct wl_list link;
-   int mapped;
-   struct wlr_layer_surface_v1 *layer_surface;
-
-   struct wl_listener destroy;
-   struct wl_listener unmap;
-   struct wl_listener surface_commit;
-} LayerSurface;
-
-typedef struct {
-   const char *symbol;
-   void (*arrange)(Monitor *);
-} Layout;
-
-typedef struct {
-   struct wlr_buffer base;
-   struct wl_listener release;
-   bool busy;
-   Img *image;
-   uint32_t data[];
-} Buffer;
-
-struct Monitor {
-   struct wl_list link;
-   struct wlr_output *wlr_output;
-   struct wlr_scene_output *scene_output;
-   struct wlr_scene_buffer *scene_buffer; /* bar buffer */
-   struct wlr_scene_rect *fullscreen_bg; /* See createmon() for info */
-   struct wl_listener frame;
-   struct wl_listener destroy;
-   struct wl_listener request_state;
-   struct wl_listener destroy_lock_surface;
-   struct wlr_session_lock_surface_v1 *lock_surface;
-   struct wlr_box m; /* monitor area, layout-relative */
-   struct {
-       int width, height;
-       int real_width, real_height; /* non-scaled */
-       float scale;
-   } b; /* bar area */
-   struct wlr_box w; /* window area, layout-relative */
-   struct wl_list layers[4]; /* LayerSurface.link */
-   const Layout *lt[2];
-   int gaps;
-   unsigned int seltags;
-   unsigned int sellt;
-   uint32_t tagset[2];
-   float mfact;
-   int gamma_lut_changed;
-   int nmaster;
-   char ltsymbol[16];
-   int asleep;
-   Drwl *drw;
-   Buffer *pool[2];
-   int lrpad;
-};
-
-typedef struct {
-   const char *name;
-   float mfact;
-   int nmaster;
-   float scale;
-   const Layout *lt;
-   enum wl_output_transform rr;
-   int x, y;
-} MonitorRule;
-
-typedef struct {
-   struct wlr_pointer_constraint_v1 *constraint;
-   struct wl_listener destroy;
-} PointerConstraint;
-
-typedef struct {
-   const char *id;
-   const char *title;
-   uint32_t tags;
-   int isfloating;
-   int monitor;
-} Rule;
-
-typedef struct {
-   struct wlr_scene_tree *scene;
-
-   struct wlr_session_lock_v1 *lock;
-   struct wl_listener new_surface;
-   struct wl_listener unlock;
-   struct wl_listener destroy;
-} SessionLock;
-
-/* function declarations */
-static void applybounds(Client *c, struct wlr_box *bbox);
-static void applyrules(Client *c);
-static void arrange(Monitor *m);
-static void arrangelayer(Monitor *m, struct wl_list *list,
-       struct wlr_box *usable_area, int exclusive);
-static void arrangelayers(Monitor *m);
-static void axisnotify(struct wl_listener *listener, void *data);
-static bool baracceptsinput(struct wlr_scene_buffer *buffer, double *sx, double *sy);
-static void bufdestroy(struct wlr_buffer *buffer);
-static bool bufdatabegin(struct wlr_buffer *buffer, uint32_t flags,
-       void **data, uint32_t *format, size_t *stride);
-static void bufdataend(struct wlr_buffer *buffer);
-static Buffer *bufmon(Monitor *m);
-static void bufrelease(struct wl_listener *listener, void *data);
-static void buttonpress(struct wl_listener *listener, void *data);
-static void chvt(const Arg *arg);
-static void checkidleinhibitor(struct wlr_surface *exclude);
-static void cleanup(void);
-static void cleanupmon(struct wl_listener *listener, void *data);
-static void cleanuplisteners(void);
-static void closemon(Monitor *m);
-static void commitlayersurfacenotify(struct wl_listener *listener, void *data);
-static void commitnotify(struct wl_listener *listener, void *data);
-static void commitpopup(struct wl_listener *listener, void *data);
-static void createdecoration(struct wl_listener *listener, void *data);
-static void createidleinhibitor(struct wl_listener *listener, void *data);
-static void createkeyboard(struct wlr_keyboard *keyboard);
-static KeyboardGroup *createkeyboardgroup(void);
-static void createlayersurface(struct wl_listener *listener, void *data);
-static void createlocksurface(struct wl_listener *listener, void *data);
-static void createmon(struct wl_listener *listener, void *data);
-static void createnotify(struct wl_listener *listener, void *data);
-static void createpointer(struct wlr_pointer *pointer);
-static void createpointerconstraint(struct wl_listener *listener, void *data);
-static void createpopup(struct wl_listener *listener, void *data);
-static void cursorconstrain(struct wlr_pointer_constraint_v1 *constraint);
-static void cursorframe(struct wl_listener *listener, void *data);
-static void cursorwarptohint(void);
-static void destroydecoration(struct wl_listener *listener, void *data);
-static void destroydragicon(struct wl_listener *listener, void *data);
-static void destroyidleinhibitor(struct wl_listener *listener, void *data);
-static void destroylayersurfacenotify(struct wl_listener *listener, void *data);
-static void destroylock(SessionLock *lock, int unlocked);
-static void destroylocksurface(struct wl_listener *listener, void *data);
-static void destroynotify(struct wl_listener *listener, void *data);
-static void destroypointerconstraint(struct wl_listener *listener, void *data);
-static void destroysessionlock(struct wl_listener *listener, void *data);
-static void destroykeyboardgroup(struct wl_listener *listener, void *data);
-static Monitor *dirtomon(enum wlr_direction dir);
-static void drawbar(Monitor *m);
-static void drawbars(void);
-static void focusclient(Client *c, int lift);
-static void focusmon(const Arg *arg);
-static void focusstack(const Arg *arg);
-static Client *focustop(Monitor *m);
-static void fullscreennotify(struct wl_listener *listener, void *data);
-static void gpureset(struct wl_listener *listener, void *data);
-static void handlesig(int signo);
-static void incnmaster(const Arg *arg);
-static void inputdevice(struct wl_listener *listener, void *data);
-static int keybinding(uint32_t mods, xkb_keysym_t sym);
-static void keypress(struct wl_listener *listener, void *data);
-static void keypressmod(struct wl_listener *listener, void *data);
-static int keyrepeat(void *data);
-static void killclient(const Arg *arg);
-static void locksession(struct wl_listener *listener, void *data);
-static void mapnotify(struct wl_listener *listener, void *data);
-static void maximizenotify(struct wl_listener *listener, void *data);
-static void monocle(Monitor *m);
-static void motionabsolute(struct wl_listener *listener, void *data);
-static void motionnotify(uint32_t time, struct wlr_input_device *device, double sx,
-       double sy, double sx_unaccel, double sy_unaccel);
-static void motionrelative(struct wl_listener *listener, void *data);
-static void moveresize(const Arg *arg);
-static void outputmgrapply(struct wl_listener *listener, void *data);
-static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test);
-static void outputmgrtest(struct wl_listener *listener, void *data);
-static void pointerfocus(Client *c, struct wlr_surface *surface,
-       double sx, double sy, uint32_t time);
-static void powermgrsetmode(struct wl_listener *listener, void *data);
-static void quit(const Arg *arg);
-static void reload_colors(const Arg *arg);
-static void rendermon(struct wl_listener *listener, void *data);
-static void requestdecorationmode(struct wl_listener *listener, void *data);
-static void requeststartdrag(struct wl_listener *listener, void *data);
-static void requestmonstate(struct wl_listener *listener, void *data);
-static void resize(Client *c, struct wlr_box geo, int interact);
-static void run(char *startup_cmd);
-static void setcursor(struct wl_listener *listener, void *data);
-static void setcursorshape(struct wl_listener *listener, void *data);
-static void setfloating(Client *c, int floating);
-static void setfullscreen(Client *c, int fullscreen);
-static void setlayout(const Arg *arg);
-static void setmfact(const Arg *arg);
-static void setmon(Client *c, Monitor *m, uint32_t newtags);
-static void setpsel(struct wl_listener *listener, void *data);
-static void setsel(struct wl_listener *listener, void *data);
-static void setup(void);
-static void spawn(const Arg *arg);
-static void startdrag(struct wl_listener *listener, void *data);
-static int statusin(int fd, unsigned int mask, void *data);
-static void tag(const Arg *arg);
-static void tagmon(const Arg *arg);
-static void tile(Monitor *m);
-static void togglebar(const Arg *arg);
-static void togglefloating(const Arg *arg);
-static void togglefullscreen(const Arg *arg);
-static void togglegaps(const Arg *arg);
-static void toggletag(const Arg *arg);
-static void toggleview(const Arg *arg);
-static void unlocksession(struct wl_listener *listener, void *data);
-static void unmaplayersurfacenotify(struct wl_listener *listener, void *data);
-static void unmapnotify(struct wl_listener *listener, void *data);
-static void updatemons(struct wl_listener *listener, void *data);
-static void updatebar(Monitor *m);
-static void updatetitle(struct wl_listener *listener, void *data);
-static void urgent(struct wl_listener *listener, void *data);
-static void view(const Arg *arg);
-static void virtualkeyboard(struct wl_listener *listener, void *data);
-static void virtualpointer(struct wl_listener *listener, void *data);
-static void warpcursor(const Client *c);
-static Monitor *xytomon(double x, double y);
-static void xytonode(double x, double y, struct wlr_surface **psurface,
-       Client **pc, LayerSurface **pl, double *nx, double *ny);
-static void zoom(const Arg *arg);
-
-/* variables */
-static pid_t child_pid = -1;
-static int locked;
-static void *exclusive_focus;
-static struct wl_display *dpy;
-static struct wl_event_loop *event_loop;
-static struct wlr_backend *backend;
-static struct wlr_scene *scene;
-static struct wlr_scene_tree *layers[NUM_LAYERS];
-static struct wlr_scene_tree *drag_icon;
-/* Map from ZWLR_LAYER_SHELL_* constants to Lyr* enum */
-static const int layermap[] = { LyrBg, LyrBottom, LyrTop, LyrOverlay };
-static struct wlr_renderer *drw;
-static struct wlr_allocator *alloc;
-static struct wlr_compositor *compositor;
-static struct wlr_session *session;
-
-static struct wlr_xdg_shell *xdg_shell;
-static struct wlr_xdg_activation_v1 *activation;
-static struct wlr_xdg_decoration_manager_v1 *xdg_decoration_mgr;
-static struct wl_list clients; /* tiling order */
-static struct wl_list fstack;  /* focus order */
-static struct wlr_idle_notifier_v1 *idle_notifier;
-static struct wlr_idle_inhibit_manager_v1 *idle_inhibit_mgr;
-static struct wlr_layer_shell_v1 *layer_shell;
-static struct wlr_output_manager_v1 *output_mgr;
-static struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard_mgr;
-static struct wlr_virtual_pointer_manager_v1 *virtual_pointer_mgr;
-static struct wlr_cursor_shape_manager_v1 *cursor_shape_mgr;
-static struct wlr_output_power_manager_v1 *power_mgr;
-
-static struct wlr_pointer_constraints_v1 *pointer_constraints;
-static struct wlr_relative_pointer_manager_v1 *relative_pointer_mgr;
-static struct wlr_pointer_constraint_v1 *active_constraint;
-
-static struct wlr_cursor *cursor;
-static struct wlr_xcursor_manager *cursor_mgr;
-
-static struct wlr_scene_rect *root_bg;
-static struct wlr_session_lock_manager_v1 *session_lock_mgr;
-static struct wlr_scene_rect *locked_bg;
-static struct wlr_session_lock_v1 *cur_lock;
-
-static struct wlr_seat *seat;
-static KeyboardGroup *kb_group;
-static unsigned int cursor_mode;
-static Client *grabc;
-static int grabcx, grabcy; /* client-relative */
-static int rzcorner;
-
-static struct wlr_output_layout *output_layout;
-static struct wlr_box sgeom;
-static struct wl_list mons;
-static Monitor *selmon;
-
-static char stext[256];
-static struct wl_event_source *status_event_source;
-
-static const struct wlr_buffer_impl buffer_impl = {
-    .destroy = bufdestroy,
-    .begin_data_ptr_access = bufdatabegin,
-    .end_data_ptr_access = bufdataend,
-};
-
-/* global event handlers */
-static struct wl_listener cursor_axis = {.notify = axisnotify};
-static struct wl_listener cursor_button = {.notify = buttonpress};
-static struct wl_listener cursor_frame = {.notify = cursorframe};
-static struct wl_listener cursor_motion = {.notify = motionrelative};
-static struct wl_listener cursor_motion_absolute = {.notify = motionabsolute};
-static struct wl_listener gpu_reset = {.notify = gpureset};
-static struct wl_listener layout_change = {.notify = updatemons};
-static struct wl_listener new_idle_inhibitor = {.notify = createidleinhibitor};
-static struct wl_listener new_input_device = {.notify = inputdevice};
-static struct wl_listener new_virtual_keyboard = {.notify = virtualkeyboard};
-static struct wl_listener new_virtual_pointer = {.notify = virtualpointer};
-static struct wl_listener new_pointer_constraint = {.notify = createpointerconstraint};
-static struct wl_listener new_output = {.notify = createmon};
-static struct wl_listener new_xdg_toplevel = {.notify = createnotify};
-static struct wl_listener new_xdg_popup = {.notify = createpopup};
-static struct wl_listener new_xdg_decoration = {.notify = createdecoration};
-static struct wl_listener new_layer_surface = {.notify = createlayersurface};
-static struct wl_listener output_mgr_apply = {.notify = outputmgrapply};
-static struct wl_listener output_mgr_test = {.notify = outputmgrtest};
-static struct wl_listener output_power_mgr_set_mode = {.notify = powermgrsetmode};
-static struct wl_listener request_activate = {.notify = urgent};
-static struct wl_listener request_cursor = {.notify = setcursor};
-static struct wl_listener request_set_psel = {.notify = setpsel};
-static struct wl_listener request_set_sel = {.notify = setsel};
-static struct wl_listener request_set_cursor_shape = {.notify = setcursorshape};
-static struct wl_listener request_start_drag = {.notify = requeststartdrag};
-static struct wl_listener start_drag = {.notify = startdrag};
-static struct wl_listener new_session_lock = {.notify = locksession};
-
-#ifdef XWAYLAND
-static void activatex11(struct wl_listener *listener, void *data);
-static void associatex11(struct wl_listener *listener, void *data);
-static void configurex11(struct wl_listener *listener, void *data);
-static void createnotifyx11(struct wl_listener *listener, void *data);
-static void dissociatex11(struct wl_listener *listener, void *data);
-static void sethints(struct wl_listener *listener, void *data);
-static void xwaylandready(struct wl_listener *listener, void *data);
-static struct wl_listener new_xwayland_surface = {.notify = createnotifyx11};
-static struct wl_listener xwayland_ready = {.notify = xwaylandready};
-static struct wlr_xwayland *xwayland;
-#endif
-
-/* configuration, allows nested code to access above variables */
-#include "config.h"
-
-/* attempt to encapsulate suck into one file */
-#include "client.h"
-
-/* function implementations */
-void
-applybounds(Client *c, struct wlr_box *bbox)
-{
-   /* set minimum possible */
-   c->geom.width = MAX(1 + 2 * (int)c->bw, c->geom.width);
-   c->geom.height = MAX(1 + 2 * (int)c->bw, c->geom.height);
-
-   if (c->geom.x >= bbox->x + bbox->width)
-       c->geom.x = bbox->x + bbox->width - c->geom.width;
-   if (c->geom.y >= bbox->y + bbox->height)
-       c->geom.y = bbox->y + bbox->height - c->geom.height;
-   if (c->geom.x + c->geom.width <= bbox->x)
-       c->geom.x = bbox->x;
-   if (c->geom.y + c->geom.height <= bbox->y)
-       c->geom.y = bbox->y;
-}
-
-void
-applyrules(Client *c)
-{
-   /* rule matching */
-   const char *appid, *title;
-   uint32_t newtags = 0;
-   int i;
-   const Rule *r;
-   Monitor *mon = selmon, *m;
-
-   appid = client_get_appid(c);
-   title = client_get_title(c);
-
-   for (r = rules; r < END(rules); r++) {
-       if ((!r->title || strstr(title, r->title))
-               && (!r->id || strstr(appid, r->id))) {
-           c->isfloating = r->isfloating;
-           newtags |= r->tags;
-           i = 0;
-           wl_list_for_each(m, &mons, link) {
-               if (r->monitor == i++)
-                   mon = m;
-           }
-       }
-   }
-
-   c->isfloating |= client_is_float_type(c);
-   setmon(c, mon, newtags);
-}
-
-void
-arrange(Monitor *m)
-{
-   Client *c;
-
-   if (!m->wlr_output->enabled)
-       return;
-
-   wl_list_for_each(c, &clients, link) {
-       if (c->mon == m) {
-           wlr_scene_node_set_enabled(&c->scene->node, VISIBLEON(c, m));
-           client_set_suspended(c, !VISIBLEON(c, m));
-       }
-   }
-
-   wlr_scene_node_set_enabled(&m->fullscreen_bg->node,
-           (c = focustop(m)) && c->isfullscreen);
-
-   strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof(m->ltsymbol));
-
-   /* We move all clients (except fullscreen and unmanaged) to LyrTile while
-    * in floating layout to avoid "real" floating clients be always on top */
-   wl_list_for_each(c, &clients, link) {
-       if (c->mon != m || c->scene->node.parent == layers[LyrFS])
-           continue;
-
-       wlr_scene_node_reparent(&c->scene->node,
-               (!m->lt[m->sellt]->arrange && c->isfloating)
-                       ? layers[LyrTile]
-                       : (m->lt[m->sellt]->arrange && c->isfloating)
-                               ? layers[LyrFloat]
-                               : c->scene->node.parent);
-   }
-
-   if (m->lt[m->sellt]->arrange)
-       m->lt[m->sellt]->arrange(m);
-   motionnotify(0, NULL, 0, 0, 0, 0);
-   checkidleinhibitor(NULL);
-   warpcursor(focustop(selmon));
-}
-
-void
-arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int exclusive)
-{
-   LayerSurface *l;
-   struct wlr_box full_area = m->m;
-
-   wl_list_for_each(l, list, link) {
-       struct wlr_layer_surface_v1 *layer_surface = l->layer_surface;
-
-       if (!layer_surface->initialized)
-           continue;
-
-       if (exclusive != (layer_surface->current.exclusive_zone > 0))
-           continue;
-
-       wlr_scene_layer_surface_v1_configure(l->scene_layer, &full_area, usable_area);
-       wlr_scene_node_set_position(&l->popups->node, l->scene->node.x, l->scene->node.y);
-   }
-}
-
-void
-arrangelayers(Monitor *m)
-{
-   int i;
-   struct wlr_box usable_area = m->m;
-   LayerSurface *l;
-   uint32_t layers_above_shell[] = {
-       ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY,
-       ZWLR_LAYER_SHELL_V1_LAYER_TOP,
-   };
-   if (!m->wlr_output->enabled)
-       return;
-
-   if (m->scene_buffer->node.enabled) {
-       usable_area.height -= m->b.real_height;
-       usable_area.y += topbar ? m->b.real_height : 0;
-   }
-
-   /* Arrange exclusive surfaces from top->bottom */
-   for (i = 3; i >= 0; i--)
-       arrangelayer(m, &m->layers[i], &usable_area, 1);
-
-   if (!wlr_box_equal(&usable_area, &m->w)) {
-       m->w = usable_area;
-       arrange(m);
-   }
-
-   /* Arrange non-exlusive surfaces from top->bottom */
-   for (i = 3; i >= 0; i--)
-       arrangelayer(m, &m->layers[i], &usable_area, 0);
-
-   /* Find topmost keyboard interactive layer, if such a layer exists */
-   for (i = 0; i < (int)LENGTH(layers_above_shell); i++) {
-       wl_list_for_each_reverse(l, &m->layers[layers_above_shell[i]], link) {
-           if (locked || !l->layer_surface->current.keyboard_interactive || !l->mapped)
-               continue;
-           /* Deactivate the focused client. */
-           focusclient(NULL, 0);
-           exclusive_focus = l;
-           client_notify_enter(l->layer_surface->surface, wlr_seat_get_keyboard(seat));
-           return;
-       }
-   }
-}
-
-void
-axisnotify(struct wl_listener *listener, void *data)
-{
-   /* This event is forwarded by the cursor when a pointer emits an axis event,
-    * for example when you move the scroll wheel. */
-   struct wlr_pointer_axis_event *event = data;
-   wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
-   /* TODO: allow usage of scroll wheel for mousebindings, it can be implemented
-    * by checking the event's orientation and the delta of the event */
-   /* Notify the client with pointer focus of the axis event. */
-   wlr_seat_pointer_notify_axis(seat,
-           event->time_msec, event->orientation, event->delta,
-           event->delta_discrete, event->source, event->relative_direction);
-}
-
-bool
-baracceptsinput(struct wlr_scene_buffer *buffer, double *sx, double *sy)
-{
-   return true;
-}
-
-void
-bufdestroy(struct wlr_buffer *wlr_buffer)
-{
-   Buffer *buf = wl_container_of(wlr_buffer, buf, base);
-   if (buf->busy)
-       wl_list_remove(&buf->release.link);
-   drwl_image_destroy(buf->image);
-   free(buf);
-}
-
-bool
-bufdatabegin(struct wlr_buffer *wlr_buffer, uint32_t flags,
-       void **data, uint32_t *format, size_t *stride)
-{
-   Buffer *buf = wl_container_of(wlr_buffer, buf, base);
-
-   if (flags & WLR_BUFFER_DATA_PTR_ACCESS_WRITE) return false;
-
-   *data   = buf->data;
-   *stride = wlr_buffer->width * 4;
-   *format = DRM_FORMAT_ARGB8888;
-
-   return true;
-}
-
-void
-bufdataend(struct wlr_buffer *wlr_buffer)
-{
-}
-
-Buffer *
-bufmon(Monitor *m)
-{
-   size_t i;
-   Buffer *buf = NULL;
-
-   for (i = 0; i < LENGTH(m->pool); i++) {
-       if (m->pool[i]) {
-           if (m->pool[i]->busy)
-               continue;
-           buf = m->pool[i];
-           break;
-       }
-
-       buf = ecalloc(1, sizeof(Buffer) + (m->b.width * 4 * m->b.height));
-       buf->image = drwl_image_create(NULL, m->b.width, m->b.height, buf->data);
-       wlr_buffer_init(&buf->base, &buffer_impl, m->b.width, m->b.height);
-       m->pool[i] = buf;
-       break;
-   }
-   if (!buf)
-       return NULL;
-
-   buf->busy = true;
-   LISTEN(&buf->base.events.release, &buf->release, bufrelease);
-   wlr_buffer_lock(&buf->base);
-   drwl_setimage(m->drw, buf->image);
-   return buf;
-}
-
-void
-bufrelease(struct wl_listener *listener, void *data)
-{
-   Buffer *buf = wl_container_of(listener, buf, release);
-   buf->busy = false;
-   wl_list_remove(&buf->release.link);
-}
-
-void
-buttonpress(struct wl_listener *listener, void *data)
-{
-   unsigned int i = 0, x = 0;
-   double cx;
-   unsigned int click;
-   struct wlr_pointer_button_event *event = data;
-   struct wlr_keyboard *keyboard;
-   struct wlr_scene_node *node;
-   struct wlr_scene_buffer *buffer;
-   uint32_t mods;
-   Arg arg = {0};
-   Client *c;
-   const Button *b;
-
-   wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
-
-   click = ClkRoot;
-   xytonode(cursor->x, cursor->y, NULL, &c, NULL, NULL, NULL);
-   if (c)
-       click = ClkClient;
-
-   switch (event->state) {
-   case WL_POINTER_BUTTON_STATE_PRESSED:
-       cursor_mode = CurPressed;
-       selmon = xytomon(cursor->x, cursor->y);
-       if (locked)
-           break;
-
-       if (!c && !exclusive_focus &&
-           (node = wlr_scene_node_at(&layers[LyrBottom]->node, cursor->x, cursor->y, NULL, NULL)) &&
-           (buffer = wlr_scene_buffer_from_node(node)) && buffer == selmon->scene_buffer) {
-           cx = (cursor->x - selmon->m.x) * selmon->wlr_output->scale;
-           do
-               x += TEXTW(selmon, tags[i]);
-           while (cx >= x && ++i < LENGTH(tags));
-           if (i < LENGTH(tags)) {
-               click = ClkTagBar;
-               arg.ui = 1 << i;
-           } else if (cx < x + TEXTW(selmon, selmon->ltsymbol))
-               click = ClkLtSymbol;
-           else if (cx > selmon->b.width - (TEXTW(selmon, stext) - selmon->lrpad + 2)) {
-               click = ClkStatus;
-           } else
-               click = ClkTitle;
-       }
-
-       /* Change focus if the button was _pressed_ over a client */
-       xytonode(cursor->x, cursor->y, NULL, &c, NULL, NULL, NULL);
-       if (click == ClkClient && (!client_is_unmanaged(c) || client_wants_focus(c)))
-           focusclient(c, 1);
-
-       keyboard = wlr_seat_get_keyboard(seat);
-       mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
-       for (b = buttons; b < END(buttons); b++) {
-           if (CLEANMASK(mods) == CLEANMASK(b->mod) && event->button == b->button && click == b->click && b->func) {
-               b->func(click == ClkTagBar && b->arg.i == 0 ? &arg : &b->arg);
-               return;
-           }
-       }
-       break;
-   case WL_POINTER_BUTTON_STATE_RELEASED:
-       /* If you released any buttons, we exit interactive move/resize mode. */
-       /* TODO: should reset to the pointer focus's current setcursor */
-       if (!locked && cursor_mode != CurNormal && cursor_mode != CurPressed) {
-           wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
-           cursor_mode = CurNormal;
-           /* Drop the window off on its new monitor */
-           selmon = xytomon(cursor->x, cursor->y);
-           setmon(grabc, selmon, 0);
-           grabc = NULL;
-           return;
-       }
-       cursor_mode = CurNormal;
-       break;
-   }
-   /* If the event wasn't handled by the compositor, notify the client with
-    * pointer focus that a button press has occurred */
-   wlr_seat_pointer_notify_button(seat,
-           event->time_msec, event->button, event->state);
-}
-
-void
-chvt(const Arg *arg)
-{
-   wlr_session_change_vt(session, arg->ui);
-}
-
-void
-checkidleinhibitor(struct wlr_surface *exclude)
-{
-   int inhibited = 0, unused_lx, unused_ly;
-   struct wlr_idle_inhibitor_v1 *inhibitor;
-   wl_list_for_each(inhibitor, &idle_inhibit_mgr->inhibitors, link) {
-       struct wlr_surface *surface = wlr_surface_get_root_surface(inhibitor->surface);
-       struct wlr_scene_tree *tree = surface->data;
-       if (exclude != surface && (bypass_surface_visibility || (!tree
-               || wlr_scene_node_coords(&tree->node, &unused_lx, &unused_ly)))) {
-           inhibited = 1;
-           break;
-       }
-   }
-
-   wlr_idle_notifier_v1_set_inhibited(idle_notifier, inhibited);
-}
-
-void
-cleanup(void)
-{
-   cleanuplisteners();
-#ifdef XWAYLAND
-   wlr_xwayland_destroy(xwayland);
-   xwayland = NULL;
-#endif
-   wl_display_destroy_clients(dpy);
-   if (child_pid > 0) {
-       kill(-child_pid, SIGTERM);
-       waitpid(child_pid, NULL, 0);
-   }
-   wlr_xcursor_manager_destroy(cursor_mgr);
-
-   destroykeyboardgroup(&kb_group->destroy, NULL);
-
-   /* If it's not destroyed manually, it will cause a use-after-free of wlr_seat.
-    * Destroy it until it's fixed on the wlroots side */
-   wlr_backend_destroy(backend);
-
-   wl_display_destroy(dpy);
-   /* Destroy after the wayland display (when the monitors are already destroyed)
-      to avoid destroying them with an invalid scene output. */
-   wlr_scene_node_destroy(&scene->tree.node);
-
-   drwl_fini();
-}
-
-void
-cleanupmon(struct wl_listener *listener, void *data)
-{
-   Monitor *m = wl_container_of(listener, m, destroy);
-   LayerSurface *l, *tmp;
-   size_t i;
-
-   /* m->layers[i] are intentionally not unlinked */
-   for (i = 0; i < LENGTH(m->layers); i++) {
-       wl_list_for_each_safe(l, tmp, &m->layers[i], link)
-           wlr_layer_surface_v1_destroy(l->layer_surface);
-   }
-
-   for (i = 0; i < LENGTH(m->pool); i++)
-       wlr_buffer_drop(&m->pool[i]->base);
-
-   drwl_setimage(m->drw, NULL);
-   drwl_destroy(m->drw);
-
-   wl_list_remove(&m->destroy.link);
-   wl_list_remove(&m->frame.link);
-   wl_list_remove(&m->link);
-   wl_list_remove(&m->request_state.link);
-   if (m->lock_surface)
-       destroylocksurface(&m->destroy_lock_surface, NULL);
-   m->wlr_output->data = NULL;
-   wlr_output_layout_remove(output_layout, m->wlr_output);
-   wlr_scene_output_destroy(m->scene_output);
-
-   closemon(m);
-   wlr_scene_node_destroy(&m->fullscreen_bg->node);
-   wlr_scene_node_destroy(&m->scene_buffer->node);
-   free(m);
-}
-
-void
-cleanuplisteners(void)
-{
-   wl_list_remove(&cursor_axis.link);
-   wl_list_remove(&cursor_button.link);
-   wl_list_remove(&cursor_frame.link);
-   wl_list_remove(&cursor_motion.link);
-   wl_list_remove(&cursor_motion_absolute.link);
-   wl_list_remove(&gpu_reset.link);
-   wl_list_remove(&new_idle_inhibitor.link);
-   wl_list_remove(&layout_change.link);
-   wl_list_remove(&new_input_device.link);
-   wl_list_remove(&new_virtual_keyboard.link);
-   wl_list_remove(&new_virtual_pointer.link);
-   wl_list_remove(&new_pointer_constraint.link);
-   wl_list_remove(&new_output.link);
-   wl_list_remove(&new_xdg_toplevel.link);
-   wl_list_remove(&new_xdg_decoration.link);
-   wl_list_remove(&new_xdg_popup.link);
-   wl_list_remove(&new_layer_surface.link);
-   wl_list_remove(&output_mgr_apply.link);
-   wl_list_remove(&output_mgr_test.link);
-   wl_list_remove(&output_power_mgr_set_mode.link);
-   wl_list_remove(&request_activate.link);
-   wl_list_remove(&request_cursor.link);
-   wl_list_remove(&request_set_psel.link);
-   wl_list_remove(&request_set_sel.link);
-   wl_list_remove(&request_set_cursor_shape.link);
-   wl_list_remove(&request_start_drag.link);
-   wl_list_remove(&start_drag.link);
-   wl_list_remove(&new_session_lock.link);
-#ifdef XWAYLAND
-   wl_list_remove(&new_xwayland_surface.link);
-   wl_list_remove(&xwayland_ready.link);
-#endif
-}
-
-void
-closemon(Monitor *m)
-{
-   /* update selmon if needed and
-    * move closed monitor's clients to the focused one */
-   Client *c;
-   int i = 0, nmons = wl_list_length(&mons);
-   if (!nmons) {
-       selmon = NULL;
-   } else if (m == selmon) {
-       do /* don't switch to disabled mons */
-           selmon = wl_container_of(mons.next, selmon, link);
-       while (!selmon->wlr_output->enabled && i++ < nmons);
-
-       if (!selmon->wlr_output->enabled)
-           selmon = NULL;
-   }
-
-   wl_list_for_each(c, &clients, link) {
-       if (c->isfloating && c->geom.x > m->m.width)
-           resize(c, (struct wlr_box){.x = c->geom.x - m->w.width, .y = c->geom.y,
-                   .width = c->geom.width, .height = c->geom.height}, 0);
-       if (c->mon == m)
-           setmon(c, selmon, c->tags);
-   }
-   focusclient(focustop(selmon), 1);
-   drawbars();
-}
-
-void
-commitlayersurfacenotify(struct wl_listener *listener, void *data)
-{
-   LayerSurface *l = wl_container_of(listener, l, surface_commit);
-   struct wlr_layer_surface_v1 *layer_surface = l->layer_surface;
-   struct wlr_scene_tree *scene_layer = layers[layermap[layer_surface->current.layer]];
-   struct wlr_layer_surface_v1_state old_state;
-
-   if (l->layer_surface->initial_commit) {
-       client_set_scale(layer_surface->surface, l->mon->wlr_output->scale);
-
-       /* Temporarily set the layer's current state to pending
-        * so that we can easily arrange it */
-       old_state = l->layer_surface->current;
-       l->layer_surface->current = l->layer_surface->pending;
-       arrangelayers(l->mon);
-       l->layer_surface->current = old_state;
-       return;
-   }
-
-   if (layer_surface->current.committed == 0 && l->mapped == layer_surface->surface->mapped)
-       return;
-   l->mapped = layer_surface->surface->mapped;
-
-   if (scene_layer != l->scene->node.parent) {
-       wlr_scene_node_reparent(&l->scene->node, scene_layer);
-       wl_list_remove(&l->link);
-       wl_list_insert(&l->mon->layers[layer_surface->current.layer], &l->link);
-       wlr_scene_node_reparent(&l->popups->node, (layer_surface->current.layer
-               < ZWLR_LAYER_SHELL_V1_LAYER_TOP ? layers[LyrTop] : scene_layer));
-   }
-
-   arrangelayers(l->mon);
-}
-
-void
-commitnotify(struct wl_listener *listener, void *data)
-{
-   Client *c = wl_container_of(listener, c, commit);
-
-   if (c->surface.xdg->initial_commit) {
-       /*
-        * Get the monitor this client will be rendered on
-        * Note that if the user set a rule in which the client is placed on
-        * a different monitor based on its title, this will likely select
-        * a wrong monitor.
-        */
-       applyrules(c);
-       if (c->mon) {
-           client_set_scale(client_surface(c), c->mon->wlr_output->scale);
-       }
-       setmon(c, NULL, 0); /* Make sure to reapply rules in mapnotify() */
-
-       wlr_xdg_toplevel_set_wm_capabilities(c->surface.xdg->toplevel,
-               WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
-       if (c->decoration)
-           requestdecorationmode(&c->set_decoration_mode, c->decoration);
-       wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, 0, 0);
-       return;
-   }
-
-   resize(c, c->geom, (c->isfloating && !c->isfullscreen));
-
-   /* mark a pending resize as completed */
-   if (c->resize && c->resize <= c->surface.xdg->current.configure_serial)
-       c->resize = 0;
-}
-
-void
-commitpopup(struct wl_listener *listener, void *data)
-{
-   struct wlr_surface *surface = data;
-   struct wlr_xdg_popup *popup = wlr_xdg_popup_try_from_wlr_surface(surface);
-   LayerSurface *l = NULL;
-   Client *c = NULL;
-   struct wlr_box box;
-   int type = -1;
-
-   if (!popup->base->initial_commit)
-       return;
-
-   type = toplevel_from_wlr_surface(popup->base->surface, &c, &l);
-   if (!popup->parent || type < 0)
-       return;
-   popup->base->surface->data = wlr_scene_xdg_surface_create(
-           popup->parent->data, popup->base);
-   if ((l && !l->mon) || (c && !c->mon)) {
-       wlr_xdg_popup_destroy(popup);
-       return;
-   }
-   box = type == LayerShell ? l->mon->m : c->mon->w;
-   box.x -= (type == LayerShell ? l->scene->node.x : c->geom.x);
-   box.y -= (type == LayerShell ? l->scene->node.y : c->geom.y);
-   wlr_xdg_popup_unconstrain_from_box(popup, &box);
-   wl_list_remove(&listener->link);
-   free(listener);
-}
-
-void
-createdecoration(struct wl_listener *listener, void *data)
-{
-   struct wlr_xdg_toplevel_decoration_v1 *deco = data;
-   Client *c = deco->toplevel->base->data;
-   c->decoration = deco;
-
-   LISTEN(&deco->events.request_mode, &c->set_decoration_mode, requestdecorationmode);
-   LISTEN(&deco->events.destroy, &c->destroy_decoration, destroydecoration);
-
-   requestdecorationmode(&c->set_decoration_mode, deco);
-}
-
-void
-createidleinhibitor(struct wl_listener *listener, void *data)
-{
-   struct wlr_idle_inhibitor_v1 *idle_inhibitor = data;
-   LISTEN_STATIC(&idle_inhibitor->events.destroy, destroyidleinhibitor);
-
-   checkidleinhibitor(NULL);
-}
-
-void
-createkeyboard(struct wlr_keyboard *keyboard)
-{
-   /* Set the keymap to match the group keymap */
-   wlr_keyboard_set_keymap(keyboard, kb_group->wlr_group->keyboard.keymap);
-
-   /* Add the new keyboard to the group */
-   wlr_keyboard_group_add_keyboard(kb_group->wlr_group, keyboard);
-}
-
-KeyboardGroup *
-createkeyboardgroup(void)
-{
-   KeyboardGroup *group = ecalloc(1, sizeof(*group));
-   struct xkb_context *context;
-   struct xkb_keymap *keymap;
-
-   group->wlr_group = wlr_keyboard_group_create();
-   group->wlr_group->data = group;
-
-   /* Prepare an XKB keymap and assign it to the keyboard group. */
-   context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
-   if (!(keymap = xkb_keymap_new_from_names(context, &xkb_rules,
-               XKB_KEYMAP_COMPILE_NO_FLAGS)))
-       die("failed to compile keymap");
-
-   wlr_keyboard_set_keymap(&group->wlr_group->keyboard, keymap);
-   xkb_keymap_unref(keymap);
-   xkb_context_unref(context);
-
-   wlr_keyboard_set_repeat_info(&group->wlr_group->keyboard, repeat_rate, repeat_delay);
-
-   /* Set up listeners for keyboard events */
-   LISTEN(&group->wlr_group->keyboard.events.key, &group->key, keypress);
-   LISTEN(&group->wlr_group->keyboard.events.modifiers, &group->modifiers, keypressmod);
-
-   group->key_repeat_source = wl_event_loop_add_timer(event_loop, keyrepeat, group);
-
-   /* A seat can only have one keyboard, but this is a limitation of the
-    * Wayland protocol - not wlroots. We assign all connected keyboards to the
-    * same wlr_keyboard_group, which provides a single wlr_keyboard interface for
-    * all of them. Set this combined wlr_keyboard as the seat keyboard.
-    */
-   wlr_seat_set_keyboard(seat, &group->wlr_group->keyboard);
-   return group;
-}
-
-void
-createlayersurface(struct wl_listener *listener, void *data)
-{
-   struct wlr_layer_surface_v1 *layer_surface = data;
-   LayerSurface *l;
-   struct wlr_surface *surface = layer_surface->surface;
-   struct wlr_scene_tree *scene_layer = layers[layermap[layer_surface->pending.layer]];
-
-   if (!layer_surface->output
-           && !(layer_surface->output = selmon ? selmon->wlr_output : NULL)) {
-       wlr_layer_surface_v1_destroy(layer_surface);
-       return;
-   }
-
-   l = layer_surface->data = ecalloc(1, sizeof(*l));
-   l->type = LayerShell;
-   LISTEN(&surface->events.commit, &l->surface_commit, commitlayersurfacenotify);
-   LISTEN(&surface->events.unmap, &l->unmap, unmaplayersurfacenotify);
-   LISTEN(&layer_surface->events.destroy, &l->destroy, destroylayersurfacenotify);
-
-   l->layer_surface = layer_surface;
-   l->mon = layer_surface->output->data;
-   l->scene_layer = wlr_scene_layer_surface_v1_create(scene_layer, layer_surface);
-   l->scene = l->scene_layer->tree;
-   l->popups = surface->data = wlr_scene_tree_create(layer_surface->current.layer
-           < ZWLR_LAYER_SHELL_V1_LAYER_TOP ? layers[LyrTop] : scene_layer);
-   l->scene->node.data = l->popups->node.data = l;
-
-   wl_list_insert(&l->mon->layers[layer_surface->pending.layer],&l->link);
-   wlr_surface_send_enter(surface, layer_surface->output);
-}
-
-void
-createlocksurface(struct wl_listener *listener, void *data)
-{
-   SessionLock *lock = wl_container_of(listener, lock, new_surface);
-   struct wlr_session_lock_surface_v1 *lock_surface = data;
-   Monitor *m = lock_surface->output->data;
-   struct wlr_scene_tree *scene_tree = lock_surface->surface->data
-           = wlr_scene_subsurface_tree_create(lock->scene, lock_surface->surface);
-   m->lock_surface = lock_surface;
-
-   wlr_scene_node_set_position(&scene_tree->node, m->m.x, m->m.y);
-   wlr_session_lock_surface_v1_configure(lock_surface, m->m.width, m->m.height);
-
-   LISTEN(&lock_surface->events.destroy, &m->destroy_lock_surface, destroylocksurface);
-
-   if (m == selmon)
-       client_notify_enter(lock_surface->surface, wlr_seat_get_keyboard(seat));
-}
-
-void
-createmon(struct wl_listener *listener, void *data)
-{
-   /* This event is raised by the backend when a new output (aka a display or
-    * monitor) becomes available. */
-   struct wlr_output *wlr_output = data;
-   const MonitorRule *r;
-   size_t i;
-   struct wlr_output_state state;
-   Monitor *m;
-
-   if (!wlr_output_init_render(wlr_output, alloc, drw))
-       return;
-
-   m = wlr_output->data = ecalloc(1, sizeof(*m));
-   m->wlr_output = wlr_output;
-
-   for (i = 0; i < LENGTH(m->layers); i++)
-       wl_list_init(&m->layers[i]);
-
-   wlr_output_state_init(&state);
-   /* Initialize monitor state using configured rules */
-   m->gaps = gaps;
-
-   m->tagset[0] = m->tagset[1] = 1;
-   for (r = monrules; r < END(monrules); r++) {
-       if (!r->name || strstr(wlr_output->name, r->name)) {
-           m->m.x = r->x;
-           m->m.y = r->y;
-           m->mfact = r->mfact;
-           m->nmaster = r->nmaster;
-           m->lt[0] = r->lt;
-           m->lt[1] = &layouts[LENGTH(layouts) > 1 && r->lt != &layouts[1]];
-           strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof(m->ltsymbol));
-           wlr_output_state_set_scale(&state, r->scale);
-           wlr_output_state_set_transform(&state, r->rr);
-           break;
-       }
-   }
-
-   /* The mode is a tuple of (width, height, refresh rate), and each
-    * monitor supports only a specific set of modes. We just pick the
-    * monitor's preferred mode; a more sophisticated compositor would let
-    * the user configure it. */
-   wlr_output_state_set_mode(&state, wlr_output_preferred_mode(wlr_output));
-
-   /* Set up event listeners */
-   LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
-   LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon);
-   LISTEN(&wlr_output->events.request_state, &m->request_state, requestmonstate);
-
-   wlr_output_state_set_enabled(&state, 1);
-   wlr_output_commit_state(wlr_output, &state);
-   wlr_output_state_finish(&state);
-
-   if (!(m->drw = drwl_create()))
-       die("failed to create drwl context");
-
-   m->scene_buffer = wlr_scene_buffer_create(layers[LyrBottom], NULL);
-   m->scene_buffer->point_accepts_input = baracceptsinput;
-   updatebar(m);
-
-   wl_list_insert(&mons, &m->link);
-   drawbars();
-
-   /* The xdg-protocol specifies:
-    *
-    * If the fullscreened surface is not opaque, the compositor must make
-    * sure that other screen content not part of the same surface tree (made
-    * up of subsurfaces, popups or similarly coupled surfaces) are not
-    * visible below the fullscreened surface.
-    *
-    */
-   /* updatemons() will resize and set correct position */
-   m->fullscreen_bg = wlr_scene_rect_create(layers[LyrFS], 0, 0, fullscreen_bg);
-   wlr_scene_node_set_enabled(&m->fullscreen_bg->node, 0);
-
-   /* Adds this to the output layout in the order it was configured.
-    *
-    * The output layout utility automatically adds a wl_output global to the
-    * display, which Wayland clients can see to find out information about the
-    * output (such as DPI, scale factor, manufacturer, etc).
-    */
-   m->scene_output = wlr_scene_output_create(scene, wlr_output);
-   if (m->m.x == -1 && m->m.y == -1)
-       wlr_output_layout_add_auto(output_layout, wlr_output);
-   else
-       wlr_output_layout_add(output_layout, wlr_output, m->m.x, m->m.y);
-}
-
-void
-createnotify(struct wl_listener *listener, void *data)
-{
-   /* This event is raised when a client creates a new toplevel (application window). */
-   struct wlr_xdg_toplevel *toplevel = data;
-   Client *c = NULL;
-
-   /* Allocate a Client for this surface */
-   c = toplevel->base->data = ecalloc(1, sizeof(*c));
-   c->surface.xdg = toplevel->base;
-   c->bw = borderpx;
-
-   LISTEN(&toplevel->base->surface->events.commit, &c->commit, commitnotify);
-   LISTEN(&toplevel->base->surface->events.map, &c->map, mapnotify);
-   LISTEN(&toplevel->base->surface->events.unmap, &c->unmap, unmapnotify);
-   LISTEN(&toplevel->events.destroy, &c->destroy, destroynotify);
-   LISTEN(&toplevel->events.request_fullscreen, &c->fullscreen, fullscreennotify);
-   LISTEN(&toplevel->events.request_maximize, &c->maximize, maximizenotify);
-   LISTEN(&toplevel->events.set_title, &c->set_title, updatetitle);
-}
-
-void
-createpointer(struct wlr_pointer *pointer)
-{
-   struct libinput_device *device;
-   if (wlr_input_device_is_libinput(&pointer->base)
-           && (device = wlr_libinput_get_device_handle(&pointer->base))) {
-
-       if (libinput_device_config_tap_get_finger_count(device)) {
-           libinput_device_config_tap_set_enabled(device, tap_to_click);
-           libinput_device_config_tap_set_drag_enabled(device, tap_and_drag);
-           libinput_device_config_tap_set_drag_lock_enabled(device, drag_lock);
-           libinput_device_config_tap_set_button_map(device, button_map);
-       }
-
-       if (libinput_device_config_scroll_has_natural_scroll(device))
-           libinput_device_config_scroll_set_natural_scroll_enabled(device, natural_scrolling);
-
-       if (libinput_device_config_dwt_is_available(device))
-           libinput_device_config_dwt_set_enabled(device, disable_while_typing);
-
-       if (libinput_device_config_left_handed_is_available(device))
-           libinput_device_config_left_handed_set(device, left_handed);
-
-       if (libinput_device_config_middle_emulation_is_available(device))
-           libinput_device_config_middle_emulation_set_enabled(device, middle_button_emulation);
-
-       if (libinput_device_config_scroll_get_methods(device) != LIBINPUT_CONFIG_SCROLL_NO_SCROLL)
-           libinput_device_config_scroll_set_method(device, scroll_method);
-
-       if (libinput_device_config_click_get_methods(device) != LIBINPUT_CONFIG_CLICK_METHOD_NONE)
-           libinput_device_config_click_set_method(device, click_method);
-
-       if (libinput_device_config_send_events_get_modes(device))
-           libinput_device_config_send_events_set_mode(device, send_events_mode);
-
-       if (libinput_device_config_accel_is_available(device)) {
-           libinput_device_config_accel_set_profile(device, accel_profile);
-           libinput_device_config_accel_set_speed(device, accel_speed);
-       }
-   }
-
-   wlr_cursor_attach_input_device(cursor, &pointer->base);
-}
-
-void
-createpointerconstraint(struct wl_listener *listener, void *data)
-{
-   PointerConstraint *pointer_constraint = ecalloc(1, sizeof(*pointer_constraint));
-   pointer_constraint->constraint = data;
-   LISTEN(&pointer_constraint->constraint->events.destroy,
-           &pointer_constraint->destroy, destroypointerconstraint);
-}
-
-void
-createpopup(struct wl_listener *listener, void *data)
-{
-   /* This event is raised when a client (either xdg-shell or layer-shell)
-    * creates a new popup. */
-   struct wlr_xdg_popup *popup = data;
-   LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup);
-}
-
-void
-cursorconstrain(struct wlr_pointer_constraint_v1 *constraint)
-{
-   if (active_constraint == constraint)
-       return;
-
-   if (active_constraint)
-       wlr_pointer_constraint_v1_send_deactivated(active_constraint);
-
-   active_constraint = constraint;
-   wlr_pointer_constraint_v1_send_activated(constraint);
-}
-
-void
-cursorframe(struct wl_listener *listener, void *data)
-{
-   /* This event is forwarded by the cursor when a pointer emits a frame
-    * event. Frame events are sent after regular pointer events to group
-    * multiple events together. For instance, two axis events may happen at the
-    * same time, in which case a frame event won't be sent in between. */
-   /* Notify the client with pointer focus of the frame event. */
-   wlr_seat_pointer_notify_frame(seat);
-}
-
-void
-cursorwarptohint(void)
-{
-   Client *c = NULL;
-   double sx = active_constraint->current.cursor_hint.x;
-   double sy = active_constraint->current.cursor_hint.y;
-
-   toplevel_from_wlr_surface(active_constraint->surface, &c, NULL);
-   if (c && active_constraint->current.cursor_hint.enabled) {
-       wlr_cursor_warp(cursor, NULL, sx + c->geom.x + c->bw, sy + c->geom.y + c->bw);
-       wlr_seat_pointer_warp(active_constraint->seat, sx, sy);
-   }
-}
-
-void
-destroydecoration(struct wl_listener *listener, void *data)
-{
-   Client *c = wl_container_of(listener, c, destroy_decoration);
-
-   wl_list_remove(&c->destroy_decoration.link);
-   wl_list_remove(&c->set_decoration_mode.link);
-}
-
-void
-destroydragicon(struct wl_listener *listener, void *data)
-{
-   /* Focus enter isn't sent during drag, so refocus the focused node. */
-   focusclient(focustop(selmon), 1);
-   motionnotify(0, NULL, 0, 0, 0, 0);
-   wl_list_remove(&listener->link);
-   free(listener);
-}
-
-void
-destroyidleinhibitor(struct wl_listener *listener, void *data)
-{
-   /* `data` is the wlr_surface of the idle inhibitor being destroyed,
-    * at this point the idle inhibitor is still in the list of the manager */
-   checkidleinhibitor(wlr_surface_get_root_surface(data));
-   wl_list_remove(&listener->link);
-   free(listener);
-}
-
-void
-destroylayersurfacenotify(struct wl_listener *listener, void *data)
-{
-   LayerSurface *l = wl_container_of(listener, l, destroy);
-
-   wl_list_remove(&l->link);
-   wl_list_remove(&l->destroy.link);
-   wl_list_remove(&l->unmap.link);
-   wl_list_remove(&l->surface_commit.link);
-   wlr_scene_node_destroy(&l->scene->node);
-   wlr_scene_node_destroy(&l->popups->node);
-   free(l);
-}
-
-void
-destroylock(SessionLock *lock, int unlock)
-{
-   wlr_seat_keyboard_notify_clear_focus(seat);
-   if ((locked = !unlock))
-       goto destroy;
-
-   wlr_scene_node_set_enabled(&locked_bg->node, 0);
-
-   focusclient(focustop(selmon), 0);
-   motionnotify(0, NULL, 0, 0, 0, 0);
-
-destroy:
-   wl_list_remove(&lock->new_surface.link);
-   wl_list_remove(&lock->unlock.link);
-   wl_list_remove(&lock->destroy.link);
-
-   wlr_scene_node_destroy(&lock->scene->node);
-   cur_lock = NULL;
-   free(lock);
-}
-
-void
-destroylocksurface(struct wl_listener *listener, void *data)
-{
-   Monitor *m = wl_container_of(listener, m, destroy_lock_surface);
-   struct wlr_session_lock_surface_v1 *surface, *lock_surface = m->lock_surface;
-
-   m->lock_surface = NULL;
-   wl_list_remove(&m->destroy_lock_surface.link);
-
-   if (lock_surface->surface != seat->keyboard_state.focused_surface)
-       return;
-
-   if (locked && cur_lock && !wl_list_empty(&cur_lock->surfaces)) {
-       surface = wl_container_of(cur_lock->surfaces.next, surface, link);
-       client_notify_enter(surface->surface, wlr_seat_get_keyboard(seat));
-   } else if (!locked) {
-       focusclient(focustop(selmon), 1);
-   } else {
-       wlr_seat_keyboard_clear_focus(seat);
-   }
-}
-
-void
-destroynotify(struct wl_listener *listener, void *data)
-{
-   /* Called when the xdg_toplevel is destroyed. */
-   Client *c = wl_container_of(listener, c, destroy);
-   wl_list_remove(&c->destroy.link);
-   wl_list_remove(&c->set_title.link);
-   wl_list_remove(&c->fullscreen.link);
-#ifdef XWAYLAND
-   if (c->type != XDGShell) {
-       wl_list_remove(&c->activate.link);
-       wl_list_remove(&c->associate.link);
-       wl_list_remove(&c->configure.link);
-       wl_list_remove(&c->dissociate.link);
-       wl_list_remove(&c->set_hints.link);
-   } else
-#endif
-   {
-       wl_list_remove(&c->commit.link);
-       wl_list_remove(&c->map.link);
-       wl_list_remove(&c->unmap.link);
-       wl_list_remove(&c->maximize.link);
-   }
-   free(c);
-}
-
-void
-destroypointerconstraint(struct wl_listener *listener, void *data)
-{
-   PointerConstraint *pointer_constraint = wl_container_of(listener, pointer_constraint, destroy);
-
-   if (active_constraint == pointer_constraint->constraint) {
-       cursorwarptohint();
-       active_constraint = NULL;
-   }
-
-   wl_list_remove(&pointer_constraint->destroy.link);
-   free(pointer_constraint);
-}
-
-void
-destroysessionlock(struct wl_listener *listener, void *data)
-{
-   SessionLock *lock = wl_container_of(listener, lock, destroy);
-   destroylock(lock, 0);
-}
-
-void
-destroykeyboardgroup(struct wl_listener *listener, void *data)
-{
-   KeyboardGroup *group = wl_container_of(listener, group, destroy);
-   wl_event_source_remove(group->key_repeat_source);
-   wl_list_remove(&group->key.link);
-   wl_list_remove(&group->modifiers.link);
-   wl_list_remove(&group->destroy.link);
-   wlr_keyboard_group_destroy(group->wlr_group);
-   free(group);
-}
-
-Monitor *
-dirtomon(enum wlr_direction dir)
-{
-   struct wlr_output *next;
-   if (!wlr_output_layout_get(output_layout, selmon->wlr_output))
-       return selmon;
-   if ((next = wlr_output_layout_adjacent_output(output_layout,
-           dir, selmon->wlr_output, selmon->m.x, selmon->m.y)))
-       return next->data;
-   if ((next = wlr_output_layout_farthest_output(output_layout,
-           dir ^ (WLR_DIRECTION_LEFT|WLR_DIRECTION_RIGHT),
-           selmon->wlr_output, selmon->m.x, selmon->m.y)))
-       return next->data;
-   return selmon;
-}
-
-void
-drawbar(Monitor *m)
-{
-   int x, w, tw = 0;
-   uint32_t i, occ = 0, urg = 0;
-   Client *c;
-   Buffer *buf;
-
-   if (!m->scene_buffer->node.enabled)
-       return;
-   if (!(buf = bufmon(m)))
-       return;
-
-   /* draw status first so it can be overdrawn by tags later */
-   // if (m == selmon) { /* status is only drawn on selected monitor */
-   drwl_setscheme(m->drw, colors[SchemeNorm]);
-   tw = TEXTW(m, stext) - m->lrpad + 2; /* 2px right padding */
-   drwl_text(m->drw, m->b.width - tw, 0, tw, m->b.height, 0, stext, 0);
-   // }
-
-   wl_list_for_each(c, &clients, link) {
-       if (c->mon != m)
-           continue;
-       occ |= c->tags;
-       if (c->isurgent)
-           urg |= c->tags;
-   }
-   x = 0;
-   c = focustop(m);
-   for (i = 0; i < LENGTH(tags); i++) {
-       w = TEXTW(m, tags[i]);
-       drwl_setscheme(m->drw, colors[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
-       drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, tags[i], urg & 1 << i);
-       // Removing the rec on the focused tag
-       // if (occ & 1 << i)
-           // drwl_rect(m->drw, x + boxs, boxs, boxw, boxw,
-               // m == selmon && c && c->tags & 1 << i,
-               // urg & 1 << i);
-       x += w;
-   }
-   w = TEXTW(m, m->ltsymbol);
-   drwl_setscheme(m->drw, colors[SchemeNorm]);
-   x = drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, m->ltsymbol, 0);
-
-   if ((w = m->b.width - tw - x) > m->b.height) {
-       drwl_setscheme(m->drw, colors[SchemeNorm]);
-       drwl_rect(m->drw, x, 0, w, m->b.height, 1, 1);
-   }
-
-   wlr_scene_buffer_set_dest_size(m->scene_buffer,
-       m->b.real_width, m->b.real_height);
-   wlr_scene_node_set_position(&m->scene_buffer->node, m->m.x,
-       m->m.y + (topbar ? 0 : m->m.height - m->b.real_height));
-   wlr_scene_buffer_set_buffer(m->scene_buffer, &buf->base);
-   wlr_buffer_unlock(&buf->base);
-}
-
-void
-drawbars(void)
-{
-   Monitor *m = NULL;
-
-   wl_list_for_each(m, &mons, link)
-       drawbar(m);
-}
-
-void
-focusclient(Client *c, int lift)
-{
-   struct wlr_surface *old = seat->keyboard_state.focused_surface;
-   int unused_lx, unused_ly, old_client_type;
-   Client *old_c = NULL;
-   LayerSurface *old_l = NULL;
-
-   if (locked)
-       return;
-
-   /* Warp cursor to center of client if it is outside */
-   if (lift)
-       warpcursor(c);
-
-   /* Raise client in stacking order if requested */
-   if (c && lift)
-       wlr_scene_node_raise_to_top(&c->scene->node);
-
-   if (c && client_surface(c) == old)
-       return;
-
-   if ((old_client_type = toplevel_from_wlr_surface(old, &old_c, &old_l)) == XDGShell) {
-       struct wlr_xdg_popup *popup, *tmp;
-       wl_list_for_each_safe(popup, tmp, &old_c->surface.xdg->popups, link)
-           wlr_xdg_popup_destroy(popup);
-   }
-
-   /* Put the new client atop the focus stack and select its monitor */
-   if (c && !client_is_unmanaged(c)) {
-       wl_list_remove(&c->flink);
-       wl_list_insert(&fstack, &c->flink);
-       selmon = c->mon;
-       c->isurgent = 0;
-
-       /* Don't change border color if there is an exclusive focus or we are
-        * handling a drag operation */
-       if (!exclusive_focus && !seat->drag)
-           client_set_border_color(c, (float[])COLOR(colors[SchemeSel][ColBorder]));
-   }
-
-   /* Deactivate old client if focus is changing */
-   if (old && (!c || client_surface(c) != old)) {
-       /* If an overlay is focused, don't focus or activate the client,
-        * but only update its position in fstack to render its border with its color
-        * and focus it after the overlay is closed. */
-       if (old_client_type == LayerShell && wlr_scene_node_coords(
-                   &old_l->scene->node, &unused_lx, &unused_ly)
-               && old_l->layer_surface->current.layer >= ZWLR_LAYER_SHELL_V1_LAYER_TOP) {
-           return;
-       } else if (old_c && old_c == exclusive_focus && client_wants_focus(old_c)) {
-           return;
-       /* Don't deactivate old client if the new one wants focus, as this causes issues with winecfg
-        * and probably other clients */
-       } else if (old_c && !client_is_unmanaged(old_c) && (!c || !client_wants_focus(c))) {
-           client_set_border_color(old_c, (float[])COLOR(colors[SchemeNorm][ColBorder]));
-           client_activate_surface(old, 0);
-       }
-   }
-   drawbars();
-
-   if (!c) {
-       /* With no client, all we have left is to clear focus */
-       wlr_seat_keyboard_notify_clear_focus(seat);
-       return;
-   }
-
-   /* Change cursor surface */
-   motionnotify(0, NULL, 0, 0, 0, 0);
-
-   /* Have a client, so focus its top-level wlr_surface */
-   client_notify_enter(client_surface(c), wlr_seat_get_keyboard(seat));
-
-   /* Activate the new client */
-   client_activate_surface(client_surface(c), 1);
-}
-
-void
-focusmon(const Arg *arg)
-{
-   int i = 0, nmons = wl_list_length(&mons);
-   if (nmons) {
-       do /* don't switch to disabled mons */
-           selmon = dirtomon(arg->i);
-       while (!selmon->wlr_output->enabled && i++ < nmons);
-   }
-   focusclient(focustop(selmon), 1);
-}
-
-void
-focusstack(const Arg *arg)
-{
-   /* Focus the next or previous client (in tiling order) on selmon */
-   Client *c, *sel = focustop(selmon);
-   if (!sel || (sel->isfullscreen && !client_has_children(sel)))
-       return;
-   if (arg->i > 0) {
-       wl_list_for_each(c, &sel->link, link) {
-           if (&c->link == &clients)
-               continue; /* wrap past the sentinel node */
-           if (VISIBLEON(c, selmon))
-               break; /* found it */
-       }
-   } else {
-       wl_list_for_each_reverse(c, &sel->link, link) {
-           if (&c->link == &clients)
-               continue; /* wrap past the sentinel node */
-           if (VISIBLEON(c, selmon))
-               break; /* found it */
-       }
-   }
-   /* If only one client is visible on selmon, then c == sel */
-   focusclient(c, 1);
-}
-
-/* We probably should change the name of this: it sounds like it
- * will focus the topmost client of this mon, when actually will
- * only return that client */
-Client *
-focustop(Monitor *m)
-{
-   Client *c;
-   wl_list_for_each(c, &fstack, flink) {
-       if (VISIBLEON(c, m))
-           return c;
-   }
-   return NULL;
-}
-
-void
-fullscreennotify(struct wl_listener *listener, void *data)
-{
-   Client *c = wl_container_of(listener, c, fullscreen);
-   setfullscreen(c, client_wants_fullscreen(c));
-}
-
-void
-gpureset(struct wl_listener *listener, void *data)
-{
-   struct wlr_renderer *old_drw = drw;
-   struct wlr_allocator *old_alloc = alloc;
-   struct Monitor *m;
-   if (!(drw = wlr_renderer_autocreate(backend)))
-       die("couldn't recreate renderer");
-
-   if (!(alloc = wlr_allocator_autocreate(backend, drw)))
-       die("couldn't recreate allocator");
-
-   wl_list_remove(&gpu_reset.link);
-   wl_signal_add(&drw->events.lost, &gpu_reset);
-
-   wlr_compositor_set_renderer(compositor, drw);
-
-   wl_list_for_each(m, &mons, link) {
-       wlr_output_init_render(m->wlr_output, alloc, drw);
-   }
-
-   wlr_allocator_destroy(old_alloc);
-   wlr_renderer_destroy(old_drw);
-}
-
-void
-handlesig(int signo)
-{
-   if (signo == SIGCHLD)
-       while (waitpid(-1, NULL, WNOHANG) > 0);
-   else if (signo == SIGINT || signo == SIGTERM)
-       quit(NULL);
-}
-
-void
-incnmaster(const Arg *arg)
-{
-   if (!arg || !selmon)
-       return;
-   selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
-   arrange(selmon);
-}
-
-void
-inputdevice(struct wl_listener *listener, void *data)
-{
-   /* This event is raised by the backend when a new input device becomes
-    * available. */
-   struct wlr_input_device *device = data;
-   uint32_t caps;
-
-   switch (device->type) {
-   case WLR_INPUT_DEVICE_KEYBOARD:
-       createkeyboard(wlr_keyboard_from_input_device(device));
-       break;
-   case WLR_INPUT_DEVICE_POINTER:
-       createpointer(wlr_pointer_from_input_device(device));
-       break;
-   default:
-       /* TODO handle other input device types */
-       break;
-   }
-
-   /* We need to let the wlr_seat know what our capabilities are, which is
-    * communiciated to the client. In dwl we always have a cursor, even if
-    * there are no pointer devices, so we always include that capability. */
-   /* TODO do we actually require a cursor? */
-   caps = WL_SEAT_CAPABILITY_POINTER;
-   if (!wl_list_empty(&kb_group->wlr_group->devices))
-       caps |= WL_SEAT_CAPABILITY_KEYBOARD;
-   wlr_seat_set_capabilities(seat, caps);
-}
-
-int
-keybinding(uint32_t mods, xkb_keysym_t sym)
-{
-   /*
-    * Here we handle compositor keybindings. This is when the compositor is
-    * processing keys, rather than passing them on to the client for its own
-    * processing.
-    */
-   const Key *k;
-   for (k = keys; k < END(keys); k++) {
-       if (CLEANMASK(mods) == CLEANMASK(k->mod)
-               && sym == k->keysym && k->func) {
-           k->func(&k->arg);
-           return 1;
-       }
-   }
-   return 0;
-}
-
-void
-keypress(struct wl_listener *listener, void *data)
-{
-   int i;
-   /* This event is raised when a key is pressed or released. */
-   KeyboardGroup *group = wl_container_of(listener, group, key);
-   struct wlr_keyboard_key_event *event = data;
-
-   /* Translate libinput keycode -> xkbcommon */
-   uint32_t keycode = event->keycode + 8;
-   /* Get a list of keysyms based on the keymap for this keyboard */
-   const xkb_keysym_t *syms;
-   int nsyms = xkb_state_key_get_syms(
-           group->wlr_group->keyboard.xkb_state, keycode, &syms);
-
-   int handled = 0;
-   uint32_t mods = wlr_keyboard_get_modifiers(&group->wlr_group->keyboard);
-
-   wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
-
-   /* On _press_ if there is no active screen locker,
-    * attempt to process a compositor keybinding. */
-   if (!locked && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
-       for (i = 0; i < nsyms; i++)
-           handled = keybinding(mods, syms[i]) || handled;
-   }
-
-   if (handled && group->wlr_group->keyboard.repeat_info.delay > 0) {
-       group->mods = mods;
-       group->keysyms = syms;
-       group->nsyms = nsyms;
-       wl_event_source_timer_update(group->key_repeat_source,
-               group->wlr_group->keyboard.repeat_info.delay);
-   } else {
-       group->nsyms = 0;
-       wl_event_source_timer_update(group->key_repeat_source, 0);
-   }
-
-   if (handled)
-       return;
-
-   wlr_seat_set_keyboard(seat, &group->wlr_group->keyboard);
-   /* Pass unhandled keycodes along to the client. */
-   wlr_seat_keyboard_notify_key(seat, event->time_msec,
-           event->keycode, event->state);
-}
-
-void
-keypressmod(struct wl_listener *listener, void *data)
-{
-   /* This event is raised when a modifier key, such as shift or alt, is
-    * pressed. We simply communicate this to the client. */
-   KeyboardGroup *group = wl_container_of(listener, group, modifiers);
-
-   wlr_seat_set_keyboard(seat, &group->wlr_group->keyboard);
-   /* Send modifiers to the client. */
-   wlr_seat_keyboard_notify_modifiers(seat,
-           &group->wlr_group->keyboard.modifiers);
-}
-
-int
-keyrepeat(void *data)
-{
-   KeyboardGroup *group = data;
-   int i;
-   if (!group->nsyms || group->wlr_group->keyboard.repeat_info.rate <= 0)
-       return 0;
-
-   wl_event_source_timer_update(group->key_repeat_source,
-           1000 / group->wlr_group->keyboard.repeat_info.rate);
-
-   for (i = 0; i < group->nsyms; i++)
-       keybinding(group->mods, group->keysyms[i]);
-
-   return 0;
-}
-
-void
-killclient(const Arg *arg)
-{
-   Client *sel = focustop(selmon);
-   if (sel)
-       client_send_close(sel);
-}
-
-void
-locksession(struct wl_listener *listener, void *data)
-{
-   struct wlr_session_lock_v1 *session_lock = data;
-   SessionLock *lock;
-   wlr_scene_node_set_enabled(&locked_bg->node, 1);
-   if (cur_lock) {
-       wlr_session_lock_v1_destroy(session_lock);
-       return;
-   }
-   lock = session_lock->data = ecalloc(1, sizeof(*lock));
-   focusclient(NULL, 0);
-
-   lock->scene = wlr_scene_tree_create(layers[LyrBlock]);
-   cur_lock = lock->lock = session_lock;
-   locked = 1;
-
-   LISTEN(&session_lock->events.new_surface, &lock->new_surface, createlocksurface);
-   LISTEN(&session_lock->events.destroy, &lock->destroy, destroysessionlock);
-   LISTEN(&session_lock->events.unlock, &lock->unlock, unlocksession);
-
-   wlr_session_lock_v1_send_locked(session_lock);
-}
-
-void
-mapnotify(struct wl_listener *listener, void *data)
-{
-   /* Called when the surface is mapped, or ready to display on-screen. */
-   Client *p = NULL;
-   Client *w, *c = wl_container_of(listener, c, map);
-   Monitor *m;
-   int i;
-
-   /* Create scene tree for this client and its border */
-   c->scene = client_surface(c)->data = wlr_scene_tree_create(layers[LyrTile]);
-   /* Enabled later by a call to arrange() */
-   wlr_scene_node_set_enabled(&c->scene->node, client_is_unmanaged(c));
-   c->scene_surface = c->type == XDGShell
-           ? wlr_scene_xdg_surface_create(c->scene, c->surface.xdg)
-           : wlr_scene_subsurface_tree_create(c->scene, client_surface(c));
-   c->scene->node.data = c->scene_surface->node.data = c;
-
-   client_get_geometry(c, &c->geom);
-
-   /* Handle unmanaged clients first so we can return prior create borders */
-   if (client_is_unmanaged(c)) {
-       /* Unmanaged clients always are floating */
-       wlr_scene_node_reparent(&c->scene->node, layers[LyrFloat]);
-       wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
-       client_set_size(c, c->geom.width, c->geom.height);
-       if (client_wants_focus(c)) {
-           focusclient(c, 1);
-           exclusive_focus = c;
-       }
-       goto unset_fullscreen;
-   }
-
-   for (i = 0; i < 4; i++) {
-       c->border[i] = wlr_scene_rect_create(c->scene, 0, 0,
-           (float[])COLOR(colors[c->isurgent ? SchemeUrg : SchemeNorm][ColBorder]));
-       c->border[i]->node.data = c;
-   }
-
-   /* Initialize client geometry with room for border */
-   client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT);
-   c->geom.width += 2 * c->bw;
-   c->geom.height += 2 * c->bw;
-
-   /* Insert this client into client lists. */
-   wl_list_insert(&clients, &c->link);
-   wl_list_insert(&fstack, &c->flink);
-
-   /* Set initial monitor, tags, floating status, and focus:
-    * we always consider floating, clients that have parent and thus
-    * we set the same tags and monitor as its parent.
-    * If there is no parent, apply rules */
-   if ((p = client_get_parent(c))) {
-       c->isfloating = 1;
-       setmon(c, p->mon, p->tags);
-   } else {
-       applyrules(c);
-   }
-   drawbars();
-
-unset_fullscreen:
-   m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y);
-   wl_list_for_each(w, &clients, link) {
-       if (w != c && w != p && w->isfullscreen && m == w->mon && (w->tags & c->tags))
-           setfullscreen(w, 0);
-   }
-}
-
-void
-maximizenotify(struct wl_listener *listener, void *data)
-{
-   /* This event is raised when a client would like to maximize itself,
-    * typically because the user clicked on the maximize button on
-    * client-side decorations. dwl doesn't support maximization, but
-    * to conform to xdg-shell protocol we still must send a configure.
-    * Since xdg-shell protocol v5 we should ignore request of unsupported
-    * capabilities, just schedule a empty configure when the client uses <5
-    * protocol version
-    * wlr_xdg_surface_schedule_configure() is used to send an empty reply. */
-   Client *c = wl_container_of(listener, c, maximize);
-   if (c->surface.xdg->initialized
-           && wl_resource_get_version(c->surface.xdg->toplevel->resource)
-                   < XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION)
-       wlr_xdg_surface_schedule_configure(c->surface.xdg);
-}
-
-void
-monocle(Monitor *m)
-{
-   Client *c;
-   int n = 0;
-
-   wl_list_for_each(c, &clients, link) {
-       if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
-           continue;
-       resize(c, m->w, 0);
-       n++;
-   }
-   if (n)
-       snprintf(m->ltsymbol, LENGTH(m->ltsymbol), "[%d]", n);
-   if ((c = focustop(m)))
-       wlr_scene_node_raise_to_top(&c->scene->node);
-}
-
-void
-motionabsolute(struct wl_listener *listener, void *data)
-{
-   /* This event is forwarded by the cursor when a pointer emits an _absolute_
-    * motion event, from 0..1 on each axis. This happens, for example, when
-    * wlroots is running under a Wayland window rather than KMS+DRM, and you
-    * move the mouse over the window. You could enter the window from any edge,
-    * so we have to warp the mouse there. Also, some hardware emits these events. */
-   struct wlr_pointer_motion_absolute_event *event = data;
-   double lx, ly, dx, dy;
-
-   if (!event->time_msec) /* this is 0 with virtual pointers */
-       wlr_cursor_warp_absolute(cursor, &event->pointer->base, event->x, event->y);
-
-   wlr_cursor_absolute_to_layout_coords(cursor, &event->pointer->base, event->x, event->y, &lx, &ly);
-   dx = lx - cursor->x;
-   dy = ly - cursor->y;
-   motionnotify(event->time_msec, &event->pointer->base, dx, dy, dx, dy);
-}
-
-void
-motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double dy,
-       double dx_unaccel, double dy_unaccel)
-{
-   double sx = 0, sy = 0, sx_confined, sy_confined;
-   Client *c = NULL, *w = NULL;
-   LayerSurface *l = NULL;
-   struct wlr_surface *surface = NULL;
-   struct wlr_pointer_constraint_v1 *constraint;
-
-   /* Find the client under the pointer and send the event along. */
-   xytonode(cursor->x, cursor->y, &surface, &c, NULL, &sx, &sy);
-
-   if (cursor_mode == CurPressed && !seat->drag
-           && surface != seat->pointer_state.focused_surface
-           && toplevel_from_wlr_surface(seat->pointer_state.focused_surface, &w, &l) >= 0) {
-       c = w;
-       surface = seat->pointer_state.focused_surface;
-       sx = cursor->x - (l ? l->scene->node.x : w->geom.x);
-       sy = cursor->y - (l ? l->scene->node.y : w->geom.y);
-   }
-
-   /* time is 0 in internal calls meant to restore pointer focus. */
-   if (time) {
-       wlr_relative_pointer_manager_v1_send_relative_motion(
-               relative_pointer_mgr, seat, (uint64_t)time * 1000,
-               dx, dy, dx_unaccel, dy_unaccel);
-
-       wl_list_for_each(constraint, &pointer_constraints->constraints, link)
-           cursorconstrain(constraint);
-
-       if (active_constraint && cursor_mode != CurResize && cursor_mode != CurMove) {
-           toplevel_from_wlr_surface(active_constraint->surface, &c, NULL);
-           if (c && active_constraint->surface == seat->pointer_state.focused_surface) {
-               sx = cursor->x - c->geom.x - c->bw;
-               sy = cursor->y - c->geom.y - c->bw;
-               if (wlr_region_confine(&active_constraint->region, sx, sy,
-                       sx + dx, sy + dy, &sx_confined, &sy_confined)) {
-                   dx = sx_confined - sx;
-                   dy = sy_confined - sy;
-               }
-
-               if (active_constraint->type == WLR_POINTER_CONSTRAINT_V1_LOCKED)
-                   return;
-           }
-       }
-
-       wlr_cursor_move(cursor, device, dx, dy);
-       wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
-
-       /* Update selmon (even while dragging a window) */
-       if (sloppyfocus)
-           selmon = xytomon(cursor->x, cursor->y);
-   }
-
-   /* Update drag icon's position */
-   wlr_scene_node_set_position(&drag_icon->node, (int)round(cursor->x), (int)round(cursor->y));
-
-   /* If we are currently grabbing the mouse, handle and return */
-   if (cursor_mode == CurMove) {
-       /* Move the grabbed client to the new position. */
-       resize(grabc, (struct wlr_box){.x = (int)round(cursor->x) - grabcx, .y = (int)round(cursor->y) - grabcy,
-           .width = grabc->geom.width, .height = grabc->geom.height}, 1);
-       return;
-   } else if (cursor_mode == CurResize) {
-       int cdx = (int)round(cursor->x) - grabcx;
-       int cdy = (int)round(cursor->y) - grabcy;
-
-       const struct wlr_box box = {
-           .x      = grabc->geom.x      + (rzcorner & 1 ? 0   :  cdx),
-           .y      = grabc->geom.y      + (rzcorner & 2 ? 0   :  cdy),
-           .width  = grabc->geom.width  + (rzcorner & 1 ? cdx : -cdx),
-           .height = grabc->geom.height + (rzcorner & 2 ? cdy : -cdy)
-       };
-       resize(grabc, box, 1);
-
-       if (!lock_cursor) {
-           grabcx += cdx;
-           grabcy += cdy;
-       } else {
-           wlr_cursor_warp_closest(cursor, NULL, grabcx, grabcy);
-       }
-
-       return;
-   }
-
-   /* If there's no client surface under the cursor, set the cursor image to a
-    * default. This is what makes the cursor image appear when you move it
-    * off of a client or over its border. */
-   if (!surface && !seat->drag)
-       wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
-
-   pointerfocus(c, surface, sx, sy, time);
-}
-
-void
-motionrelative(struct wl_listener *listener, void *data)
-{
-   /* This event is forwarded by the cursor when a pointer emits a _relative_
-    * pointer motion event (i.e. a delta) */
-   struct wlr_pointer_motion_event *event = data;
-   /* The cursor doesn't move unless we tell it to. The cursor automatically
-    * handles constraining the motion to the output layout, as well as any
-    * special configuration applied for the specific input device which
-    * generated the event. You can pass NULL for the device if you want to move
-    * the cursor around without any input. */
-   motionnotify(event->time_msec, &event->pointer->base, event->delta_x, event->delta_y,
-           event->unaccel_dx, event->unaccel_dy);
-}
-
-void
-moveresize(const Arg *arg)
-{
-   if (cursor_mode != CurNormal && cursor_mode != CurPressed)
-       return;
-   xytonode(cursor->x, cursor->y, NULL, &grabc, NULL, NULL, NULL);
-   if (!grabc || client_is_unmanaged(grabc) || grabc->isfullscreen)
-       return;
-
-   /* Float the window and tell motionnotify to grab it */
-   setfloating(grabc, 1);
-   switch (cursor_mode = arg->ui) {
-   case CurMove:
-       grabcx = (int)round(cursor->x) - grabc->geom.x;
-       grabcy = (int)round(cursor->y) - grabc->geom.y;
-       wlr_cursor_set_xcursor(cursor, cursor_mgr, "all-scroll");
-       break;
-   case CurResize:
-       const char *cursors[] = { "nw-resize", "ne-resize", "sw-resize", "se-resize" };
-
-       rzcorner = resize_corner;
-       grabcx = (int)round(cursor->x);
-       grabcy = (int)round(cursor->y);
-
-       if (rzcorner == 4)
-           /* identify the closest corner index */
-           rzcorner = (grabcx - grabc->geom.x < grabc->geom.x + grabc->geom.width  - grabcx ? 0 : 1)
-                    + (grabcy - grabc->geom.y < grabc->geom.y + grabc->geom.height - grabcy ? 0 : 2);
-
-       if (warp_cursor) {
-           grabcx = rzcorner & 1 ? grabc->geom.x + grabc->geom.width  : grabc->geom.x;
-           grabcy = rzcorner & 2 ? grabc->geom.y + grabc->geom.height : grabc->geom.y;
-           wlr_cursor_warp_closest(cursor, NULL, grabcx, grabcy);
-       }
-
-       wlr_cursor_set_xcursor(cursor, cursor_mgr, cursors[rzcorner]);
-       break;
-   }
-}
-
-void
-outputmgrapply(struct wl_listener *listener, void *data)
-{
-   struct wlr_output_configuration_v1 *config = data;
-   outputmgrapplyortest(config, 0);
-}
-
-void
-outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test)
-{
-   /*
-    * Called when a client such as wlr-randr requests a change in output
-    * configuration. This is only one way that the layout can be changed,
-    * so any Monitor information should be updated by updatemons() after an
-    * output_layout.change event, not here.
-    */
-   struct wlr_output_configuration_head_v1 *config_head;
-   int ok = 1;
-
-   wl_list_for_each(config_head, &config->heads, link) {
-       struct wlr_output *wlr_output = config_head->state.output;
-       Monitor *m = wlr_output->data;
-       struct wlr_output_state state;
-
-       /* Ensure displays previously disabled by wlr-output-power-management-v1
-        * are properly handled*/
-       m->asleep = 0;
-
-       wlr_output_state_init(&state);
-       wlr_output_state_set_enabled(&state, config_head->state.enabled);
-       if (!config_head->state.enabled)
-           goto apply_or_test;
-
-       if (config_head->state.mode)
-           wlr_output_state_set_mode(&state, config_head->state.mode);
-       else
-           wlr_output_state_set_custom_mode(&state,
-                   config_head->state.custom_mode.width,
-                   config_head->state.custom_mode.height,
-                   config_head->state.custom_mode.refresh);
-
-       wlr_output_state_set_transform(&state, config_head->state.transform);
-       wlr_output_state_set_scale(&state, config_head->state.scale);
-       wlr_output_state_set_adaptive_sync_enabled(&state,
-               config_head->state.adaptive_sync_enabled);
-
-apply_or_test:
-       ok &= test ? wlr_output_test_state(wlr_output, &state)
-               : wlr_output_commit_state(wlr_output, &state);
-
-       /* Don't move monitors if position wouldn't change. This avoids
-        * wlroots marking the output as manually configured.
-        * wlr_output_layout_add does not like disabled outputs */
-       if (!test && wlr_output->enabled && (m->m.x != config_head->state.x || m->m.y != config_head->state.y))
-           wlr_output_layout_add(output_layout, wlr_output,
-                   config_head->state.x, config_head->state.y);
-
-       wlr_output_state_finish(&state);
-   }
-
-   if (ok)
-       wlr_output_configuration_v1_send_succeeded(config);
-   else
-       wlr_output_configuration_v1_send_failed(config);
-   wlr_output_configuration_v1_destroy(config);
-
-   /* https://codeberg.org/dwl/dwl/issues/577 */
-   updatemons(NULL, NULL);
-}
-
-void
-outputmgrtest(struct wl_listener *listener, void *data)
-{
-   struct wlr_output_configuration_v1 *config = data;
-   outputmgrapplyortest(config, 1);
-}
-
-void
-pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
-       uint32_t time)
-{
-   struct timespec now;
-
-   if (surface != seat->pointer_state.focused_surface &&
-           sloppyfocus && time && c && !client_is_unmanaged(c))
-       focusclient(c, 0);
-
-   /* If surface is NULL, clear pointer focus */
-   if (!surface) {
-       wlr_seat_pointer_notify_clear_focus(seat);
-       return;
-   }
-
-   if (!time) {
-       clock_gettime(CLOCK_MONOTONIC, &now);
-       time = now.tv_sec * 1000 + now.tv_nsec / 1000000;
-   }
-
-   /* Let the client know that the mouse cursor has entered one
-    * of its surfaces, and make keyboard focus follow if desired.
-    * wlroots makes this a no-op if surface is already focused */
-   wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
-   wlr_seat_pointer_notify_motion(seat, time, sx, sy);
-}
-
-void
-powermgrsetmode(struct wl_listener *listener, void *data)
-{
-   struct wlr_output_power_v1_set_mode_event *event = data;
-   struct wlr_output_state state = {0};
-   Monitor *m = event->output->data;
-
-   if (!m)
-       return;
-
-   m->gamma_lut_changed = 1; /* Reapply gamma LUT when re-enabling the ouput */
-   wlr_output_state_set_enabled(&state, event->mode);
-   wlr_output_commit_state(m->wlr_output, &state);
-
-   m->asleep = !event->mode;
-   updatemons(NULL, NULL);
-}
-
-void
-quit(const Arg *arg)
-{
-   wl_display_terminate(dpy);
-}
-
-void
-reload_colors(const Arg *arg)
-{
-    FILE *f = fopen(colors_dir, "r");
-    if (!f) {
-        return;
-    }
-
-    for (int i = 0; i < (int)LENGTH(colors); i++) {
-        unsigned int fg, bg, border;
-        if (fscanf(f, "%x %x %x", &fg, &bg, &border) != 3) {
-            break;
-        }
-        colors[i][ColFg] = fg;
-        colors[i][ColBg] = bg;
-        colors[i][ColBorder] = border;
-    }
-
-    fclose(f);
-    drawbars();
-}
-
-void
-rendermon(struct wl_listener *listener, void *data)
-{
-   /* This function is called every time an output is ready to display a frame,
-    * generally at the output's refresh rate (e.g. 60Hz). */
-   Monitor *m = wl_container_of(listener, m, frame);
-   Client *c;
-   struct wlr_output_state pending = {0};
-   struct timespec now;
-
-   /* Render if no XDG clients have an outstanding resize and are visible on
-    * this monitor. */
-   wl_list_for_each(c, &clients, link) {
-       if (c->resize && !c->isfloating && client_is_rendered_on_mon(c, m) && !client_is_stopped(c))
-           goto skip;
-   }
-
-   wlr_scene_output_commit(m->scene_output, NULL);
-
-skip:
-   /* Let clients know a frame has been rendered */
-   clock_gettime(CLOCK_MONOTONIC, &now);
-   wlr_scene_output_send_frame_done(m->scene_output, &now);
-   wlr_output_state_finish(&pending);
-}
-
-void
-requestdecorationmode(struct wl_listener *listener, void *data)
-{
-   Client *c = wl_container_of(listener, c, set_decoration_mode);
-   if (c->surface.xdg->initialized)
-       wlr_xdg_toplevel_decoration_v1_set_mode(c->decoration,
-               WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
-}
-
-void
-requeststartdrag(struct wl_listener *listener, void *data)
-{
-   struct wlr_seat_request_start_drag_event *event = data;
-
-   if (wlr_seat_validate_pointer_grab_serial(seat, event->origin,
-           event->serial))
-       wlr_seat_start_pointer_drag(seat, event->drag, event->serial);
-   else
-       wlr_data_source_destroy(event->drag->source);
-}
-
-void
-requestmonstate(struct wl_listener *listener, void *data)
-{
-   struct wlr_output_event_request_state *event = data;
-   wlr_output_commit_state(event->output, event->state);
-   updatemons(NULL, NULL);
-}
-
-void
-resize(Client *c, struct wlr_box geo, int interact)
-{
-   struct wlr_box *bbox;
-   struct wlr_box clip;
-
-   if (!c->mon || !client_surface(c)->mapped)
-       return;
-
-   bbox = interact ? &sgeom : &c->mon->w;
-
-   client_set_bounds(c, geo.width, geo.height);
-   c->geom = geo;
-   applybounds(c, bbox);
-
-   /* Update scene-graph, including borders */
-   wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
-   wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw);
-   wlr_scene_rect_set_size(c->border[0], c->geom.width, c->bw);
-   wlr_scene_rect_set_size(c->border[1], c->geom.width, c->bw);
-   wlr_scene_rect_set_size(c->border[2], c->bw, c->geom.height - 2 * c->bw);
-   wlr_scene_rect_set_size(c->border[3], c->bw, c->geom.height - 2 * c->bw);
-   wlr_scene_node_set_position(&c->border[1]->node, 0, c->geom.height - c->bw);
-   wlr_scene_node_set_position(&c->border[2]->node, 0, c->bw);
-   wlr_scene_node_set_position(&c->border[3]->node, c->geom.width - c->bw, c->bw);
-
-   /* this is a no-op if size hasn't changed */
-   c->resize = client_set_size(c, c->geom.width - 2 * c->bw,
-           c->geom.height - 2 * c->bw);
-   client_get_clip(c, &clip);
-   wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip);
-}
-
-void
-run(char *startup_cmd)
-{
-   /* Add a Unix socket to the Wayland display. */
-   const char *socket = wl_display_add_socket_auto(dpy);
-   if (!socket)
-       die("startup: display_add_socket_auto");
-   setenv("WAYLAND_DISPLAY", socket, 1);
-
-   /* Start the backend. This will enumerate outputs and inputs, become the DRM
-    * master, etc */
-   if (!wlr_backend_start(backend))
-       die("startup: backend_start");
-
-   /* Now that the socket exists and the backend is started, run the startup command */
-   if (startup_cmd) {
-       if ((child_pid = fork()) < 0)
-           die("startup: fork:");
-       if (child_pid == 0) {
-           close(STDIN_FILENO);
-           setsid();
-           execl("/bin/sh", "/bin/sh", "-c", startup_cmd, NULL);
-           die("startup: execl:");
-       }
-   }
-
-   /* Mark stdout as non-blocking to avoid the startup script
-    * causing dwl to freeze when a user neither closes stdin
-    * nor consumes standard input in his startup script */
-
-   if (fd_set_nonblock(STDOUT_FILENO) < 0)
-       close(STDOUT_FILENO);
-
-   drawbars();
-
-   /* At this point the outputs are initialized, choose initial selmon based on
-    * cursor position, and set default cursor image */
-   selmon = xytomon(cursor->x, cursor->y);
-
-   /* TODO hack to get cursor to display in its initial location (100, 100)
-    * instead of (0, 0) and then jumping. Still may not be fully
-    * initialized, as the image/coordinates are not transformed for the
-    * monitor when displayed here */
-   wlr_cursor_warp_closest(cursor, NULL, cursor->x, cursor->y);
-   wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
-
-   /* Run the Wayland event loop. This does not return until you exit the
-    * compositor. Starting the backend rigged up all of the necessary event
-    * loop configuration to listen to libinput events, DRM events, generate
-    * frame events at the refresh rate, and so on. */
-   wl_display_run(dpy);
-}
-
-void
-setcursor(struct wl_listener *listener, void *data)
-{
-   /* This event is raised by the seat when a client provides a cursor image */
-   struct wlr_seat_pointer_request_set_cursor_event *event = data;
-   /* If we're "grabbing" the cursor, don't use the client's image, we will
-    * restore it after "grabbing" sending a leave event, followed by a enter
-    * event, which will result in the client requesting set the cursor surface */
-   if (cursor_mode != CurNormal && cursor_mode != CurPressed)
-       return;
-   /* This can be sent by any client, so we check to make sure this one
-    * actually has pointer focus first. If so, we can tell the cursor to
-    * use the provided surface as the cursor image. It will set the
-    * hardware cursor on the output that it's currently on and continue to
-    * do so as the cursor moves between outputs. */
-   if (event->seat_client == seat->pointer_state.focused_client)
-       wlr_cursor_set_surface(cursor, event->surface,
-               event->hotspot_x, event->hotspot_y);
-}
-
-void
-setcursorshape(struct wl_listener *listener, void *data)
-{
-   struct wlr_cursor_shape_manager_v1_request_set_shape_event *event = data;
-   if (cursor_mode != CurNormal && cursor_mode != CurPressed)
-       return;
-   /* This can be sent by any client, so we check to make sure this one
-    * actually has pointer focus first. If so, we can tell the cursor to
-    * use the provided cursor shape. */
-   if (event->seat_client == seat->pointer_state.focused_client)
-       wlr_cursor_set_xcursor(cursor, cursor_mgr,
-               wlr_cursor_shape_v1_name(event->shape));
-}
-
-void
-setfloating(Client *c, int floating)
-{
-   Client *p = client_get_parent(c);
-   c->isfloating = floating;
-   /* If in floating layout do not change the client's layer */
-   if (!c->mon || !client_surface(c)->mapped || !c->mon->lt[c->mon->sellt]->arrange)
-       return;
-   wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen ||
-           (p && p->isfullscreen) ? LyrFS
-           : c->isfloating ? LyrFloat : LyrTile]);
-   arrange(c->mon);
-   drawbars();
-}
-
-void
-setfullscreen(Client *c, int fullscreen)
-{
-   c->isfullscreen = fullscreen;
-   if (!c->mon || !client_surface(c)->mapped)
-       return;
-   c->bw = fullscreen ? 0 : borderpx;
-   client_set_fullscreen(c, fullscreen);
-   wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen
-           ? LyrFS : c->isfloating ? LyrFloat : LyrTile]);
-
-   if (fullscreen) {
-       c->prev = c->geom;
-       resize(c, c->mon->m, 0);
-   } else {
-       /* restore previous size instead of arrange for floating windows since
-        * client positions are set by the user and cannot be recalculated */
-       resize(c, c->prev, 0);
-   }
-   arrange(c->mon);
-   drawbars();
-}
-
-void
-setlayout(const Arg *arg)
-{
-   if (!selmon)
-       return;
-   if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
-       selmon->sellt ^= 1;
-   if (arg && arg->v)
-       selmon->lt[selmon->sellt] = (Layout *)arg->v;
-   strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof(selmon->ltsymbol));
-   arrange(selmon);
-   Monitor *m;
-   wl_list_for_each(m, &mons, link) {
-       drawbar(m);
-   }
-
-}
-
-/* arg > 1.0 will set mfact absolutely */
-void
-setmfact(const Arg *arg)
-{
-   float f;
-
-   if (!arg || !selmon || !selmon->lt[selmon->sellt]->arrange)
-       return;
-   f = arg->f < 1.0f ? arg->f + selmon->mfact : arg->f - 1.0f;
-   if (f < 0.1 || f > 0.9)
-       return;
-   selmon->mfact = f;
-   arrange(selmon);
-}
-
-void
-setmon(Client *c, Monitor *m, uint32_t newtags)
-{
-   Monitor *oldmon = c->mon;
-
-   if (oldmon == m)
-       return;
-   c->mon = m;
-   c->prev = c->geom;
-
-   /* Scene graph sends surface leave/enter events on move and resize */
-   if (oldmon)
-       arrange(oldmon);
-   if (m) {
-       /* Make sure window actually overlaps with the monitor */
-       resize(c, c->geom, 0);
-       c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
-       setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
-       setfloating(c, c->isfloating);
-   }
-   focusclient(focustop(selmon), 1);
-}
-
-void
-setpsel(struct wl_listener *listener, void *data)
-{
-   /* This event is raised by the seat when a client wants to set the selection,
-    * usually when the user copies something. wlroots allows compositors to
-    * ignore such requests if they so choose, but in dwl we always honor them
-    */
-   struct wlr_seat_request_set_primary_selection_event *event = data;
-   wlr_seat_set_primary_selection(seat, event->source, event->serial);
-}
-
-void
-setsel(struct wl_listener *listener, void *data)
-{
-   /* This event is raised by the seat when a client wants to set the selection,
-    * usually when the user copies something. wlroots allows compositors to
-    * ignore such requests if they so choose, but in dwl we always honor them
-    */
-   struct wlr_seat_request_set_selection_event *event = data;
-   wlr_seat_set_selection(seat, event->source, event->serial);
-}
-
-void
-setup(void)
-{
-   int drm_fd, i, sig[] = {SIGCHLD, SIGINT, SIGTERM, SIGPIPE};
-   struct sigaction sa = {.sa_flags = SA_RESTART, .sa_handler = handlesig};
-   sigemptyset(&sa.sa_mask);
-
-   for (i = 0; i < (int)LENGTH(sig); i++)
-       sigaction(sig[i], &sa, NULL);
-
-
-   wlr_log_init(log_level, NULL);
-
-   /* The Wayland display is managed by libwayland. It handles accepting
-    * clients from the Unix socket, manging Wayland globals, and so on. */
-   dpy = wl_display_create();
-   event_loop = wl_display_get_event_loop(dpy);
-
-   /* The backend is a wlroots feature which abstracts the underlying input and
-    * output hardware. The autocreate option will choose the most suitable
-    * backend based on the current environment, such as opening an X11 window
-    * if an X11 server is running. */
-   if (!(backend = wlr_backend_autocreate(event_loop, &session)))
-       die("couldn't create backend");
-
-   /* Initialize the scene graph used to lay out windows */
-   scene = wlr_scene_create();
-   root_bg = wlr_scene_rect_create(&scene->tree, 0, 0, rootcolor);
-   for (i = 0; i < NUM_LAYERS; i++)
-       layers[i] = wlr_scene_tree_create(&scene->tree);
-   drag_icon = wlr_scene_tree_create(&scene->tree);
-   wlr_scene_node_place_below(&drag_icon->node, &layers[LyrBlock]->node);
-
-   /* Autocreates a renderer, either Pixman, GLES2 or Vulkan for us. The user
-    * can also specify a renderer using the WLR_RENDERER env var.
-    * The renderer is responsible for defining the various pixel formats it
-    * supports for shared memory, this configures that for clients. */
-   if (!(drw = wlr_renderer_autocreate(backend)))
-       die("couldn't create renderer");
-   wl_signal_add(&drw->events.lost, &gpu_reset);
-
-   /* Create shm, drm and linux_dmabuf interfaces by ourselves.
-    * The simplest way is to call:
-    *      wlr_renderer_init_wl_display(drw);
-    * but we need to create the linux_dmabuf interface manually to integrate it
-    * with wlr_scene. */
-   wlr_renderer_init_wl_shm(drw, dpy);
-
-   if (wlr_renderer_get_texture_formats(drw, WLR_BUFFER_CAP_DMABUF)) {
-       wlr_drm_create(dpy, drw);
-       wlr_scene_set_linux_dmabuf_v1(scene,
-               wlr_linux_dmabuf_v1_create_with_renderer(dpy, 5, drw));
-   }
-
-   if ((drm_fd = wlr_renderer_get_drm_fd(drw)) >= 0 && drw->features.timeline
-           && backend->features.timeline)
-       wlr_linux_drm_syncobj_manager_v1_create(dpy, 1, drm_fd);
-
-   /* Autocreates an allocator for us.
-    * The allocator is the bridge between the renderer and the backend. It
-    * handles the buffer creation, allowing wlroots to render onto the
-    * screen */
-   if (!(alloc = wlr_allocator_autocreate(backend, drw)))
-       die("couldn't create allocator");
-
-   /* This creates some hands-off wlroots interfaces. The compositor is
-    * necessary for clients to allocate surfaces and the data device manager
-    * handles the clipboard. Each of these wlroots interfaces has room for you
-    * to dig your fingers in and play with their behavior if you want. Note that
-    * the clients cannot set the selection directly without compositor approval,
-    * see the setsel() function. */
-   compositor = wlr_compositor_create(dpy, 6, drw);
-   wlr_subcompositor_create(dpy);
-   wlr_data_device_manager_create(dpy);
-   wlr_export_dmabuf_manager_v1_create(dpy);
-   wlr_screencopy_manager_v1_create(dpy);
-   wlr_data_control_manager_v1_create(dpy);
-   wlr_primary_selection_v1_device_manager_create(dpy);
-   wlr_viewporter_create(dpy);
-   wlr_single_pixel_buffer_manager_v1_create(dpy);
-   wlr_fractional_scale_manager_v1_create(dpy, 1);
-   wlr_presentation_create(dpy, backend, 2);
-   wlr_alpha_modifier_v1_create(dpy);
-
-   /* Initializes the interface used to implement urgency hints */
-   activation = wlr_xdg_activation_v1_create(dpy);
-   wl_signal_add(&activation->events.request_activate, &request_activate);
-
-   wlr_scene_set_gamma_control_manager_v1(scene, wlr_gamma_control_manager_v1_create(dpy));
-
-   power_mgr = wlr_output_power_manager_v1_create(dpy);
-   wl_signal_add(&power_mgr->events.set_mode, &output_power_mgr_set_mode);
-
-   /* Creates an output layout, which is a wlroots utility for working with an
-    * arrangement of screens in a physical layout. */
-   output_layout = wlr_output_layout_create(dpy);
-   wl_signal_add(&output_layout->events.change, &layout_change);
-
-    wlr_xdg_output_manager_v1_create(dpy, output_layout);
-
-   /* Configure a listener to be notified when new outputs are available on the
-    * backend. */
-   wl_list_init(&mons);
-   wl_signal_add(&backend->events.new_output, &new_output);
-
-   /* Set up our client lists, the xdg-shell and the layer-shell. The xdg-shell is a
-    * Wayland protocol which is used for application windows. For more
-    * detail on shells, refer to the article:
-    *
-    * https://drewdevault.com/2018/07/29/Wayland-shells.html
-    */
-   wl_list_init(&clients);
-   wl_list_init(&fstack);
-
-   xdg_shell = wlr_xdg_shell_create(dpy, 6);
-   wl_signal_add(&xdg_shell->events.new_toplevel, &new_xdg_toplevel);
-   wl_signal_add(&xdg_shell->events.new_popup, &new_xdg_popup);
-
-   layer_shell = wlr_layer_shell_v1_create(dpy, 3);
-   wl_signal_add(&layer_shell->events.new_surface, &new_layer_surface);
-
-   idle_notifier = wlr_idle_notifier_v1_create(dpy);
-
-   idle_inhibit_mgr = wlr_idle_inhibit_v1_create(dpy);
-   wl_signal_add(&idle_inhibit_mgr->events.new_inhibitor, &new_idle_inhibitor);
-
-   session_lock_mgr = wlr_session_lock_manager_v1_create(dpy);
-   wl_signal_add(&session_lock_mgr->events.new_lock, &new_session_lock);
-   locked_bg = wlr_scene_rect_create(layers[LyrBlock], sgeom.width, sgeom.height,
-           (float [4]){0.1f, 0.1f, 0.1f, 1.0f});
-   wlr_scene_node_set_enabled(&locked_bg->node, 0);
-
-   /* Use decoration protocols to negotiate server-side decorations */
-   wlr_server_decoration_manager_set_default_mode(
-           wlr_server_decoration_manager_create(dpy),
-           WLR_SERVER_DECORATION_MANAGER_MODE_SERVER);
-   xdg_decoration_mgr = wlr_xdg_decoration_manager_v1_create(dpy);
-   wl_signal_add(&xdg_decoration_mgr->events.new_toplevel_decoration, &new_xdg_decoration);
-
-   pointer_constraints = wlr_pointer_constraints_v1_create(dpy);
-   wl_signal_add(&pointer_constraints->events.new_constraint, &new_pointer_constraint);
-
-   relative_pointer_mgr = wlr_relative_pointer_manager_v1_create(dpy);
-
-   /*
-    * Creates a cursor, which is a wlroots utility for tracking the cursor
-    * image shown on screen.
-    */
-   cursor = wlr_cursor_create();
-   wlr_cursor_attach_output_layout(cursor, output_layout);
-
-   /* Creates an xcursor manager, another wlroots utility which loads up
-    * Xcursor themes to source cursor images from and makes sure that cursor
-    * images are available at all scale factors on the screen (necessary for
-    * HiDPI support). Scaled cursors will be loaded with each output. */
-   cursor_mgr = wlr_xcursor_manager_create(NULL, 24);
-   setenv("XCURSOR_SIZE", "24", 1);
-
-   /*
-    * wlr_cursor *only* displays an image on screen. It does not move around
-    * when the pointer moves. However, we can attach input devices to it, and
-    * it will generate aggregate events for all of them. In these events, we
-    * can choose how we want to process them, forwarding them to clients and
-    * moving the cursor around. More detail on this process is described in
-    * https://drewdevault.com/2018/07/17/Input-handling-in-wlroots.html
-    *
-    * And more comments are sprinkled throughout the notify functions above.
-    */
-   wl_signal_add(&cursor->events.motion, &cursor_motion);
-   wl_signal_add(&cursor->events.motion_absolute, &cursor_motion_absolute);
-   wl_signal_add(&cursor->events.button, &cursor_button);
-   wl_signal_add(&cursor->events.axis, &cursor_axis);
-   wl_signal_add(&cursor->events.frame, &cursor_frame);
-
-   cursor_shape_mgr = wlr_cursor_shape_manager_v1_create(dpy, 1);
-   wl_signal_add(&cursor_shape_mgr->events.request_set_shape, &request_set_cursor_shape);
-
-   /*
-    * Configures a seat, which is a single "seat" at which a user sits and
-    * operates the computer. This conceptually includes up to one keyboard,
-    * pointer, touch, and drawing tablet device. We also rig up a listener to
-    * let us know when new input devices are available on the backend.
-    */
-   wl_signal_add(&backend->events.new_input, &new_input_device);
-   virtual_keyboard_mgr = wlr_virtual_keyboard_manager_v1_create(dpy);
-   wl_signal_add(&virtual_keyboard_mgr->events.new_virtual_keyboard,
-           &new_virtual_keyboard);
-   virtual_pointer_mgr = wlr_virtual_pointer_manager_v1_create(dpy);
-    wl_signal_add(&virtual_pointer_mgr->events.new_virtual_pointer,
-            &new_virtual_pointer);
-
-   seat = wlr_seat_create(dpy, "seat0");
-   wl_signal_add(&seat->events.request_set_cursor, &request_cursor);
-   wl_signal_add(&seat->events.request_set_selection, &request_set_sel);
-   wl_signal_add(&seat->events.request_set_primary_selection, &request_set_psel);
-   wl_signal_add(&seat->events.request_start_drag, &request_start_drag);
-   wl_signal_add(&seat->events.start_drag, &start_drag);
-
-   kb_group = createkeyboardgroup();
-   wl_list_init(&kb_group->destroy.link);
-
-   output_mgr = wlr_output_manager_v1_create(dpy);
-   wl_signal_add(&output_mgr->events.apply, &output_mgr_apply);
-   wl_signal_add(&output_mgr->events.test, &output_mgr_test);
-
-   drwl_init();
-
-   status_event_source = wl_event_loop_add_fd(wl_display_get_event_loop(dpy),
-       STDIN_FILENO, WL_EVENT_READABLE, statusin, NULL);
-
-   /* Make sure XWayland clients don't connect to the parent X server,
-    * e.g when running in the x11 backend or the wayland backend and the
-    * compositor has Xwayland support */
-   unsetenv("DISPLAY");
-#ifdef XWAYLAND
-   /*
-    * Initialise the XWayland X server.
-    * It will be started when the first X client is started.
-    */
-   if ((xwayland = wlr_xwayland_create(dpy, compositor, 1))) {
-       wl_signal_add(&xwayland->events.ready, &xwayland_ready);
-       wl_signal_add(&xwayland->events.new_surface, &new_xwayland_surface);
-
-       setenv("DISPLAY", xwayland->display_name, 1);
-   } else {
-       fprintf(stderr, "failed to setup XWayland X server, continuing without it\n");
-   }
-#endif
-}
-
-void
-spawn(const Arg *arg)
-{
-   if (fork() == 0) {
-       close(STDIN_FILENO);
-       dup2(STDERR_FILENO, STDOUT_FILENO);
-       setsid();
-       execvp(((char **)arg->v)[0], (char **)arg->v);
-       die("dwl: execvp %s failed:", ((char **)arg->v)[0]);
-   }
-}
-
-void
-startdrag(struct wl_listener *listener, void *data)
-{
-   struct wlr_drag *drag = data;
-   if (!drag->icon)
-       return;
-
-   drag->icon->data = &wlr_scene_drag_icon_create(drag_icon, drag->icon)->node;
-   LISTEN_STATIC(&drag->icon->events.destroy, destroydragicon);
-}
-
-int
-statusin(int fd, unsigned int mask, void *data)
-{
-   char status[256];
-   ssize_t n;
-
-   if (mask & WL_EVENT_ERROR)
-       die("status in event error");
-   if (mask & WL_EVENT_HANGUP)
-       wl_event_source_remove(status_event_source);
-
-   n = read(fd, status, sizeof(status) - 1);
-   if (n < 0 && errno != EWOULDBLOCK)
-       die("read:");
-
-   status[n] = '\0';
-   status[strcspn(status, "\n")] = '\0';
-
-   strncpy(stext, status, sizeof(stext));
-   drawbars();
-
-   return 0;
-}
-
-void
-tag(const Arg *arg)
-{
-   Client *sel = focustop(selmon);
-   if (!sel || (arg->ui & TAGMASK) == 0)
-       return;
-
-   sel->tags = arg->ui & TAGMASK;
-   focusclient(focustop(selmon), 1);
-   arrange(selmon);
-   drawbars();
-}
-
-void
-tagmon(const Arg *arg)
-{
-   Client *sel = focustop(selmon);
-   if (sel)
-       setmon(sel, dirtomon(arg->i), 0);
-}
-
-void
-tile(Monitor *m)
-{
-   unsigned int h, r, e = m->gaps, mw, my, ty;
-   int i, n = 0;
-   Client *c;
-
-   wl_list_for_each(c, &clients, link)
-       if (VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen)
-           n++;
-   if (n == 0)
-       return;
-   if (smartgaps == n)
-       e = 0;
-
-   if (n > m->nmaster)
-       mw = m->nmaster ? (int)roundf((m->w.width + gappx*e) * m->mfact) : 0;
-   else
-       mw = m->w.width;
-   i = 0;
-   my = ty = gappx*e;
-   wl_list_for_each(c, &clients, link) {
-       if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
-           continue;
-       if (i < m->nmaster) {
-           r = MIN(n, m->nmaster) - i;
-           h = (m->w.height - my - gappx*e - gappx*e * (r - 1)) / r;
-           resize(c, (struct wlr_box){.x = m->w.x + gappx*e, .y = m->w.y + my,
-               .width = mw - 2*gappx*e, .height = h}, 0);
-           my += c->geom.height + gappx*e;
-       } else {
-           r = n - i;
-           h = (m->w.height - ty - gappx*e - gappx*e * (r - 1)) / r;
-           resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty,
-               .width = m->w.width - mw - gappx*e, .height = h}, 0);
-           ty += c->geom.height + gappx*e;
-       }
-       i++;
-   }
-}
-
-void
-togglebar(const Arg *arg)
-{
-   wlr_scene_node_set_enabled(&selmon->scene_buffer->node,
-       !selmon->scene_buffer->node.enabled);
-   arrangelayers(selmon);
-}
-
-void
-togglefloating(const Arg *arg)
-{
-   Client *sel = focustop(selmon);
-   /* return if fullscreen */
-   if (sel && !sel->isfullscreen)
-       setfloating(sel, !sel->isfloating);
-}
-
-void
-togglefullscreen(const Arg *arg)
-{
-   Client *sel = focustop(selmon);
-   if (sel)
-       setfullscreen(sel, !sel->isfullscreen);
-}
-
-void
-togglegaps(const Arg *arg)
-{
-   selmon->gaps = !selmon->gaps;
-   arrange(selmon);
-}
-
-void
-toggletag(const Arg *arg)
-{
-   uint32_t newtags;
-   Client *sel = focustop(selmon);
-   if (!sel || !(newtags = sel->tags ^ (arg->ui & TAGMASK)))
-       return;
-
-   sel->tags = newtags;
-   focusclient(focustop(selmon), 1);
-   arrange(selmon);
-   drawbars();
-}
-
-void
-toggleview(const Arg *arg)
-{
-   uint32_t newtagset;
-   if (!(newtagset = selmon ? selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK) : 0))
-       return;
-
-   selmon->tagset[selmon->seltags] = newtagset;
-   focusclient(focustop(selmon), 1);
-   arrange(selmon);
-   drawbars();
-}
-
-void
-unlocksession(struct wl_listener *listener, void *data)
-{
-   SessionLock *lock = wl_container_of(listener, lock, unlock);
-   destroylock(lock, 1);
-}
-
-void
-unmaplayersurfacenotify(struct wl_listener *listener, void *data)
-{
-   LayerSurface *l = wl_container_of(listener, l, unmap);
-
-   l->mapped = 0;
-   wlr_scene_node_set_enabled(&l->scene->node, 0);
-   if (l == exclusive_focus)
-       exclusive_focus = NULL;
-   if (l->layer_surface->output && (l->mon = l->layer_surface->output->data))
-       arrangelayers(l->mon);
-   if (l->layer_surface->surface == seat->keyboard_state.focused_surface)
-       focusclient(focustop(selmon), 1);
-   motionnotify(0, NULL, 0, 0, 0, 0);
-}
-
-void
-unmapnotify(struct wl_listener *listener, void *data)
-{
-   /* Called when the surface is unmapped, and should no longer be shown. */
-   Client *c = wl_container_of(listener, c, unmap);
-   if (c == grabc) {
-       cursor_mode = CurNormal;
-       grabc = NULL;
-   }
-
-   if (client_is_unmanaged(c)) {
-       if (c == exclusive_focus) {
-           exclusive_focus = NULL;
-           focusclient(focustop(selmon), 1);
-       }
-   } else {
-       wl_list_remove(&c->link);
-       setmon(c, NULL, 0);
-       wl_list_remove(&c->flink);
-   }
-
-   wlr_scene_node_destroy(&c->scene->node);
-   drawbars();
-   motionnotify(0, NULL, 0, 0, 0, 0);
-}
-
-void
-updatemons(struct wl_listener *listener, void *data)
-{
-   /*
-    * Called whenever the output layout changes: adding or removing a
-    * monitor, changing an output's mode or position, etc. This is where
-    * the change officially happens and we update geometry, window
-    * positions, focus, and the stored configuration in wlroots'
-    * output-manager implementation.
-    */
-   struct wlr_output_configuration_v1 *config
-           = wlr_output_configuration_v1_create();
-   Client *c;
-   struct wlr_output_configuration_head_v1 *config_head;
-   Monitor *m;
-
-   /* First remove from the layout the disabled monitors */
-   wl_list_for_each(m, &mons, link) {
-       if (m->wlr_output->enabled || m->asleep)
-           continue;
-       config_head = wlr_output_configuration_head_v1_create(config, m->wlr_output);
-       config_head->state.enabled = 0;
-       /* Remove this output from the layout to avoid cursor enter inside it */
-       wlr_output_layout_remove(output_layout, m->wlr_output);
-       closemon(m);
-       m->m = m->w = (struct wlr_box){0};
-   }
-   /* Insert outputs that need to */
-   wl_list_for_each(m, &mons, link) {
-       if (m->wlr_output->enabled
-               && !wlr_output_layout_get(output_layout, m->wlr_output))
-           wlr_output_layout_add_auto(output_layout, m->wlr_output);
-   }
-
-   /* Now that we update the output layout we can get its box */
-   wlr_output_layout_get_box(output_layout, NULL, &sgeom);
-
-   wlr_scene_node_set_position(&root_bg->node, sgeom.x, sgeom.y);
-   wlr_scene_rect_set_size(root_bg, sgeom.width, sgeom.height);
-
-   /* Make sure the clients are hidden when dwl is locked */
-   wlr_scene_node_set_position(&locked_bg->node, sgeom.x, sgeom.y);
-   wlr_scene_rect_set_size(locked_bg, sgeom.width, sgeom.height);
-
-   wl_list_for_each(m, &mons, link) {
-       if (!m->wlr_output->enabled)
-           continue;
-       config_head = wlr_output_configuration_head_v1_create(config, m->wlr_output);
-
-       /* Get the effective monitor geometry to use for surfaces */
-       wlr_output_layout_get_box(output_layout, m->wlr_output, &m->m);
-       m->w = m->m;
-       wlr_scene_output_set_position(m->scene_output, m->m.x, m->m.y);
-
-       wlr_scene_node_set_position(&m->fullscreen_bg->node, m->m.x, m->m.y);
-       wlr_scene_rect_set_size(m->fullscreen_bg, m->m.width, m->m.height);
-
-       if (m->lock_surface) {
-           struct wlr_scene_tree *scene_tree = m->lock_surface->surface->data;
-           wlr_scene_node_set_position(&scene_tree->node, m->m.x, m->m.y);
-           wlr_session_lock_surface_v1_configure(m->lock_surface, m->m.width, m->m.height);
-       }
-
-       /* Calculate the effective monitor geometry to use for clients */
-       arrangelayers(m);
-       /* Don't move clients to the left output when plugging monitors */
-       arrange(m);
-       /* make sure fullscreen clients have the right size */
-       if ((c = focustop(m)) && c->isfullscreen)
-           resize(c, m->m, 0);
-
-       /* Try to re-set the gamma LUT when updating monitors,
-        * it's only really needed when enabling a disabled output, but meh. */
-       m->gamma_lut_changed = 1;
-
-       config_head->state.x = m->m.x;
-       config_head->state.y = m->m.y;
-
-       if (!selmon) {
-           selmon = m;
-       }
-   }
-
-   if (selmon && selmon->wlr_output->enabled) {
-       wl_list_for_each(c, &clients, link) {
-           if (!c->mon && client_surface(c)->mapped)
-               setmon(c, selmon, c->tags);
-       }
-       focusclient(focustop(selmon), 1);
-       if (selmon->lock_surface) {
-           client_notify_enter(selmon->lock_surface->surface,
-                   wlr_seat_get_keyboard(seat));
-           client_activate_surface(selmon->lock_surface->surface, 1);
-       }
-   }
-
-   if (stext[0] == '\0')
-       strncpy(stext, "dwl-"VERSION, sizeof(stext));
-   wl_list_for_each(m, &mons, link) {
-       updatebar(m);
-       drawbar(m);
-   }
-
-   /* FIXME: figure out why the cursor image is at 0,0 after turning all
-    * the monitors on.
-    * Move the cursor image where it used to be. It does not generate a
-    * wl_pointer.motion event for the clients, it's only the image what it's
-    * at the wrong position after all. */
-   wlr_cursor_move(cursor, NULL, 0, 0);
-
-   wlr_output_manager_v1_set_configuration(output_mgr, config);
-}
-
-void
-updatebar(Monitor *m)
-{
-   size_t i;
-   int rw, rh;
-   char fontattrs[12];
-
-   wlr_output_transformed_resolution(m->wlr_output, &rw, &rh);
-   m->b.width = rw;
-   m->b.real_width = (int)((float)m->b.width / m->wlr_output->scale);
-
-   wlr_scene_node_set_enabled(&m->scene_buffer->node, m->wlr_output->enabled ? showbar : 0);
-
-   for (i = 0; i < LENGTH(m->pool); i++)
-       if (m->pool[i]) {
-           wlr_buffer_drop(&m->pool[i]->base);
-           m->pool[i] = NULL;
-       }
-
-   if (m->b.scale == m->wlr_output->scale && m->drw)
-       return;
-
-   drwl_font_destroy(m->drw->font);
-   snprintf(fontattrs, sizeof(fontattrs), "dpi=%.2f", 96. * m->wlr_output->scale);
-   if (!(drwl_font_create(m->drw, LENGTH(fonts), fonts, fontattrs)))
-       die("Could not load font");
-
-   m->b.scale = m->wlr_output->scale;
-   m->lrpad = m->drw->font->height;
-   m->b.height = m->drw->font->height + 13;
-   m->b.real_height = (int)((float)m->b.height / m->wlr_output->scale);
-
-}
-
-void
-updatetitle(struct wl_listener *listener, void *data)
-{
-   Client *c = wl_container_of(listener, c, set_title);
-   if (c == focustop(c->mon))
-       drawbars();
-}
-
-void
-urgent(struct wl_listener *listener, void *data)
-{
-   struct wlr_xdg_activation_v1_request_activate_event *event = data;
-   Client *c = NULL;
-   toplevel_from_wlr_surface(event->surface, &c, NULL);
-   if (!c || c == focustop(selmon))
-       return;
-
-   c->isurgent = 1;
-   drawbars();
-
-   if (client_surface(c)->mapped)
-       client_set_border_color(c, (float[])COLOR(colors[SchemeUrg][ColBorder]));
-}
-
-void
-view(const Arg *arg)
-{
-   if (!selmon || (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
-       return;
-   selmon->seltags ^= 1; /* toggle sel tagset */
-   if (arg->ui & TAGMASK)
-       selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
-   focusclient(focustop(selmon), 1);
-   arrange(selmon);
-   drawbars();
-}
-
-void
-virtualkeyboard(struct wl_listener *listener, void *data)
-{
-   struct wlr_virtual_keyboard_v1 *kb = data;
-   /* virtual keyboards shouldn't share keyboard group */
-   KeyboardGroup *group = createkeyboardgroup();
-   /* Set the keymap to match the group keymap */
-   wlr_keyboard_set_keymap(&kb->keyboard, group->wlr_group->keyboard.keymap);
-   LISTEN(&kb->keyboard.base.events.destroy, &group->destroy, destroykeyboardgroup);
-
-   /* Add the new keyboard to the group */
-   wlr_keyboard_group_add_keyboard(group->wlr_group, &kb->keyboard);
-}
-
-void
-virtualpointer(struct wl_listener *listener, void *data)
-{
-   struct wlr_virtual_pointer_v1_new_pointer_event *event = data;
-   struct wlr_input_device *device = &event->new_pointer->pointer.base;
-
-   wlr_cursor_attach_input_device(cursor, device);
-   if (event->suggested_output)
-       wlr_cursor_map_input_to_output(cursor, device, event->suggested_output);
-}
-
-void
-warpcursor(const Client *c) {
-   if (cursor_mode != CurNormal) {
-       return;
-   }
-   if (!c && selmon) {
-       wlr_cursor_warp_closest(cursor,
-             NULL,
-             selmon->w.x + selmon->w.width / 2.0 ,
-             selmon->w.y + selmon->w.height / 2.0);
-   }
-   else if ( c && (cursor->x < c->geom.x ||
-       cursor->x > c->geom.x + c->geom.width ||
-       cursor->y < c->geom.y ||
-       cursor->y > c->geom.y + c->geom.height))
-       wlr_cursor_warp_closest(cursor,
-             NULL,
-             c->geom.x + c->geom.width / 2.0,
-             c->geom.y + c->geom.height / 2.0);
-}
-
-Monitor *
-xytomon(double x, double y)
-{
-   struct wlr_output *o = wlr_output_layout_output_at(output_layout, x, y);
-   return o ? o->data : NULL;
-}
-
-void
-xytonode(double x, double y, struct wlr_surface **psurface,
-       Client **pc, LayerSurface **pl, double *nx, double *ny)
-{
-   struct wlr_scene_node *node, *pnode;
-   struct wlr_surface *surface = NULL;
-   struct wlr_scene_surface *scene_surface = NULL;
-   Client *c = NULL;
-   LayerSurface *l = NULL;
-   int layer;
-
-   for (layer = NUM_LAYERS - 1; !surface && layer >= 0; layer--) {
-       if (!(node = wlr_scene_node_at(&layers[layer]->node, x, y, nx, ny)))
-           continue;
-
-       if (node->type == WLR_SCENE_NODE_BUFFER) {
-           scene_surface = wlr_scene_surface_try_from_buffer(
-                   wlr_scene_buffer_from_node(node));
-           if (!scene_surface) continue;
-           surface = scene_surface->surface;
-       }
-       /* Walk the tree to find a node that knows the client */
-       for (pnode = node; pnode && !c; pnode = &pnode->parent->node)
-           c = pnode->data;
-       if (c && c->type == LayerShell) {
-           c = NULL;
-           l = pnode->data;
-       }
-   }
-
-   if (psurface) *psurface = surface;
-   if (pc) *pc = c;
-   if (pl) *pl = l;
-}
-
-void
-zoom(const Arg *arg)
-{
-   Client *c, *sel = focustop(selmon);
-
-   if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating)
-       return;
-
-   /* Search for the first tiled window that is not sel, marking sel as
-    * NULL if we pass it along the way */
-   wl_list_for_each(c, &clients, link) {
-       if (VISIBLEON(c, selmon) && !c->isfloating) {
-           if (c != sel)
-               break;
-           sel = NULL;
-       }
-   }
-
-   /* Return if no other tiled window was found */
-   if (&c->link == &clients)
-       return;
-
-   /* If we passed sel, move c to the front; otherwise, move sel to the
-    * front */
-   if (!sel)
-       sel = c;
-   wl_list_remove(&sel->link);
-   wl_list_insert(&clients, &sel->link);
-
-   focusclient(sel, 1);
-   arrange(selmon);
-}
-
-#ifdef XWAYLAND
-void
-activatex11(struct wl_listener *listener, void *data)
-{
-   Client *c = wl_container_of(listener, c, activate);
-
-   /* Only "managed" windows can be activated */
-   if (!client_is_unmanaged(c))
-       wlr_xwayland_surface_activate(c->surface.xwayland, 1);
-}
-
-void
-associatex11(struct wl_listener *listener, void *data)
-{
-   Client *c = wl_container_of(listener, c, associate);
-
-   LISTEN(&client_surface(c)->events.map, &c->map, mapnotify);
-   LISTEN(&client_surface(c)->events.unmap, &c->unmap, unmapnotify);
-}
-
-void
-configurex11(struct wl_listener *listener, void *data)
-{
-   Client *c = wl_container_of(listener, c, configure);
-   struct wlr_xwayland_surface_configure_event *event = data;
-   if (!client_surface(c) || !client_surface(c)->mapped) {
-       wlr_xwayland_surface_configure(c->surface.xwayland,
-               event->x, event->y, event->width, event->height);
-       return;
-   }
-   if (client_is_unmanaged(c)) {
-       wlr_scene_node_set_position(&c->scene->node, event->x, event->y);
-       wlr_xwayland_surface_configure(c->surface.xwayland,
-               event->x, event->y, event->width, event->height);
-       return;
-   }
-   if ((c->isfloating && c != grabc) || !c->mon->lt[c->mon->sellt]->arrange) {
-       resize(c, (struct wlr_box){.x = event->x - c->bw,
-               .y = event->y - c->bw, .width = event->width + c->bw * 2,
-               .height = event->height + c->bw * 2}, 0);
-   } else {
-       arrange(c->mon);
-   }
-}
-
-void
-createnotifyx11(struct wl_listener *listener, void *data)
-{
-   struct wlr_xwayland_surface *xsurface = data;
-   Client *c;
-
-   /* Allocate a Client for this surface */
-   c = xsurface->data = ecalloc(1, sizeof(*c));
-   c->surface.xwayland = xsurface;
-   c->type = X11;
-   c->bw = client_is_unmanaged(c) ? 0 : borderpx;
-
-   /* Listen to the various events it can emit */
-   LISTEN(&xsurface->events.associate, &c->associate, associatex11);
-   LISTEN(&xsurface->events.destroy, &c->destroy, destroynotify);
-   LISTEN(&xsurface->events.dissociate, &c->dissociate, dissociatex11);
-   LISTEN(&xsurface->events.request_activate, &c->activate, activatex11);
-   LISTEN(&xsurface->events.request_configure, &c->configure, configurex11);
-   LISTEN(&xsurface->events.request_fullscreen, &c->fullscreen, fullscreennotify);
-   LISTEN(&xsurface->events.set_hints, &c->set_hints, sethints);
-   LISTEN(&xsurface->events.set_title, &c->set_title, updatetitle);
-}
-
-void
-dissociatex11(struct wl_listener *listener, void *data)
-{
-   Client *c = wl_container_of(listener, c, dissociate);
-   wl_list_remove(&c->map.link);
-   wl_list_remove(&c->unmap.link);
-}
-
-void
-sethints(struct wl_listener *listener, void *data)
-{
-   Client *c = wl_container_of(listener, c, set_hints);
-   struct wlr_surface *surface = client_surface(c);
-   if (c == focustop(selmon) || !c->surface.xwayland->hints)
-       return;
-
-   c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
-   drawbars();
-
-   if (c->isurgent && surface && surface->mapped)
-       client_set_border_color(c, (float[])COLOR(colors[SchemeUrg][ColBorder]));
-}
-
-void
-xwaylandready(struct wl_listener *listener, void *data)
-{
-   struct wlr_xcursor *xcursor;
-
-   /* assign the one and only seat */
-   wlr_xwayland_set_seat(xwayland, seat);
-
-   /* Set the default XWayland cursor to match the rest of dwl. */
-   if ((xcursor = wlr_xcursor_manager_get_xcursor(cursor_mgr, "default", 1)))
-       wlr_xwayland_set_cursor(xwayland,
-               xcursor->images[0]->buffer, xcursor->images[0]->width * 4,
-               xcursor->images[0]->width, xcursor->images[0]->height,
-               xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y);
-}
-#endif
-
-int
-main(int argc, char *argv[])
-{
-   char *startup_cmd = NULL;
-   int c;
-
-   while ((c = getopt(argc, argv, "s:hdv")) != -1) {
-       if (c == 's')
-           startup_cmd = optarg;
-       else if (c == 'd')
-           log_level = WLR_DEBUG;
-       else if (c == 'v')
-           die("dwl " VERSION);
-       else
-           goto usage;
-   }
-   if (optind < argc)
-       goto usage;
-
-   /* Wayland requires XDG_RUNTIME_DIR for creating its communications socket */
-   if (!getenv("XDG_RUNTIME_DIR"))
-       die("XDG_RUNTIME_DIR must be set");
-   setup();
-   run(startup_cmd);
-   cleanup();
-   return EXIT_SUCCESS;
-
-usage:
-   die("Usage: %s [-v] [-d] [-s startup command]", argv[0]);
-}
diff --git a/dwl/.mailmap b/dwl/.mailmap
new file mode 100644
index 0000000..1778cb9
--- /dev/null
+++ b/dwl/.mailmap
@@ -0,0 +1,3 @@
+Lennart Jablonka <humm@ljabl.com> <hummsmith42@gmail.com>
+Leonardo Hernández Hernández <leohdz172@proton.me> <leohdz172@outlook.com>
+Leonardo Hernández Hernández <leohdz172@proton.me> <leohdz172@protonmail.com>
diff --git a/CHANGELOG.md b/dwl/CHANGELOG.md
similarity index 100%
rename from CHANGELOG.md
rename to dwl/CHANGELOG.md
diff --git a/LICENSE b/dwl/LICENSES/LICENSE
similarity index 100%
rename from LICENSE
rename to dwl/LICENSES/LICENSE
diff --git a/LICENSE.dwm b/dwl/LICENSES/LICENSE.dwm
similarity index 100%
rename from LICENSE.dwm
rename to dwl/LICENSES/LICENSE.dwm
diff --git a/LICENSE.sway b/dwl/LICENSES/LICENSE.sway
similarity index 100%
rename from LICENSE.sway
rename to dwl/LICENSES/LICENSE.sway
diff --git a/LICENSE.tinywl b/dwl/LICENSES/LICENSE.tinywl
similarity index 100%
rename from LICENSE.tinywl
rename to dwl/LICENSES/LICENSE.tinywl
diff --git a/Makefile b/dwl/Makefile
similarity index 95%
rename from Makefile
rename to dwl/Makefile
index 279b1c0..ce47eba 100644
--- a/Makefile
+++ b/dwl/Makefile
@@ -21,7 +21,8 @@ dwl: dwl.o util.o
    <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>C</mi><mi>C</mi><mo stretchy="false">&#x00029;</mo><mi>d</mi><mi>w</mi><mi>l</mi><mo>&#x0002E;</mo><mi>o</mi><mi>u</mi><mi>t</mi><mi>i</mi><mi>l</mi><mo>&#x0002E;</mo><mi>o</mi></mrow></math>(DWLCFLAGS) <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>L</mi><mi>D</mi><mi>F</mi><mi>L</mi><mi>A</mi><mi>G</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo></mrow></math>(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
+   wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h \
+   tablet-v2-protocol.h
 util.o: util.c util.h

 # wayland-scanner is a tool which generates C headers and rigging for Wayland
@@ -45,6 +46,9 @@ wlr-output-power-management-unstable-v1-protocol.h:
 xdg-shell-protocol.h:
    $(WAYLAND_SCANNER) server-header \
        <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>W</mi><mi>A</mi><mi>Y</mi><mi>L</mi><mi>A</mi><mi>N</mi><msub><mi>D</mi><mi>P</mi></msub><mi>R</mi><mi>O</mi><mi>T</mi><mi>O</mi><mi>C</mi><mi>O</mi><mi>L</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo><mo>&#x0002F;</mo><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x0002F;</mo><mi>x</mi><mi>d</mi><mi>g</mi><mo>&#x02212;</mo><mi>s</mi><mi>h</mi><mi>e</mi><mi>l</mi><mi>l</mi><mo>&#x0002F;</mo><mi>x</mi><mi>d</mi><mi>g</mi><mo>&#x02212;</mo><mi>s</mi><mi>h</mi><mi>e</mi><mi>l</mi><mi>l</mi><mo>&#x0002E;</mo><mi>x</mi><mi>m</mi><mi>l</mi></mrow></math>@
+tablet-v2-protocol.h:
+   $(WAYLAND_SCANNER) server-header \
+       <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>W</mi><mi>A</mi><mi>Y</mi><mi>L</mi><mi>A</mi><mi>N</mi><msub><mi>D</mi><mi>P</mi></msub><mi>R</mi><mi>O</mi><mi>T</mi><mi>O</mi><mi>C</mi><mi>O</mi><mi>L</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo><mo>&#x0002F;</mo><mi>u</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x0002F;</mo><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mi>t</mi><mo>&#x0002F;</mo><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mi>t</mi><mo>&#x02212;</mo><mi>u</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x02212;</mo><mi>v</mi><mn>2</mn><mo>&#x0002E;</mo><mi>x</mi><mi>m</mi><mi>l</mi></mrow></math>@

 config.h:
    cp config.def.h $@
diff --git a/dwl/README.md b/dwl/README.md
new file mode 100644
index 0000000..3a3b9bd
--- /dev/null
+++ b/dwl/README.md
@@ -0,0 +1,216 @@
+# dwl - dwm for Wayland
+
+Join us on our [Discord server]  
+Or Matrix: [#dwl-official:matrix.org]  
+Or on our IRC channel: [#dwl on Libera Chat]
+
+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`
+- Tied to as few external dependencies as possible
+
+## Getting Started:
+
+### Latest semi-stable [release]
+This is probably where you want to start. This builds against the [wlroots]
+versions currently shipping in major distributions. If your
+distribution's `wlroots` version is older, use an earlier dwl [release].
+The `wlroots` version against which a given `dwl` release builds is specified
+with each release on the [release] page
+
+### Development branch [main]
+Active development progresses on the `main` branch. The `main` branch is built
+against the latest release of [wlroots]. PRs should target this branch unless they
+depend on functionality that is not in the current release of `wlroots`.
+
+### Preview branch [wlroots-next]
+The `wlroots-next` branch is built against the git version of [wlroots], which
+is unstable and changes frequently. PRs requiring functionality from the git
+version of `wlroots` should target this branch.
+
+### 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)
+
+dwl has the following additional dependencies if XWayland support is enabled:
+- libxcb
+- libxcb-wm
+- wlroots (compiled with X11 support)
+- Xwayland (runtime only)
+
+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].
+
+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.
+
+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. 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. Do note that the default background color is grey. 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], [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.:
+
+    export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u)
+    mkdir -p $XDG_RUNTIME_DIR
+    dwl
+
+### Status information
+
+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 `STATUS INFORMATION` section in `_dwl_(1)`).  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
+
+    exec <&-
+
+To get a list of status bars that work with dwl consult our [wiki].
+
+### (Known) Java nonreparenting WM issue
+Certain IDEs don't display correctly unless an environmental variable for Java AWT
+indicates that the WM is nonreparenting.
+
+For some Java AWT-based IDEs, such as Xilinx Vivado and Microchip MPLAB X, the
+following environment variable needs to be set before running the IDE or dwl:
+
+    export _JAVA_AWT_WM_NONREPARENTING=1
+
+## Replacements for X applications
+
+You can find a [list of useful resources on our wiki].
+
+## Background
+
+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.
+
+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
+- Stivvo for output management and fullscreen support, and patch maintenance
+
+
+[wlroots]: https://gitlab.freedesktop.org/wlroots
+[dwm]: https://dwm.suckless.org/
+[`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
+[wlroots-next]: https://codeberg.org/dwl/dwl/src/branch/wlroots-next
+[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/
+[#dwl-official:matrix.org]: https://matrix.to/#/#dwl-official:matrix.org
diff --git a/client.h b/dwl/client.h
similarity index 97%
rename from client.h
rename to dwl/client.h
index d9f90bb..83e1c57 100644
--- a/client.h
+++ b/dwl/client.h
@@ -131,6 +131,18 @@ client_get_appid(Client *c)
    return c->surface.xdg->toplevel->app_id ? c->surface.xdg->toplevel->app_id : "broken";
 }

+static inline int
+client_get_pid(Client *c)
+{
+   pid_t pid;
+#ifdef XWAYLAND
+   if (client_is_x11(c))
+       return c->surface.xwayland->pid;
+#endif
+   wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
+   return pid;
+}
+
 static inline void
 client_get_clip(Client *c, struct wlr_box *clip)
 {
diff --git a/dwl/config.def.h b/dwl/config.def.h
new file mode 100644
index 0000000..175af30
--- /dev/null
+++ b/dwl/config.def.h
@@ -0,0 +1,242 @@
+/* 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 tabletmaptosurface        = 0;  /* map tablet input to surface(1) or monitor(0) */
+static const int sloppyfocus               = 1;  /* focus follows mouse */
+static const int bypass_surface_visibility = 0;  /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible  */
+static const int smartborders              = 1;
+static const int smartgaps                 = 1;  /* 1 means no outer gap when there is only one window */
+static int gaps                            = 1;  /* 1 means gaps between windows are added */
+static const unsigned int gappx            = 10; /* gap pixel between windows */
+static const unsigned int borderpx         = 1;  /* border pixel of windows */
+static const int window_title              = 0;  /* 1 means showing window titles on the bar */
+static const int showbar                   = 1; /* 0 means no bar */
+static const int topbar                    = 1; /* 0 means bottom bar */
+static const int refresh_colors            = 1; /* 1 means reloading colors when the session starts*/
+static const char *colors_file             = "/home/pixel/.cache/wal/dwl-colors"; /* change the username */
+static const char *fonts[]                 = {"CaskaydiaMonoNerdFont-Bold:size=10:style:Bold"};
+static const float rootcolor[]             = COLOR(0x000000ff);
+static const float fullscreen_bg[]         = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
+static int enableautoswallow = 1;  /* enables autoswallowing newly spawned clients */
+static float swallowborder = 1.0f; /* add this multiplied by borderpx to border when a client is swallowed */
+static const int respect_monitor_reserved_area = 0;  /* 1 to monitor center while respecting the monitor's reserved area, 0 to monitor center */
+static const double tablet_area[4]            = { 0.3,  0.3,  0.5,   0.5 };
+
+
+static uint32_t colors[][3]                = {
+   /*               fg          bg          border    */
+   [SchemeNorm] = { 0xbbbbbbff, 0x222222ff, 0x444444ff },
+   [SchemeSel]  = { 0xeeeeeeff, 0x005577ff, 0x005577ff },
+   [SchemeUrg]  = { 0,          0,          0x770000ff },
+};
+
+/* tagging */
+static char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+
+/* logging */
+static int log_level = WLR_DEBUG;
+
+static const Rule rules[] = {
+   /* app_id             title       tags mask     isfloating   isterm   noswallow   monitor   x   y   w     h  */
+   { "foot",             NULL,       0,            0,           1,       1,          -1,       0,  0, 0.0f, 0.0f },
+   { "Gimp_EXAMPLE",     NULL,       0,            1,           0,       0,          -1,       0,  0, 0.0f, 0.0f }, /* Start on currently visible tags floating, not tiled */
+   { "firefox_EXAMPLE",  NULL,       1 << 8,       0,           0,       0,          -1,       0,  0, 0.0f, 0.0f }, /* Start on ONLY tag "9" */
+};
+
+/* layout(s) */
+static const Layout layouts[] = {
+   /* symbol     arrange function */
+   { "[]=",      tile },
+   { "><>",      NULL },    /* no layout function means floating behavior */
+   { "[M]",      monocle },
+};
+
+/* 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 due to
+ * https://gitlab.freedesktop.org/xorg/xserver/-/issues/899 */
+static const MonitorRule monrules[] = {
+   /* name        mfact  nmaster scale layout       rotate/reflect                x    y
+    * example of a HiDPI laptop monitor:
+    { "eDP-1",    0.5f,  1,      2,    &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL,   -1,  -1 }, */
+   { NULL,       0.55f, 1,      1,    &layouts[2], WL_OUTPUT_TRANSFORM_NORMAL,   -1,  -1 },
+   /* default monitor rule: can be changed but cannot be eliminated; at least one monitor rule must exist */
+};
+
+/* keyboard */
+static const struct xkb_rule_names xkb_rules = {
+   /* can specify fields: rules, model, layout, variant, options */
+   /* example:
+   .options = "ctrl:nocaps",
+   */
+   .options = "caps:escape",
+};
+
+static const int repeat_rate = 100;
+static const int repeat_delay = 180;
+
+/* Trackpad */
+static const int tap_to_click = 1;
+static const int tap_and_drag = 1;
+static const int drag_lock = 1;
+static const int natural_scrolling = 0;
+static const int disable_while_typing = 1;
+static const int left_handed = 0;
+static const int middle_button_emulation = 0;
+/* You can choose between:
+LIBINPUT_CONFIG_SCROLL_NO_SCROLL
+LIBINPUT_CONFIG_SCROLL_2FG
+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
+*/
+static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
+static const double accel_speed = 0.0;
+
+/* 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} }, \
+   { MODKEY|WLR_MODIFIER_SHIFT, SKEY,           tag,             {.ui = 1 << TAG} }, \
+   { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }
+
+
+/* helper for spawning shell commands in the pre dwm-5.0 fashion */
+#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
+
+/* commands */
+static const char *termcmd[] = SHCMD("footclient");
+static const char *menucmd[] = SHCMD("fuzzel  --config /home/pixel/.cache/wal/colors-fuzzel.ini");
+
+static const char *bright_up[]   = SHCMD("brightnessctl s +5% && sta -id 5");
+static const char *bright_down[] = SHCMD("brightnessctl s 5%- && sta -id 5");
+
+static const char *vol_up[]      = SHCMD("pactl set-sink-volume @DEFAULT_SINK@ +10% && sta -id 6");
+static const char *vol_down[]    = SHCMD("pactl set-sink-volume @DEFAULT_SINK@ -10% && sta -id 6");
+
+static const char *screenshot[] = SHCMD("grim -g \"$(slurp)\" - | wl-copy -t image/png");
+static const char *files[]      = SHCMD("~/docs/scripts/files.sh");
+static const char *colpik_cmd[] = SHCMD("colpik");
+
+static const Key keys[] = {
+   /* Note that Shift changes certain key codes: 2 -> at, etc. */
+   /* modifier                  key                  function          argument */
+   { WLR_MODIFIER_SHIFT|WLR_MODIFIER_CTRL, XKB_KEY_J, spawn, {.v = bright_down } },
+   { WLR_MODIFIER_SHIFT|WLR_MODIFIER_CTRL, XKB_KEY_K, spawn, {.v = bright_up } },
+   { WLR_MODIFIER_SHIFT|WLR_MODIFIER_CTRL, XKB_KEY_L, spawn, {.v = vol_up } },
+   { WLR_MODIFIER_SHIFT|WLR_MODIFIER_CTRL, XKB_KEY_H, spawn, {.v = vol_down } },
+   { WLR_MODIFIER_SHIFT|WLR_MODIFIER_CTRL, XKB_KEY_M, spawn, {.v = screenshot } },
+   { WLR_MODIFIER_SHIFT|WLR_MODIFIER_CTRL, XKB_KEY_C, spawn, {.v = files } },
+   { WLR_MODIFIER_SHIFT|WLR_MODIFIER_CTRL, XKB_KEY_A, spawn, {.v = colpik_cmd } },
+   { MODKEY,                    XKB_KEY_p,           spawn,            {.v = menucmd} },
+   { MODKEY,                    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_a,           setmfact,         {.f = -0.05f} },
+   { MODKEY,                    XKB_KEY_f,           setmfact,         {.f = +0.05f} },
+   { MODKEY,                    XKB_KEY_z,           zoom,             {0} },
+   { MODKEY,                    XKB_KEY_Tab,         view,             {0} },
+   { MODKEY,                    XKB_KEY_g,           togglegaps,       {0} },
+   { MODKEY,                    XKB_KEY_q,           killclient,       {0} },
+   { MODKEY,                    XKB_KEY_t,           setlayout,        {.v = &layouts[0]} },
+   { MODKEY,                    XKB_KEY_f,           setlayout,        {.v = &layouts[1]} },
+   { MODKEY,                    XKB_KEY_m,           setlayout,        {.v = &layouts[2]} },
+   { MODKEY,                    XKB_KEY_h,           shifttag,         {.i = -1} },
+   { MODKEY,                    XKB_KEY_l,           shifttag,         {.i = +1} },
+   { MODKEY,                    XKB_KEY_s,           toggleswallow,    {0} },
+   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_S,           toggleautoswallow,{0} },
+   { MODKEY,                    XKB_KEY_r,           reload_colors,    {0} },
+   { MODKEY,                    XKB_KEY_space,       setlayout,        {0} },
+   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space,       togglefloating,   {0} },
+   { MODKEY,                    XKB_KEY_e,           togglefullscreen, {0} },
+   { MODKEY,                    XKB_KEY_0,           view,             {.ui = ~0} },
+   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright,  tag,              {.ui = ~0} },
+   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_J,           focusmon,         {.i = WLR_DIRECTION_LEFT} },
+   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K,           focusmon,         {.i = WLR_DIRECTION_RIGHT} },
+   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_H,           tagmon,           {.i = WLR_DIRECTION_LEFT} },
+   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_L,           tagmon,           {.i = WLR_DIRECTION_RIGHT} },
+   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E,           quit,             {0} },
+
+   TAGKEYS(          XKB_KEY_1, XKB_KEY_exclam,                        0),
+   TAGKEYS(          XKB_KEY_2, XKB_KEY_at,                            1),
+   TAGKEYS(          XKB_KEY_3, XKB_KEY_numbersign,                    2),
+   TAGKEYS(          XKB_KEY_4, XKB_KEY_dollar,                        3),
+   TAGKEYS(          XKB_KEY_5, XKB_KEY_percent,                       4),
+   TAGKEYS(          XKB_KEY_6, XKB_KEY_asciicircum,                   5),
+   TAGKEYS(          XKB_KEY_7, XKB_KEY_ampersand,                     6),
+   TAGKEYS(          XKB_KEY_8, XKB_KEY_asterisk,                      7),
+   TAGKEYS(          XKB_KEY_9, XKB_KEY_parenleft,                     8),
+   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_q,           quit,             {0} },
+
+   /* 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[] = {
+   { 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} },
+};
+
+static const TabletButton tabletbuttons[] = {
+    /* button       state                  function    argument */
+//  { BTN_STYLUS,   WLR_BUTTON_PRESSED,    spawn,      {.v = termcmd} },
+//  { BTN_STYLUS2,  WLR_BUTTON_PRESSED,    killclient, {0} },
+   { 0,            0,                     NULL,       {0} }
+};
+
+static const TabletPadButton tabletpadbuttons[] = {
+   /* button  state                  function          argument */
+    { 0,       WLR_BUTTON_PRESSED,    focusmon,         {.i = WLR_DIRECTION_LEFT}  },
+    { 1,       WLR_BUTTON_PRESSED,    focusmon,         {.i = WLR_DIRECTION_RIGHT} },
+/*  { 2,       WLR_BUTTON_PRESSED,    togglefloating,   {0} },*/
+/*  { 3,       WLR_BUTTON_PRESSED,    zoom,             {0} },*/
+   { 0,            0,                     NULL,       {0} }
+};
diff --git a/config.mk b/dwl/config.mk
similarity index 100%
rename from config.mk
rename to dwl/config.mk
diff --git a/drwl.h b/dwl/drwl.h
similarity index 100%
rename from drwl.h
rename to dwl/drwl.h
diff --git a/dwl.1 b/dwl/dwl.1
similarity index 100%
rename from dwl.1
rename to dwl/dwl.1
diff --git a/dwl.c b/dwl/dwl.c
similarity index 84%
rename from dwl.c
rename to dwl/dwl.c
index 4ee9da2..34a10a1 100644
--- a/dwl.c
+++ b/dwl/dwl.c
@@ -1,6 +1,7 @@
 /*
  * See LICENSE file for copyright and license details.
  */
+#include <fcntl.h>
 #include <getopt.h>
 #include <libinput.h>
 #include <linux/input-event-codes.h>
@@ -25,6 +26,7 @@
 #include <wlr/types/wlr_data_device.h>
 #include <wlr/types/wlr_drm.h>
 #include <wlr/types/wlr_export_dmabuf_v1.h>
+#include <wlr/types/wlr_ext_data_control_v1.h>
 #include <wlr/types/wlr_fractional_scale_v1.h>
 #include <wlr/types/wlr_gamma_control_v1.h>
 #include <wlr/types/wlr_idle_inhibit_v1.h>
@@ -52,6 +54,9 @@
 #include <wlr/types/wlr_session_lock_v1.h>
 #include <wlr/types/wlr_single_pixel_buffer_v1.h>
 #include <wlr/types/wlr_subcompositor.h>
+#include <wlr/types/wlr_tablet_pad.h>
+#include <wlr/types/wlr_tablet_tool.h>
+#include <wlr/types/wlr_tablet_v2.h>
 #include <wlr/types/wlr_viewporter.h>
 #include <wlr/types/wlr_virtual_keyboard_v1.h>
 #include <wlr/types/wlr_virtual_pointer_v1.h>
@@ -77,7 +82,8 @@
 #define MAX(A, B)               ((A) > (B) ? (A) : (B))
 #define MIN(A, B)               ((A) < (B) ? (A) : (B))
 #define CLEANMASK(mask)         (mask & ~WLR_MODIFIER_CAPS)
-#define VISIBLEON(C, M)         ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
+#define VISIBLEON(C, M)         ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]) && !(C)->swallowedby)
+#define BORDERPX(C)             (borderpx + ((C)->swallowing ? (int)ceilf(swallowborder * (C)->swallowing->bw) : 0))
 #define LENGTH(X)               (sizeof X / sizeof X[0])
 #define END(A)                  ((A) + LENGTH(A))
 #define TAGMASK                 ((1u << LENGTH(tags)) - 1)
@@ -108,11 +114,13 @@ typedef struct {
 } Button;

 typedef struct Monitor Monitor;
-typedef struct {
+typedef struct Client Client;
+struct Client {
    /* Must keep this field first */
    unsigned int type; /* XDGShell or X11* */

    Monitor *mon;
+   char *output;
    struct wlr_scene_tree *scene;
    struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
    struct wlr_scene_tree *scene_surface;
@@ -145,8 +153,12 @@ typedef struct {
    unsigned int bw;
    uint32_t tags;
    int isfloating, isurgent, isfullscreen;
+   int isterm, noswallow;
    uint32_t resize; /* configure serial of a pending resize */
-} Client;
+   pid_t pid;
+   Client *swallowing;  /* client being hidden */
+   Client *swallowedby;
+};

 typedef struct {
    uint32_t mod;
@@ -168,6 +180,20 @@ typedef struct {
    struct wl_listener destroy;
 } KeyboardGroup;

+typedef struct {
+    uint32_t button;
+    uint32_t state;
+    void (*func)(const Arg *);
+    const Arg arg;
+} TabletPadButton;
+
+typedef struct {
+    uint32_t button;
+    uint32_t state;
+    void (*func)(const Arg *);
+    const Arg arg;
+} TabletButton;
+
 typedef struct {
    /* Must keep this field first */
    unsigned int type; /* LayerShell */
@@ -252,7 +278,13 @@ typedef struct {
    const char *title;
    uint32_t tags;
    int isfloating;
+   int isterm;
+   int noswallow;
    int monitor;
+   int x;
+   int y;
+   float w;
+   float h;
 } Rule;

 typedef struct {
@@ -271,7 +303,6 @@ static void arrange(Monitor *m);
 static void arrangelayer(Monitor *m, struct wl_list *list,
        struct wlr_box *usable_area, int exclusive);
 static void arrangelayers(Monitor *m);
-static void autostartexec(void);
 static void axisnotify(struct wl_listener *listener, void *data);
 static bool baracceptsinput(struct wlr_scene_buffer *buffer, double *sx, double *sy);
 static void bufdestroy(struct wlr_buffer *buffer);
@@ -301,6 +332,7 @@ static void createnotify(struct wl_listener *listener, void *data);
 static void createpointer(struct wlr_pointer *pointer);
 static void createpointerconstraint(struct wl_listener *listener, void *data);
 static void createpopup(struct wl_listener *listener, void *data);
+static void createtablet(struct wlr_input_device *device);
 static void cursorconstrain(struct wlr_pointer_constraint_v1 *constraint);
 static void cursorframe(struct wl_listener *listener, void *data);
 static void cursorwarptohint(void);
@@ -314,16 +346,21 @@ static void destroynotify(struct wl_listener *listener, void *data);
 static void destroypointerconstraint(struct wl_listener *listener, void *data);
 static void destroysessionlock(struct wl_listener *listener, void *data);
 static void destroykeyboardgroup(struct wl_listener *listener, void *data);
+static void destroytablet(struct wl_listener *listener, void *data);
+static void destroytabletpad(struct wl_listener *listener, void *data);
+static void destroytabletsurfacenotify(struct wl_listener *listener, void *data);
+static void destroytablettool(struct wl_listener *listener, void *data);
 static Monitor *dirtomon(enum wlr_direction dir);
 static void drawbar(Monitor *m);
 static void drawbars(void);
 static void focusclient(Client *c, int lift);
 static void focusmon(const Arg *arg);
 static void focusstack(const Arg *arg);
-static Client *focustop(Monitor *m);
+static Client *focustop(Monitor *m, int onlytiled);
 static void fullscreennotify(struct wl_listener *listener, void *data);
 static void gpureset(struct wl_listener *listener, void *data);
 static void handlesig(int signo);
+static void hidebehindmonocle(Monitor *m);
 static void incnmaster(const Arg *arg);
 static void inputdevice(struct wl_listener *listener, void *data);
 static int keybinding(uint32_t mods, xkb_keysym_t sym);
@@ -343,6 +380,7 @@ static void moveresize(const Arg *arg);
 static void outputmgrapply(struct wl_listener *listener, void *data);
 static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test);
 static void outputmgrtest(struct wl_listener *listener, void *data);
+static pid_t parentpid(pid_t pid);
 static void pointerfocus(Client *c, struct wlr_surface *surface,
        double sx, double sy, uint32_t time);
 static void powermgrsetmode(struct wl_listener *listener, void *data);
@@ -352,7 +390,7 @@ static void rendermon(struct wl_listener *listener, void *data);
 static void requestdecorationmode(struct wl_listener *listener, void *data);
 static void requeststartdrag(struct wl_listener *listener, void *data);
 static void requestmonstate(struct wl_listener *listener, void *data);
-static void resize(Client *c, struct wlr_box geo, int interact);
+static void resize(Client *c, struct wlr_box geo, int interact, int draw_borders);
 static void run(char *startup_cmd);
 static void setcursor(struct wl_listener *listener, void *data);
 static void setcursorshape(struct wl_listener *listener, void *data);
@@ -362,17 +400,28 @@ static void setlayout(const Arg *arg);
 static void setmfact(const Arg *arg);
 static void setmon(Client *c, Monitor *m, uint32_t newtags);
 static void setpsel(struct wl_listener *listener, void *data);
+static void shifttag(const Arg *arg);
 static void setsel(struct wl_listener *listener, void *data);
 static void setup(void);
 static void spawn(const Arg *arg);
 static void startdrag(struct wl_listener *listener, void *data);
 static int statusin(int fd, unsigned int mask, void *data);
+static void swallow(Client *c, Client *toswallow);
 static void tag(const Arg *arg);
 static void tagmon(const Arg *arg);
+static void tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x, bool change_y, double x, double y, double dx, double dy);
+static void tablettoolproximity(struct wl_listener *listener, void *data);
+static void tabletpadbutton(struct wl_listener *listener, void *data);
+static void tablettoolaxis(struct wl_listener *listener, void *data);
+static void tablettoolbutton(struct wl_listener *listener, void *data);
+static void tablettooltip(struct wl_listener *listener, void *data);
+static Client *termforwin(Client *c);
 static void tile(Monitor *m);
 static void togglebar(const Arg *arg);
 static void togglefloating(const Arg *arg);
 static void togglefullscreen(const Arg *arg);
+static void toggleswallow(const Arg *arg);
+static void toggleautoswallow(const Arg *arg);
 static void togglegaps(const Arg *arg);
 static void toggletag(const Arg *arg);
 static void toggleview(const Arg *arg);
@@ -430,6 +479,13 @@ static struct wlr_pointer_constraint_v1 *active_constraint;
 static struct wlr_cursor *cursor;
 static struct wlr_xcursor_manager *cursor_mgr;

+static struct wlr_tablet_manager_v2 *tablet_mgr;
+static struct wlr_tablet_v2_tablet *tablet = NULL;
+static struct wlr_tablet_v2_tablet_tool *tablet_tool = NULL;
+static struct wlr_tablet_v2_tablet_pad *tablet_pad = NULL;
+static struct wlr_surface *tablet_curr_surface = NULL;
+static struct wl_listener destroy_tablet_surface_listener = {.notify = destroytabletsurfacenotify};
+
 static struct wlr_scene_rect *root_bg;
 static struct wlr_session_lock_manager_v1 *session_lock_mgr;
 static struct wlr_scene_rect *locked_bg;
@@ -440,7 +496,6 @@ static KeyboardGroup *kb_group;
 static unsigned int cursor_mode;
 static Client *grabc;
 static int grabcx, grabcy; /* client-relative */
-static int rzcorner;

 static struct wlr_output_layout *output_layout;
 static struct wlr_box sgeom;
@@ -462,6 +517,14 @@ static struct wl_listener cursor_button = {.notify = buttonpress};
 static struct wl_listener cursor_frame = {.notify = cursorframe};
 static struct wl_listener cursor_motion = {.notify = motionrelative};
 static struct wl_listener cursor_motion_absolute = {.notify = motionabsolute};
+static struct wl_listener tablet_device_destroy = {.notify = destroytablet};
+static struct wl_listener tablet_pad_destroy = {.notify = destroytabletpad};
+static struct wl_listener tablet_pad_button = {.notify = tabletpadbutton};
+static struct wl_listener tablet_tool_axis = {.notify = tablettoolaxis};
+static struct wl_listener tablet_tool_button = {.notify = tablettoolbutton};
+static struct wl_listener tablet_tool_destroy = {.notify = destroytablettool};
+static struct wl_listener tablet_tool_proximity = {.notify = tablettoolproximity};
+static struct wl_listener tablet_tool_tip = {.notify = tablettooltip};
 static struct wl_listener gpu_reset = {.notify = gpureset};
 static struct wl_listener layout_change = {.notify = updatemons};
 static struct wl_listener new_idle_inhibitor = {.notify = createidleinhibitor};
@@ -505,9 +568,6 @@ static struct wlr_xwayland *xwayland;
 /* attempt to encapsulate suck into one file */
 #include "client.h"

-static pid_t *autostart_pids;
-static size_t autostart_len;
-
 /* function implementations */
 void
 applybounds(Client *c, struct wlr_box *bbox)
@@ -535,25 +595,57 @@ applyrules(Client *c)
    int i;
    const Rule *r;
    Monitor *mon = selmon, *m;
+   int newwidth;
+   int newheight;
+   int newx;
+   int newy;
+   int apply_resize = 0;

    appid = client_get_appid(c);
    title = client_get_title(c);

+   c->pid = client_get_pid(c);
+
    for (r = rules; r < END(rules); r++) {
        if ((!r->title || strstr(title, r->title))
                && (!r->id || strstr(appid, r->id))) {
            c->isfloating = r->isfloating;
            newtags |= r->tags;
+           c->isterm = r->isterm;
+           c->noswallow = r->noswallow;
            i = 0;
            wl_list_for_each(m, &mons, link) {
                if (r->monitor == i++)
                    mon = m;
+               if (c->isfloating || !mon->lt[mon->sellt]->arrange) {
+                   /* client is floating or in floating layout */
+                   struct wlr_box b = respect_monitor_reserved_area ? mon->w : mon->m;
+                   newwidth  = (int)round((r->w >= 0) ? (r->w <= 1 ? b.width  * r->w       : r->w)       : c->geom.width);
+                   newheight = (int)round((r->h >= 0) ? (r->h <= 1 ? b.height * r->h       : r->h)       : c->geom.height);
+                   newx      = (int)round((r->x >= 0) ? (r->x <= 1 ? b.width  * r->x + b.x : r->x + b.x) : c->geom.x);
+                   newy      = (int)round((r->y >= 0) ? (r->y <= 1 ? b.height * r->y + b.y : r->y + b.y) : c->geom.y);
+                   apply_resize = 1;
+               }
            }
        }
    }

    c->isfloating |= client_is_float_type(c);
+   if (enableautoswallow && !c->noswallow && !c->isfloating &&
+           !c->surface.xdg->initial_commit) {
+       Client *p = termforwin(c);
+       if (p)
+           swallow(c, p);
+   }
    setmon(c, mon, newtags);
+   if (apply_resize) {
+       resize(c, (struct wlr_box){
+               .x = newx,
+               .y = newy,
+               .width = newwidth,
+               .height = newheight,
+       }, 1, 0);
+   }
 }

 void
@@ -572,7 +664,7 @@ arrange(Monitor *m)
    }

    wlr_scene_node_set_enabled(&m->fullscreen_bg->node,
-           (c = focustop(m)) && c->isfullscreen);
+           (c = focustop(m, 0)) && c->isfullscreen);

    strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof(m->ltsymbol));

@@ -594,7 +686,7 @@ arrange(Monitor *m)
        m->lt[m->sellt]->arrange(m);
    motionnotify(0, NULL, 0, 0, 0, 0);
    checkidleinhibitor(NULL);
-   warpcursor(focustop(selmon));
+   warpcursor(focustop(selmon, 0));
 }

 void
@@ -644,7 +736,7 @@ arrangelayers(Monitor *m)
        arrange(m);
    }

-   /* Arrange non-exlusive surfaces from top->bottom */
+   /* Arrange non-exclusive surfaces from top->bottom */
    for (i = 3; i >= 0; i--)
        arrangelayer(m, &m->layers[i], &usable_area, 0);

@@ -662,27 +754,6 @@ arrangelayers(Monitor *m)
    }
 }

-void
-autostartexec(void) {
-   const char *const *p;
-   size_t i = 0;
-
-   /* count entries */
-   for (p = autostart; *p; autostart_len++, p++)
-       while (*++p);
-
-   autostart_pids = calloc(autostart_len, sizeof(pid_t));
-   for (p = autostart; *p; i++, p++) {
-       if ((autostart_pids[i] = fork()) == 0) {
-           setsid();
-           execvp(*p, (char *const *)p);
-           die("dwl: execvp %s:", *p);
-       }
-       /* skip arguments */
-       while (*++p);
-   }
-}
-
 void
 axisnotify(struct wl_listener *listener, void *data)
 {
@@ -881,23 +952,12 @@ checkidleinhibitor(struct wlr_surface *exclude)
 void
 cleanup(void)
 {
-   size_t i;
-
    cleanuplisteners();
 #ifdef XWAYLAND
    wlr_xwayland_destroy(xwayland);
    xwayland = NULL;
 #endif
    wl_display_destroy_clients(dpy);
-
-   /* kill child processes */
-   for (i = 0; i < autostart_len; i++) {
-       if (0 < autostart_pids[i]) {
-           kill(autostart_pids[i], SIGTERM);
-           waitpid(autostart_pids[i], NULL, 0);
-       }
-   }
-
    if (child_pid > 0) {
        kill(-child_pid, SIGTERM);
        waitpid(child_pid, NULL, 0);
@@ -1011,11 +1071,11 @@ closemon(Monitor *m)
    wl_list_for_each(c, &clients, link) {
        if (c->isfloating && c->geom.x > m->m.width)
            resize(c, (struct wlr_box){.x = c->geom.x - m->w.width, .y = c->geom.y,
-                   .width = c->geom.width, .height = c->geom.height}, 0);
+                   .width = c->geom.width, .height = c->geom.height}, 0, 1);
        if (c->mon == m)
            setmon(c, selmon, c->tags);
    }
-   focusclient(focustop(selmon), 1);
+   focusclient(focustop(selmon,0), 1);
    drawbars();
 }

@@ -1080,7 +1140,11 @@ commitnotify(struct wl_listener *listener, void *data)
        return;
    }

-   resize(c, c->geom, (c->isfloating && !c->isfullscreen));
+   if (client_surface(c)->mapped && c->mon && c->mon->lt[c->mon->sellt]->arrange
+           && !c->isfullscreen && !c->isfloating)
+       c->mon->lt[c->mon->sellt]->arrange(c->mon);
+   else
+       resize(c, c->geom, (c->isfloating && !c->isfullscreen), (c->isfloating && !c->isfullscreen));

    /* mark a pending resize as completed */
    if (c->resize && c->resize <= c->surface.xdg->current.configure_serial)
@@ -1247,6 +1311,7 @@ createmon(struct wl_listener *listener, void *data)
    size_t i;
    struct wlr_output_state state;
    Monitor *m;
+   Client *c;

    if (!wlr_output_init_render(wlr_output, alloc, drw))
        return;
@@ -1325,6 +1390,13 @@ createmon(struct wl_listener *listener, void *data)
        wlr_output_layout_add_auto(output_layout, wlr_output);
    else
        wlr_output_layout_add(output_layout, wlr_output, m->m.x, m->m.y);
+
+   wl_list_for_each(c, &clients, link) {
+       if (strcmp(wlr_output->name, c->output) == 0) {
+           c->mon = m;
+       }
+   }
+   updatemons(NULL, NULL);
 }

 void
@@ -1410,6 +1482,28 @@ createpopup(struct wl_listener *listener, void *data)
    LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup);
 }

+void
+createtablet(struct wlr_input_device *device)
+{
+   if (!tablet) {
+       struct libinput_device *device_handle = NULL;
+       if (!wlr_input_device_is_libinput(device) ||
+               !(device_handle = wlr_libinput_get_device_handle(device)))
+           return;
+
+       tablet = wlr_tablet_create(tablet_mgr, seat, device);
+       wl_signal_add(&tablet->wlr_device->events.destroy, &tablet_device_destroy);
+       if (libinput_device_config_send_events_get_modes(device_handle)) {
+           libinput_device_config_send_events_set_mode(device_handle, send_events_mode);
+           wlr_cursor_attach_input_device(cursor, device);
+       }
+   } else if (device == tablet->wlr_device) {
+       wlr_log(WLR_ERROR, "createtablet: duplicate device");
+   } else {
+       wlr_log(WLR_ERROR, "createtablet: already have one tablet");
+   }
+}
+
 void
 cursorconstrain(struct wlr_pointer_constraint_v1 *constraint)
 {
@@ -1461,7 +1555,7 @@ void
 destroydragicon(struct wl_listener *listener, void *data)
 {
    /* Focus enter isn't sent during drag, so refocus the focused node. */
-   focusclient(focustop(selmon), 1);
+   focusclient(focustop(selmon, 0), 1);
    motionnotify(0, NULL, 0, 0, 0, 0);
    wl_list_remove(&listener->link);
    free(listener);
@@ -1500,7 +1594,7 @@ destroylock(SessionLock *lock, int unlock)

    wlr_scene_node_set_enabled(&locked_bg->node, 0);

-   focusclient(focustop(selmon), 0);
+   focusclient(focustop(selmon, 0), 0);
    motionnotify(0, NULL, 0, 0, 0, 0);

 destroy:
@@ -1529,7 +1623,7 @@ destroylocksurface(struct wl_listener *listener, void *data)
        surface = wl_container_of(cur_lock->surfaces.next, surface, link);
        client_notify_enter(surface->surface, wlr_seat_get_keyboard(seat));
    } else if (!locked) {
-       focusclient(focustop(selmon), 1);
+       focusclient(focustop(selmon, 0), 1);
    } else {
        wlr_seat_keyboard_clear_focus(seat);
    }
@@ -1558,6 +1652,7 @@ destroynotify(struct wl_listener *listener, void *data)
        wl_list_remove(&c->unmap.link);
        wl_list_remove(&c->maximize.link);
    }
+   free(c->output);
    free(c);
 }

@@ -1594,6 +1689,38 @@ destroykeyboardgroup(struct wl_listener *listener, void *data)
    free(group);
 }

+void
+destroytablet(struct wl_listener *listener, void *data)
+{
+  wl_list_remove(&tablet_device_destroy.link);
+  wlr_cursor_detach_input_device(cursor, tablet->wlr_device);
+   tablet = NULL;
+}
+
+void
+destroytabletsurfacenotify(struct wl_listener *listener, void *data)
+{
+   if (tablet_curr_surface)
+       wl_list_remove(&destroy_tablet_surface_listener.link);
+   tablet_curr_surface = NULL;
+}
+
+void
+destroytabletpad(struct wl_listener *listener, void *data)
+{
+   wl_list_remove(&tablet_pad_button.link);
+   wl_list_remove(&tablet_pad_destroy.link);
+   tablet_pad = NULL;
+}
+
+
+void
+destroytablettool(struct wl_listener *listener, void *data)
+{
+   destroytabletsurfacenotify(NULL, NULL);
+   tablet_tool = NULL;
+}
+
 Monitor *
 dirtomon(enum wlr_direction dir)
 {
@@ -1614,6 +1741,8 @@ void
 drawbar(Monitor *m)
 {
    int x, w, tw = 0;
+   int boxs = m->drw->font->height / 9;
+   int boxw = m->drw->font->height / 6 + 2;
    uint32_t i, occ = 0, urg = 0;
    Client *c;
    Buffer *buf;
@@ -1638,16 +1767,15 @@ drawbar(Monitor *m)
            urg |= c->tags;
    }
    x = 0;
-   c = focustop(m);
+   c = focustop(m, 0);
    for (i = 0; i < LENGTH(tags); i++) {
        w = TEXTW(m, tags[i]);
        drwl_setscheme(m->drw, colors[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
        drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, tags[i], urg & 1 << i);
-       // Removing the rec on the focused tag
-       // if (occ & 1 << i)
-           // drwl_rect(m->drw, x + boxs, boxs, boxw, boxw,
-               // m == selmon && c && c->tags & 1 << i,
-               // urg & 1 << i);
+       if (occ & 1 << i)
+           drwl_rect(m->drw, x + boxs, boxs, boxw, boxw,
+               m == selmon && c && c->tags & 1 << i,
+               urg & 1 << i);
        x += w;
    }
    w = TEXTW(m, m->ltsymbol);
@@ -1655,8 +1783,15 @@ drawbar(Monitor *m)
    x = drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, m->ltsymbol, 0);

    if ((w = m->b.width - tw - x) > m->b.height) {
-       drwl_setscheme(m->drw, colors[SchemeNorm]);
-       drwl_rect(m->drw, x, 0, w, m->b.height, 1, 1);
+       if (c && window_title) {
+           drwl_setscheme(m->drw, colors[m == selmon ? SchemeSel : SchemeNorm]);
+           drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
+           if (c && c->isfloating)
+               drwl_rect(m->drw, x + boxs, boxs, boxw, boxw, 0, 0);
+       } else {
+           drwl_setscheme(m->drw, colors[SchemeNorm]);
+           drwl_rect(m->drw, x, 0, w, m->b.height, 1, 1);
+       }
    }

    wlr_scene_buffer_set_dest_size(m->scene_buffer,
@@ -1710,6 +1845,7 @@ focusclient(Client *c, int lift)
        wl_list_insert(&fstack, &c->flink);
        selmon = c->mon;
        c->isurgent = 0;
+       hidebehindmonocle(c->mon);

        /* Don't change border color if there is an exclusive focus or we are
         * handling a drag operation */
@@ -1762,14 +1898,14 @@ focusmon(const Arg *arg)
            selmon = dirtomon(arg->i);
        while (!selmon->wlr_output->enabled && i++ < nmons);
    }
-   focusclient(focustop(selmon), 1);
+   focusclient(focustop(selmon, 0), 1);
 }

 void
 focusstack(const Arg *arg)
 {
    /* Focus the next or previous client (in tiling order) on selmon */
-   Client *c, *sel = focustop(selmon);
+   Client *c, *sel = focustop(selmon, 0);
    if (!sel || (sel->isfullscreen && !client_has_children(sel)))
        return;
    if (arg->i > 0) {
@@ -1795,12 +1931,15 @@ focusstack(const Arg *arg)
  * will focus the topmost client of this mon, when actually will
  * only return that client */
 Client *
-focustop(Monitor *m)
+focustop(Monitor *m, int onlytiled)
 {
    Client *c;
    wl_list_for_each(c, &fstack, flink) {
-       if (VISIBLEON(c, m))
+       if (VISIBLEON(c, m)) {
+           if (onlytiled && c->isfloating)
+               continue;
            return c;
+       }
    }
    return NULL;
 }
@@ -1840,24 +1979,28 @@ gpureset(struct wl_listener *listener, void *data)
 void
 handlesig(int signo)
 {
-   if (signo == SIGCHLD) {
-       pid_t pid, *p, *lim;
-       while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) {
-           if (pid == child_pid)
-               child_pid = -1;
-           if (!(p = autostart_pids))
-               continue;
-           lim = &p[autostart_len];
+   if (signo == SIGCHLD)
+       while (waitpid(-1, NULL, WNOHANG) > 0);
+   else if (signo == SIGINT || signo == SIGTERM)
+       quit(NULL);
+}

-           for (; p < lim; p++) {
-               if (*p == pid) {
-                   *p = -1;
-                   break;
-               }
-           }
+void
+hidebehindmonocle(Monitor *m)
+{
+   Client *c;
+   if (m && m->lt[m->sellt]->arrange == monocle) {
+       wl_list_for_each(c, &clients, link) {
+           if (c->mon != m)
+               continue;
+           wlr_scene_node_set_enabled(&c->scene->node, VISIBLEON(c, m) && c->isfloating);
        }
-   } else if (signo == SIGINT || signo == SIGTERM) {
-       quit(NULL);
+
+       c = NULL;
+
+       /* Enable top tiled client, fullscreen is considered tiled */
+       if ((c = focustop(m, 1)))
+           wlr_scene_node_set_enabled(&c->scene->node, 1);
    }
 }

@@ -1876,6 +2019,7 @@ inputdevice(struct wl_listener *listener, void *data)
    /* This event is raised by the backend when a new input device becomes
     * available. */
    struct wlr_input_device *device = data;
+   struct wlr_tablet_pad *pad;
    uint32_t caps;

    switch (device->type) {
@@ -1885,6 +2029,15 @@ inputdevice(struct wl_listener *listener, void *data)
    case WLR_INPUT_DEVICE_POINTER:
        createpointer(wlr_pointer_from_input_device(device));
        break;
+        case WLR_INPUT_DEVICE_TABLET:
+       createtablet(device);
+       break;
+   case WLR_INPUT_DEVICE_TABLET_PAD:
+       pad = wlr_tablet_pad_from_input_device(device);
+       tablet_pad = wlr_tablet_pad_create(tablet_mgr, seat, device);
+       wl_signal_add(&pad->events.button, &tablet_pad_button);
+       wl_signal_add(&device->events.destroy, &tablet_pad_destroy);
+       break;
    default:
        /* TODO handle other input device types */
        break;
@@ -1911,7 +2064,8 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
    const Key *k;
    for (k = keys; k < END(keys); k++) {
        if (CLEANMASK(mods) == CLEANMASK(k->mod)
-               && sym == k->keysym && k->func) {
+               && xkb_keysym_to_lower(sym) == xkb_keysym_to_lower(k->keysym)
+               && k->func) {
            k->func(&k->arg);
            return 1;
        }
@@ -1999,7 +2153,7 @@ keyrepeat(void *data)
 void
 killclient(const Arg *arg)
 {
-   Client *sel = focustop(selmon);
+   Client *sel = focustop(selmon, 0);
    if (sel)
        client_send_close(sel);
 }
@@ -2086,6 +2240,11 @@ mapnotify(struct wl_listener *listener, void *data)
    } else {
        applyrules(c);
    }
+
+   c->output = strdup(c->mon->wlr_output->name);
+   if (c->output == NULL) {
+       die("oom");
+   }
    drawbars();

 unset_fullscreen:
@@ -2123,13 +2282,12 @@ monocle(Monitor *m)
    wl_list_for_each(c, &clients, link) {
        if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
            continue;
-       resize(c, m->w, 0);
+       resize(c, m->w, 0, !smartborders);
        n++;
    }
    if (n)
        snprintf(m->ltsymbol, LENGTH(m->ltsymbol), "[%d]", n);
-   if ((c = focustop(m)))
-       wlr_scene_node_raise_to_top(&c->scene->node);
+   hidebehindmonocle(m);
 }

 void
@@ -2214,27 +2372,11 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
    if (cursor_mode == CurMove) {
        /* Move the grabbed client to the new position. */
        resize(grabc, (struct wlr_box){.x = (int)round(cursor->x) - grabcx, .y = (int)round(cursor->y) - grabcy,
-           .width = grabc->geom.width, .height = grabc->geom.height}, 1);
+           .width = grabc->geom.width, .height = grabc->geom.height}, 1, 1);
        return;
    } else if (cursor_mode == CurResize) {
-       int cdx = (int)round(cursor->x) - grabcx;
-       int cdy = (int)round(cursor->y) - grabcy;
-
-       const struct wlr_box box = {
-           .x      = grabc->geom.x      + (rzcorner & 1 ? 0   :  cdx),
-           .y      = grabc->geom.y      + (rzcorner & 2 ? 0   :  cdy),
-           .width  = grabc->geom.width  + (rzcorner & 1 ? cdx : -cdx),
-           .height = grabc->geom.height + (rzcorner & 2 ? cdy : -cdy)
-       };
-       resize(grabc, box, 1);
-
-       if (!lock_cursor) {
-           grabcx += cdx;
-           grabcy += cdy;
-       } else {
-           wlr_cursor_warp_closest(cursor, NULL, grabcx, grabcy);
-       }
-
+       resize(grabc, (struct wlr_box){.x = grabc->geom.x, .y = grabc->geom.y,
+           .width = (int)round(cursor->x) - grabc->geom.x, .height = (int)round(cursor->y) - grabc->geom.y}, 1, 1);
        return;
    }

@@ -2280,24 +2422,12 @@ moveresize(const Arg *arg)
        wlr_cursor_set_xcursor(cursor, cursor_mgr, "all-scroll");
        break;
    case CurResize:
-       const char *cursors[] = { "nw-resize", "ne-resize", "sw-resize", "se-resize" };
-
-       rzcorner = resize_corner;
-       grabcx = (int)round(cursor->x);
-       grabcy = (int)round(cursor->y);
-
-       if (rzcorner == 4)
-           /* identify the closest corner index */
-           rzcorner = (grabcx - grabc->geom.x < grabc->geom.x + grabc->geom.width  - grabcx ? 0 : 1)
-                    + (grabcy - grabc->geom.y < grabc->geom.y + grabc->geom.height - grabcy ? 0 : 2);
-
-       if (warp_cursor) {
-           grabcx = rzcorner & 1 ? grabc->geom.x + grabc->geom.width  : grabc->geom.x;
-           grabcy = rzcorner & 2 ? grabc->geom.y + grabc->geom.height : grabc->geom.y;
-           wlr_cursor_warp_closest(cursor, NULL, grabcx, grabcy);
-       }
-
-       wlr_cursor_set_xcursor(cursor, cursor_mgr, cursors[rzcorner]);
+       /* Doesn't work for X11 output - the next absolute motion event
+        * returns the cursor to where it started */
+       wlr_cursor_warp_closest(cursor, NULL,
+               grabc->geom.x + grabc->geom.width,
+               grabc->geom.y + grabc->geom.height);
+       wlr_cursor_set_xcursor(cursor, cursor_mgr, "se-resize");
        break;
    }
 }
@@ -2379,6 +2509,20 @@ outputmgrtest(struct wl_listener *listener, void *data)
    outputmgrapplyortest(config, 1);
 }

+pid_t
+parentpid(pid_t pid)
+{
+   unsigned int v = 0;
+   FILE *f;
+   char buf[256];
+   snprintf(buf, sizeof(buf) - 1, "/proc/%u/stat", (unsigned)pid);
+   if (!(f = fopen(buf, "r")))
+       return 0;
+   fscanf(f, "%*u %*s %*c %u", &v);
+   fclose(f);
+   return (pid_t)v;
+}
+
 void
 pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
        uint32_t time)
@@ -2417,7 +2561,7 @@ powermgrsetmode(struct wl_listener *listener, void *data)
    if (!m)
        return;

-   m->gamma_lut_changed = 1; /* Reapply gamma LUT when re-enabling the ouput */
+   m->gamma_lut_changed = 1; /* Reapply gamma LUT when re-enabling the output */
    wlr_output_state_set_enabled(&state, event->mode);
    wlr_output_commit_state(m->wlr_output, &state);

@@ -2434,22 +2578,19 @@ quit(const Arg *arg)
 void
 reload_colors(const Arg *arg)
 {
-    FILE *f = fopen(colors_dir, "r");
-    if (!f) {
-        return;
-    }
+    FILE *f = fopen(colors_file, "r");
+    if (!f) return;

     for (int i = 0; i < (int)LENGTH(colors); i++) {
         unsigned int fg, bg, border;
-        if (fscanf(f, "%x %x %x", &fg, &bg, &border) != 3) {
+        if (fscanf(f, "%x %x %x", &fg, &bg, &border) != 3)
             break;
-        }
-        colors[i][ColFg] = fg;
-        colors[i][ColBg] = bg;
+
+        colors[i][ColFg]    = fg;
+        colors[i][ColBg]    = bg;
         colors[i][ColBorder] = border;
     }
-
-    fclose(f);
+   fclose(f);
     drawbars();
 }

@@ -2509,7 +2650,7 @@ requestmonstate(struct wl_listener *listener, void *data)
 }

 void
-resize(Client *c, struct wlr_box geo, int interact)
+resize(Client *c, struct wlr_box geo, int interact, int draw_borders)
 {
    struct wlr_box *bbox;
    struct wlr_box clip;
@@ -2521,6 +2662,7 @@ resize(Client *c, struct wlr_box geo, int interact)

    client_set_bounds(c, geo.width, geo.height);
    c->geom = geo;
+   c->bw = draw_borders ? borderpx : 0;
    applybounds(c, bbox);

    /* Update scene-graph, including borders */
@@ -2556,7 +2698,6 @@ run(char *startup_cmd)
        die("startup: backend_start");

    /* Now that the socket exists and the backend is started, run the startup command */
-   autostartexec();
    if (startup_cmd) {
        if ((child_pid = fork()) < 0)
            die("startup: fork:");
@@ -2640,6 +2781,8 @@ setfloating(Client *c, int floating)
    wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen ||
            (p && p->isfullscreen) ? LyrFS
            : c->isfloating ? LyrFloat : LyrTile]);
+   if (c->isfloating && !c->bw)
+       resize(c, c->mon->m, 0, 1);
    arrange(c->mon);
    drawbars();
 }
@@ -2650,19 +2793,20 @@ setfullscreen(Client *c, int fullscreen)
    c->isfullscreen = fullscreen;
    if (!c->mon || !client_surface(c)->mapped)
        return;
-   c->bw = fullscreen ? 0 : borderpx;
+   c->bw = fullscreen ? 0 : BORDERPX(c);
    client_set_fullscreen(c, fullscreen);
    wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen
            ? LyrFS : c->isfloating ? LyrFloat : LyrTile]);

    if (fullscreen) {
        c->prev = c->geom;
-       resize(c, c->mon->m, 0);
+       resize(c, c->mon->m, 0, 0);
    } else {
        /* restore previous size instead of arrange for floating windows since
         * client positions are set by the user and cannot be recalculated */
-       resize(c, c->prev, 0);
+       resize(c, c->prev, 0, 1);
    }
+
    arrange(c->mon);
    drawbars();
 }
@@ -2677,12 +2821,14 @@ setlayout(const Arg *arg)
    if (arg && arg->v)
        selmon->lt[selmon->sellt] = (Layout *)arg->v;
    strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof(selmon->ltsymbol));
-   arrange(selmon);
-   Monitor *m;
-   wl_list_for_each(m, &mons, link) {
-       drawbar(m);
+   if (!selmon->lt[selmon->sellt]->arrange) {
+       /* floating layout, draw borders around all clients */
+       Client *c;
+       wl_list_for_each(c, &clients, link)
+           resize(c, c->mon->m, 0, 1);
    }
-
+   arrange(selmon);
+   drawbar(selmon);
 }

 /* arg > 1.0 will set mfact absolutely */
@@ -2715,12 +2861,17 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
        arrange(oldmon);
    if (m) {
        /* Make sure window actually overlaps with the monitor */
-       resize(c, c->geom, 0);
+       resize(c, c->geom, 0, 1);
        c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
+       c->prev.x = (m->w.width - c->prev.width ) / 2 + m->m.x;
+       c->prev.y = (m->w.height - c->prev.height + m->b.height) / 2 + m->m.y;
        setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
        setfloating(c, c->isfloating);
    }
-   focusclient(focustop(selmon), 1);
+   focusclient(focustop(selmon, 0), 1);
+
+   if (c->swallowing)
+       setmon(c->swallowing, m, newtags);
 }

 void
@@ -2759,7 +2910,7 @@ setup(void)
    wlr_log_init(log_level, NULL);

    /* The Wayland display is managed by libwayland. It handles accepting
-    * clients from the Unix socket, manging Wayland globals, and so on. */
+    * clients from the Unix socket, managing Wayland globals, and so on. */
    dpy = wl_display_create();
    event_loop = wl_display_get_event_loop(dpy);

@@ -2822,6 +2973,7 @@ setup(void)
    wlr_export_dmabuf_manager_v1_create(dpy);
    wlr_screencopy_manager_v1_create(dpy);
    wlr_data_control_manager_v1_create(dpy);
+   wlr_ext_data_control_manager_v1_create(dpy, 1);
    wlr_primary_selection_v1_device_manager_create(dpy);
    wlr_viewporter_create(dpy);
    wlr_single_pixel_buffer_manager_v1_create(dpy);
@@ -2889,6 +3041,8 @@ setup(void)

    relative_pointer_mgr = wlr_relative_pointer_manager_v1_create(dpy);

+   tablet_mgr = wlr_tablet_v2_create(dpy);
+
    /*
     * Creates a cursor, which is a wlroots utility for tracking the cursor
     * image shown on screen.
@@ -2918,6 +3072,11 @@ setup(void)
    wl_signal_add(&cursor->events.button, &cursor_button);
    wl_signal_add(&cursor->events.axis, &cursor_axis);
    wl_signal_add(&cursor->events.frame, &cursor_frame);
+   wl_signal_add(&cursor->events.tablet_tool_proximity, &tablet_tool_proximity);
+   wl_signal_add(&cursor->events.tablet_tool_axis, &tablet_tool_axis);
+   wl_signal_add(&cursor->events.tablet_tool_button, &tablet_tool_button);
+   wl_signal_add(&cursor->events.tablet_tool_tip, &tablet_tool_tip);
+

    cursor_shape_mgr = wlr_cursor_shape_manager_v1_create(dpy, 1);
    wl_signal_add(&cursor_shape_mgr->events.request_set_shape, &request_set_cursor_shape);
@@ -2980,6 +3139,7 @@ spawn(const Arg *arg)
 {
    if (fork() == 0) {
        close(STDIN_FILENO);
+       open("/dev/null", O_RDWR);
        dup2(STDERR_FILENO, STDOUT_FILENO);
        setsid();
        execvp(((char **)arg->v)[0], (char **)arg->v);
@@ -3001,7 +3161,7 @@ startdrag(struct wl_listener *listener, void *data)
 int
 statusin(int fd, unsigned int mask, void *data)
 {
-   char status[256];
+   char status[1024];
    ssize_t n;

    if (mask & WL_EVENT_ERROR)
@@ -3022,15 +3182,79 @@ statusin(int fd, unsigned int mask, void *data)
    return 0;
 }

+void
+swallow(Client *c, Client *toswallow)
+{
+   /* Do not allow a client to swallow itself */
+   if (c == toswallow)
+       return;
+
+   /* Swallow */
+   if (toswallow && !c->swallowing) {
+       c->swallowing = toswallow;
+       toswallow->swallowedby = c;
+       toswallow->mon = c->mon;
+       toswallow->mon = c->mon;
+       wl_list_remove(&c->link);
+       wl_list_insert(&c->swallowing->link, &c->link);
+       wl_list_remove(&c->flink);
+       wl_list_insert(&c->swallowing->flink, &c->flink);
+       c->bw = BORDERPX(c);
+       c->tags = toswallow->tags;
+       c->isfloating = toswallow->isfloating;
+       c->geom = toswallow->geom;
+       setfullscreen(toswallow, 0);
+   }
+
+   /* Unswallow */
+   else if (c->swallowing) {
+       wl_list_remove(&c->swallowing->link);
+       wl_list_insert(&c->link, &c->swallowing->link);
+       wl_list_remove(&c->swallowing->flink);
+       wl_list_insert(&c->flink, &c->swallowing->flink);
+       c->swallowing->tags = c->tags;
+       c->swallowing->swallowedby = NULL;
+       c->swallowing = NULL;
+       c->bw = BORDERPX(c);
+       setfullscreen(c, 0);
+   }
+}
+
+void
+shifttag(const Arg *arg)
+{
+   unsigned int i, curtag = 0, newtag = 0;
+   
+   /* Find current active tag */
+   for (i = 0; i < 9; i++) {
+       if (selmon->tagset[selmon->seltags] & (1 << i)) {
+           curtag = i;
+           break;
+       }
+   }
+   
+   /* Calculate new tag with wrapping */
+   if (arg->i > 0) {
+       /* Next tag */
+       newtag = (curtag + 1) % 9;
+   } else {
+       /* Previous tag */
+       newtag = (curtag + 9 - 1) % 9;
+   }
+   
+   /* Switch to new tag */
+   view(&(Arg){.ui = 1 << newtag});
+}
+
 void
 tag(const Arg *arg)
 {
-   Client *sel = focustop(selmon);
+   Client *sel = focustop(selmon, 0);
    if (!sel || (arg->ui & TAGMASK) == 0)
        return;

    sel->tags = arg->ui & TAGMASK;
-   focusclient(focustop(selmon), 1);
+   focusclient(focustop(selmon, 0), 1);
    arrange(selmon);
    drawbars();
 }
@@ -3038,15 +3262,248 @@ tag(const Arg *arg)
 void
 tagmon(const Arg *arg)
 {
-   Client *sel = focustop(selmon);
-   if (sel)
-       setmon(sel, dirtomon(arg->i), 0);
+   Client *sel = focustop(selmon, 0);
+   if (!sel) return;
+   setmon(sel, dirtomon(arg->i), 0);
+   // Focus on monitor when moving Clients
+   focusmon(&(Arg){.i=arg->i});
+   free(sel->output);
+   sel->output = strdup(sel->mon->wlr_output->name);
+   if (sel->output == NULL) die("oom");
+}
+
+Client *
+termforwin(Client *c)
+{
+   Client *p;
+   pid_t pid;
+   pid_t pids[32];
+   size_t i, pids_len;
+
+   if (!c->pid || c->isterm)
+       return NULL;
+
+   /* Get all parent pids */
+   pids_len = 0;
+   pid = c->pid;
+   while (pids_len < LENGTH(pids)) {
+       pid = parentpid(pid);
+       if (!pid)
+           break;
+       pids[pids_len++] = pid;
+   }
+
+   /* Find closest parent */
+   for (i = 0; i < pids_len; i++) {
+       wl_list_for_each(p, &clients, link) {
+           if (!p->pid || !p->isterm || p->swallowedby)
+               continue;
+           if (pids[i] == p->pid)
+               return p;
+       }
+   }
+
+   return NULL;
+}
+
+void
+tabletapplymap(double x, double y, struct wlr_input_device *dev)
+{
+   Client *p;
+   struct wlr_box geom = {0};
+   if (tabletmaptosurface && tablet_curr_surface) {
+       toplevel_from_wlr_surface(tablet_curr_surface, &p, NULL);
+       if (p) {
+           for (; client_get_parent(p); p = client_get_parent(p));
+           geom.x = p->geom.x + p->bw;
+           geom.y = p->geom.y + p->bw;
+           geom.width = p->geom.width - 2 * p->bw;
+           geom.height = p->geom.height - 2 * p->bw;
+       }
+   }
+   wlr_cursor_map_input_to_region(cursor, dev, &geom);
+   wlr_cursor_map_input_to_output(cursor, dev, selmon->wlr_output);
+}
+
+void
+tabletpadbutton(struct wl_listener *listener, void *data)
+{
+    struct wlr_tablet_pad_button_event *event = data;
+    const TabletPadButton *pb;
+
+    for (pb = tabletpadbuttons; pb < END(tabletpadbuttons); pb++) {
+        if (event->button == pb->button
+                && event->state == pb->state
+                && pb->func) {
+            pb->func(&pb->arg);
+            return;
+        }
+    }
+
+    /* unhandled — forward to client */
+    if (tablet_pad)
+        wlr_tablet_v2_tablet_pad_notify_button(tablet_pad,
+            event->button, event->time_msec,
+            (enum zwp_tablet_pad_v2_button_state)event->state);
+}
+
+void
+tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x, bool change_y,
+       double x, double y, double dx, double dy)
+{
+   struct wlr_surface *surface = NULL;
+   double sx, sy;
+
+   if (!change_x && !change_y)
+       return;
+
+   tabletapplymap(x, y, tablet->wlr_device);
+
+   x = (MAX(tablet_area[0], MIN(tablet_area[0] + tablet_area[2], x)) - tablet_area[0]) / tablet_area[2];
+   y = (MAX(tablet_area[1], MIN(tablet_area[1] + tablet_area[3], y)) - tablet_area[1]) / tablet_area[3];
+
+
+   // TODO: apply constraints
+   switch (tablet_tool->wlr_tool->type) {
+   case WLR_TABLET_TOOL_TYPE_LENS:
+   case WLR_TABLET_TOOL_TYPE_MOUSE:
+       wlr_cursor_move(cursor, tablet->wlr_device, dx, dy);
+       break;
+   default:
+       wlr_cursor_warp_absolute(cursor, tablet->wlr_device, change_x ? x : NAN, change_y ? y : NAN);
+       break;
+   }
+
+   motionnotify(0, NULL, 0, 0, 0, 0);
+
+   xytonode(cursor->x, cursor->y, &surface, NULL, NULL, &sx, &sy);
+   if (surface && !wlr_surface_accepts_tablet_v2(surface, tablet))
+       surface = NULL;
+
+   if (surface != tablet_curr_surface) {
+       if (tablet_curr_surface) {
+           // TODO: wait until all buttons released before leaving
+           if (tablet_tool)
+               wlr_tablet_v2_tablet_tool_notify_proximity_out(tablet_tool);
+           if (tablet_pad)
+               wlr_tablet_v2_tablet_pad_notify_leave(tablet_pad, tablet_curr_surface);
+           wl_list_remove(&destroy_tablet_surface_listener.link);
+       }
+       if (surface) {
+           if (tablet_pad)
+               wlr_tablet_v2_tablet_pad_notify_enter(tablet_pad, tablet, surface);
+           if (tablet_tool)
+               wlr_tablet_v2_tablet_tool_notify_proximity_in(tablet_tool, tablet, surface);
+           wl_signal_add(&surface->events.destroy, &destroy_tablet_surface_listener);
+       }
+       tablet_curr_surface = surface;
+   }
+
+   if (surface)
+       wlr_tablet_v2_tablet_tool_notify_motion(tablet_tool, sx, sy);
+}
+
+void
+tablettoolproximity(struct wl_listener *listener, void *data)
+{
+   struct wlr_tablet_tool_proximity_event *event = data;
+   struct wlr_tablet_tool *tool = event->tool;
+
+   if (!tablet_tool) {
+       tablet_tool = wlr_tablet_tool_create(tablet_mgr, seat, tool);
+       wl_signal_add(&tablet_tool->wlr_tool->events.destroy, &tablet_tool_destroy);
+       wl_signal_add(&tablet_tool->events.set_cursor, &request_cursor);
+   }
+
+   switch (event->state) {
+   case WLR_TABLET_TOOL_PROXIMITY_OUT:
+       wlr_tablet_v2_tablet_tool_notify_proximity_out(tablet_tool);
+       destroytabletsurfacenotify(NULL, NULL);
+       break;
+   case WLR_TABLET_TOOL_PROXIMITY_IN:
+       tablettoolmotion(tablet_tool, true, true, event->x, event->y, 0, 0);
+       break;
+   }
+}
+
+double tilt_x = 0;
+double tilt_y = 0;
+
+void
+tablettoolaxis(struct wl_listener *listener, void *data)
+{
+   struct wlr_tablet_tool_axis_event *event = data;
+
+   tablettoolmotion(tablet_tool,
+       event->updated_axes & WLR_TABLET_TOOL_AXIS_X,
+       event->updated_axes & WLR_TABLET_TOOL_AXIS_Y,
+       event->x, event->y, event->dx, event->dy);
+
+   if (event->updated_axes & WLR_TABLET_TOOL_AXIS_PRESSURE)
+       wlr_tablet_v2_tablet_tool_notify_pressure(tablet_tool, event->pressure);
+   if (event->updated_axes & WLR_TABLET_TOOL_AXIS_DISTANCE)
+       wlr_tablet_v2_tablet_tool_notify_distance(tablet_tool, event->distance);
+   if (event->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_X)
+       tilt_x = event->tilt_x;
+   if (event->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_Y)
+       tilt_y = event->tilt_y;
+   if (event->updated_axes & (WLR_TABLET_TOOL_AXIS_TILT_X | WLR_TABLET_TOOL_AXIS_TILT_Y))
+       wlr_tablet_v2_tablet_tool_notify_tilt(tablet_tool, tilt_x, tilt_y);
+   if (event->updated_axes & WLR_TABLET_TOOL_AXIS_ROTATION)
+       wlr_tablet_v2_tablet_tool_notify_rotation(tablet_tool, event->rotation);
+   if (event->updated_axes & WLR_TABLET_TOOL_AXIS_SLIDER)
+       wlr_tablet_v2_tablet_tool_notify_slider(tablet_tool, event->slider);
+   if (event->updated_axes & WLR_TABLET_TOOL_AXIS_WHEEL)
+       wlr_tablet_v2_tablet_tool_notify_wheel(tablet_tool, event->wheel_delta, 0);
+}
+
+void
+tablettoolbutton(struct wl_listener *listener, void *data)
+{
+   struct wlr_tablet_tool_button_event *event = data;
+   const TabletButton *tb;
+
+    for (tb = tabletbuttons; tb < END(tabletbuttons); tb++) {
+        if (event->button == tb->button
+                && event->state == tb->state
+                && tb->func) {
+            tb->func(&tb->arg);
+            return;
+        }
+    }
+
+   wlr_tablet_v2_tablet_tool_notify_button(tablet_tool, event->button,
+       (enum zwp_tablet_pad_v2_button_state)event->state);
+}
+
+void
+tablettooltip(struct wl_listener *listener, void *data)
+{
+   struct wlr_tablet_tool_tip_event *event = data;
+
+   if (!tablet_curr_surface) {
+       struct wlr_pointer_button_event fakeptrbtnevent = {
+           .button = BTN_LEFT,
+           .state = event->state == WLR_TABLET_TOOL_TIP_UP ?
+               WL_POINTER_BUTTON_STATE_RELEASED : WL_POINTER_BUTTON_STATE_PRESSED,
+           .time_msec = event->time_msec,
+       };
+       buttonpress(NULL, (void *)&fakeptrbtnevent);
+   }
+
+   if (event->state == WLR_TABLET_TOOL_TIP_UP) {
+       wlr_tablet_v2_tablet_tool_notify_up(tablet_tool);
+       return;
+   }
+
+   wlr_tablet_v2_tablet_tool_notify_down(tablet_tool);
+   wlr_tablet_tool_v2_start_implicit_grab(tablet_tool);
 }

 void
 tile(Monitor *m)
 {
-   unsigned int h, r, e = m->gaps, mw, my, ty;
+   unsigned int h, r, e = m->gaps, mw, my, ty, draw_borders = 1;
    int i, n = 0;
    Client *c;

@@ -3058,6 +3515,9 @@ tile(Monitor *m)
    if (smartgaps == n)
        e = 0;

+   if (n == smartborders)
+       draw_borders = 0;
+
    if (n > m->nmaster)
        mw = m->nmaster ? (int)roundf((m->w.width + gappx*e) * m->mfact) : 0;
    else
@@ -3071,13 +3531,13 @@ tile(Monitor *m)
            r = MIN(n, m->nmaster) - i;
            h = (m->w.height - my - gappx*e - gappx*e * (r - 1)) / r;
            resize(c, (struct wlr_box){.x = m->w.x + gappx*e, .y = m->w.y + my,
-               .width = mw - 2*gappx*e, .height = h}, 0);
+               .width = mw - 2*gappx*e, .height = h}, 0, draw_borders);
            my += c->geom.height + gappx*e;
        } else {
            r = n - i;
            h = (m->w.height - ty - gappx*e - gappx*e * (r - 1)) / r;
            resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty,
-               .width = m->w.width - mw - gappx*e, .height = h}, 0);
+               .width = m->w.width - mw - gappx*e, .height = h}, 0, draw_borders);
            ty += c->geom.height + gappx*e;
        }
        i++;
@@ -3090,12 +3550,13 @@ togglebar(const Arg *arg)
    wlr_scene_node_set_enabled(&selmon->scene_buffer->node,
        !selmon->scene_buffer->node.enabled);
    arrangelayers(selmon);
+   drawbars();
 }

 void
 togglefloating(const Arg *arg)
 {
-   Client *sel = focustop(selmon);
+   Client *sel = focustop(selmon, 0);
    /* return if fullscreen */
    if (sel && !sel->isfullscreen)
        setfloating(sel, !sel->isfloating);
@@ -3104,7 +3565,7 @@ togglefloating(const Arg *arg)
 void
 togglefullscreen(const Arg *arg)
 {
-   Client *sel = focustop(selmon);
+   Client *sel = focustop(selmon, 0);
    if (sel)
        setfullscreen(sel, !sel->isfullscreen);
 }
@@ -3116,16 +3577,42 @@ togglegaps(const Arg *arg)
    arrange(selmon);
 }

+void
+toggleswallow(const Arg *arg)
+{
+   Client *c, *sel = focustop(selmon, 0);
+   if (!sel)
+       return;
+
+   if (sel->swallowing) {
+       swallow(sel, NULL);
+   } else {
+       wl_list_for_each(c, &sel->flink, flink) {
+           if (&c->flink == &fstack)
+               continue; /* wrap past the sentinel node */
+           if (VISIBLEON(c, selmon))
+               break; /* found it */
+       }
+       swallow(sel, c);
+   }
+}
+
+void
+toggleautoswallow(const Arg *arg)
+{
+   enableautoswallow = !enableautoswallow;
+}
+
 void
 toggletag(const Arg *arg)
 {
    uint32_t newtags;
-   Client *sel = focustop(selmon);
+   Client *sel = focustop(selmon, 0);
    if (!sel || !(newtags = sel->tags ^ (arg->ui & TAGMASK)))
        return;

    sel->tags = newtags;
-   focusclient(focustop(selmon), 1);
+   focusclient(focustop(selmon, 0), 1);
    arrange(selmon);
    drawbars();
 }
@@ -3138,7 +3625,7 @@ toggleview(const Arg *arg)
        return;

    selmon->tagset[selmon->seltags] = newtagset;
-   focusclient(focustop(selmon), 1);
+   focusclient(focustop(selmon, 0), 1);
    arrange(selmon);
    drawbars();
 }
@@ -3162,7 +3649,7 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data)
    if (l->layer_surface->output && (l->mon = l->layer_surface->output->data))
        arrangelayers(l->mon);
    if (l->layer_surface->surface == seat->keyboard_state.focused_surface)
-       focusclient(focustop(selmon), 1);
+       focusclient(focustop(selmon, 0), 1);
    motionnotify(0, NULL, 0, 0, 0, 0);
 }

@@ -3176,10 +3663,16 @@ unmapnotify(struct wl_listener *listener, void *data)
        grabc = NULL;
    }

+   if (c->swallowing) {
+       swallow(c, NULL);
+   } else if (c->swallowedby) {
+       swallow(c->swallowedby, NULL);
+   }
+
    if (client_is_unmanaged(c)) {
        if (c == exclusive_focus) {
            exclusive_focus = NULL;
-           focusclient(focustop(selmon), 1);
+           focusclient(focustop(selmon, 0), 1);
        }
    } else {
        wl_list_remove(&c->link);
@@ -3260,8 +3753,8 @@ updatemons(struct wl_listener *listener, void *data)
        /* Don't move clients to the left output when plugging monitors */
        arrange(m);
        /* make sure fullscreen clients have the right size */
-       if ((c = focustop(m)) && c->isfullscreen)
-           resize(c, m->m, 0);
+       if ((c = focustop(m, 0)) && c->isfullscreen)
+           resize(c, m->m, 0, 0);

        /* Try to re-set the gamma LUT when updating monitors,
         * it's only really needed when enabling a disabled output, but meh. */
@@ -3280,7 +3773,7 @@ updatemons(struct wl_listener *listener, void *data)
            if (!c->mon && client_surface(c)->mapped)
                setmon(c, selmon, c->tags);
        }
-       focusclient(focustop(selmon), 1);
+       focusclient(focustop(selmon, 0), 1);
        if (selmon->lock_surface) {
            client_notify_enter(selmon->lock_surface->surface,
                    wlr_seat_get_keyboard(seat));
@@ -3334,16 +3827,15 @@ updatebar(Monitor *m)

    m->b.scale = m->wlr_output->scale;
    m->lrpad = m->drw->font->height;
-   m->b.height = m->drw->font->height + 13;
+   m->b.height = m->drw->font->height + 2;
    m->b.real_height = (int)((float)m->b.height / m->wlr_output->scale);
-
 }

 void
 updatetitle(struct wl_listener *listener, void *data)
 {
    Client *c = wl_container_of(listener, c, set_title);
-   if (c == focustop(c->mon))
+   if (c == focustop(c->mon,0))
        drawbars();
 }

@@ -3353,7 +3845,7 @@ urgent(struct wl_listener *listener, void *data)
    struct wlr_xdg_activation_v1_request_activate_event *event = data;
    Client *c = NULL;
    toplevel_from_wlr_surface(event->surface, &c, NULL);
-   if (!c || c == focustop(selmon))
+   if (!c || c == focustop(selmon, 0))
        return;

    c->isurgent = 1;
@@ -3371,7 +3863,7 @@ view(const Arg *arg)
    selmon->seltags ^= 1; /* toggle sel tagset */
    if (arg->ui & TAGMASK)
        selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
-   focusclient(focustop(selmon), 1);
+   focusclient(focustop(selmon, 0), 1);
    arrange(selmon);
    drawbars();
 }
@@ -3420,6 +3912,15 @@ warpcursor(const Client *c) {
              NULL,
              c->geom.x + c->geom.width / 2.0,
              c->geom.y + c->geom.height / 2.0);
+
+   // cursorwarptohint();
+   // wlr_seat_pointer_notify_frame(seat);
+
+   // wlr_cursor_warp_closest(cursor,
+   //    NULL,
+   //    selmon->w.x + selmon->w.width / 2.0 ,
+   //    selmon->w.y + selmon->w.height / 2.0);
+
 }

 Monitor *
@@ -3467,7 +3968,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
 void
 zoom(const Arg *arg)
 {
-   Client *c, *sel = focustop(selmon);
+   Client *c, *sel = focustop(selmon, 0);

    if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating)
        return;
@@ -3536,7 +4037,7 @@ configurex11(struct wl_listener *listener, void *data)
    if ((c->isfloating && c != grabc) || !c->mon->lt[c->mon->sellt]->arrange) {
        resize(c, (struct wlr_box){.x = event->x - c->bw,
                .y = event->y - c->bw, .width = event->width + c->bw * 2,
-               .height = event->height + c->bw * 2}, 0);
+               .height = event->height + c->bw * 2}, 0, 1);
    } else {
        arrange(c->mon);
    }
@@ -3578,7 +4079,7 @@ sethints(struct wl_listener *listener, void *data)
 {
    Client *c = wl_container_of(listener, c, set_hints);
    struct wlr_surface *surface = client_surface(c);
-   if (c == focustop(selmon) || !c->surface.xwayland->hints)
+   if (c == focustop(selmon, 0) || !c->surface.xwayland->hints)
        return;

    c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
@@ -3628,6 +4129,7 @@ main(int argc, char *argv[])
    if (!getenv("XDG_RUNTIME_DIR"))
        die("XDG_RUNTIME_DIR must be set");
    setup();
+   if (refresh_colors) reload_colors(0);
    run(startup_cmd);
    cleanup();
    return EXIT_SUCCESS;
diff --git a/dwl.desktop b/dwl/dwl.desktop
similarity index 100%
rename from dwl.desktop
rename to dwl/dwl.desktop
diff --git a/dwl/patches/alwayscenter/README.md b/dwl/patches/alwayscenter/README.md
new file mode 100644
index 0000000..fae39be
--- /dev/null
+++ b/dwl/patches/alwayscenter/README.md
@@ -0,0 +1,9 @@
+### Description
+Automatically center floating windows.
+
+### Download
+- [git branch](https://codeberg.org/guidocella/dwl/src/branch/alwayscenter)
+- [2026-01-15](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/alwayscenter/alwayscenter.patch)
+
+### Authors
+- [Guido Cella](https://codeberg.org/guidocella)
diff --git a/dwl/patches/alwayscenter/alwayscenter.patch b/dwl/patches/alwayscenter/alwayscenter.patch
new file mode 100644
index 0000000..962745d
--- /dev/null
+++ b/dwl/patches/alwayscenter/alwayscenter.patch
@@ -0,0 +1,25 @@
+From 48110f0443c8e1ddcd56b6fed5da46535024919c Mon Sep 17 00:00:00 2001
+From: Guido Cella <guido@guidocella.xyz>
+Date: Tue, 13 Jan 2026 21:17:22 +0100
+Subject: [PATCH] center floating windows
+
+---
+ dwl.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/dwl.c b/dwl.c
+index 44f3ad9..72714f8 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -2414,6 +2414,8 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
+       /* Make sure window actually overlaps with the monitor */
+       resize(c, c->geom, 0);
+       c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
++      c->prev.x = (m->w.width - c->prev.width) / 2 + m->m.x;
++      c->prev.y = (m->w.height - c->prev.height) / 2 + m->m.y;
+       setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
+       setfloating(c, c->isfloating);
+   }
+-- 
+2.52.0
+
diff --git a/dwl/patches/bar-notitle/README.md b/dwl/patches/bar-notitle/README.md
new file mode 100644
index 0000000..5203c86
--- /dev/null
+++ b/dwl/patches/bar-notitle/README.md
@@ -0,0 +1,14 @@
+### Description
+Add a `window_title` option to toggle showing window titles in the bar, similar to the DWM `notitle` patch.
+
+### Dependencies
+this patch depends on [bar](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar/) patch
+
+### Download
+- [git branch](/pi66/dwl-patches/src/branch/bar-notitle) 
+- [0.7](/dwl/dwl-patches/raw/branch/main/patches/bar-notitle/bar-notitle.patch)
+- [main 2026-02-28](/dwl/dwl-patches/raw/branch/main/patches/bar-notitle/bar-notitle.patch)
+
+### Authors
+- [Pi66](https://codeberg.org/pi66)
+  [website](https://pi66.xyz)
diff --git a/dwl/patches/bar-notitle/bar-notitle.patch b/dwl/patches/bar-notitle/bar-notitle.patch
new file mode 100644
index 0000000..0914806
--- /dev/null
+++ b/dwl/patches/bar-notitle/bar-notitle.patch
@@ -0,0 +1,38 @@
+From 5dc83d75ff1b7dadf1fd1f96fe2303848e35d382 Mon Sep 17 00:00:00 2001
+From: pi66 <pixel2176@proton.me>
+Date: Sat, 28 Feb 2026 20:26:28 +0100
+Subject: [PATCH] add window_title option (like dwm notitle patch)
+
+---
+ config.def.h | 1 +
+ dwl.c        | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index 7da50d2..3d3dfe8 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -7,6 +7,7 @@
+ 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 window_title              = 0;  /* 1 means showing window titles on the bar */
+ 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"};
+diff --git a/dwl.c b/dwl.c
+index 7fe9468..0c7262a 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -1614,7 +1614,7 @@ drawbar(Monitor *m)
+   x = drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, m->ltsymbol, 0);
+ 
+   if ((w = m->b.width - tw - x) > m->b.height) {
+-      if (c) {
++      if (c && window_title) {
+           drwl_setscheme(m->drw, colors[m == selmon ? SchemeSel : SchemeNorm]);
+           drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
+           if (c && c->isfloating)
+-- 
+2.52.0
+
diff --git a/dwl/patches/bar-recolr/README.md b/dwl/patches/bar-recolr/README.md
new file mode 100644
index 0000000..0b6367a
--- /dev/null
+++ b/dwl/patches/bar-recolr/README.md
@@ -0,0 +1,16 @@
+# Description 
+Reload colorscheme on the fly without restart or recompile DWL.
+
+> NOTE:
+The patch works on (main 2025-11-01) and v0.7
+
+# Dependencies
+this patch depends on [bar](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar/) patch
+
+# Download
+- [git branch](https://codeberg.org/pi66/dwl-patches/raw/branch/main/patches/bar-recolr/bar-recolr.patch)
+- [main 2025-11-01](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/bar-recolr/bar-recolr.patch)
+- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/bar-recolr/bar-recolr.patch)
+
+# Authors
+- [pi66](https://pi66.xyz)
diff --git a/dwl/patches/bar-recolr/bar-recolr.patch b/dwl/patches/bar-recolr/bar-recolr.patch
new file mode 100644
index 0000000..f028f82
--- /dev/null
+++ b/dwl/patches/bar-recolr/bar-recolr.patch
@@ -0,0 +1,80 @@
+From 89029325be300f03bbc3ca3b2d77f107d0cb5ca2 Mon Sep 17 00:00:00 2001
+From: pi66 <pixel2176@proton.me>
+Date: Tue, 25 Nov 2025 12:53:36 +0100
+Subject: [PATCH] Add: load colors from an external file
+
+---
+ config.def.h |  3 +++
+ dwl.c        | 21 +++++++++++++++++++++
+ 2 files changed, 24 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 1b7472d..3c04759 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -9,6 +9,8 @@ static const int bypass_surface_visibility = 0;  /* 1 means idle inhibitors will
+ static const unsigned int borderpx         = 1;  /* border pixel of windows */
+ static const int showbar                   = 1; /* 0 means no bar */
+ static const int topbar                    = 1; /* 0 means bottom bar */
++static const int refresh_colors            = 0; /* 1 means reloading colors when the session starts*/
++static const char *colors_file             = "/home/pixel/.cache/wal/dwl-colors"; /* change the username */
+ 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 */
+@@ -135,6 +137,7 @@ static const Key keys[] = {
+   { 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_n,          reload_colors,  {0} },
+   { MODKEY,                    XKB_KEY_k,          focusstack,     {.i = -1} },
+   { MODKEY,                    XKB_KEY_i,          incnmaster,     {.i = +1} },
+   { MODKEY,                    XKB_KEY_d,          incnmaster,     {.i = -1} },
+diff --git a/dwl.c b/dwl.c
+index bf340d8..fc81d89 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -345,6 +345,7 @@ static void pointerfocus(Client *c, struct wlr_surface *surface,
+       double sx, double sy, uint32_t time);
+ static void powermgrsetmode(struct wl_listener *listener, void *data);
+ static void quit(const Arg *arg);
++static void reload_colors(const Arg *arg);
+ static void rendermon(struct wl_listener *listener, void *data);
+ static void requestdecorationmode(struct wl_listener *listener, void *data);
+ static void requeststartdrag(struct wl_listener *listener, void *data);
+@@ -2348,6 +2349,25 @@ quit(const Arg *arg)
+   wl_display_terminate(dpy);
+ }
+ 
++void
++reload_colors(const Arg *arg)
++{
++    FILE *f = fopen(colors_file, "r");
++    if (!f) return;
++
++    for (int i = 0; i < (int)LENGTH(colors); i++) {
++        unsigned int fg, bg, border;
++        if (fscanf(f, "%x %x %x", &fg, &bg, &border) != 3)
++            break;
++
++        colors[i][ColFg]    = fg;
++        colors[i][ColBg]    = bg;
++        colors[i][ColBorder] = border;
++    }
++  fclose(f);
++    drawbars();
++}
++
+ void
+ rendermon(struct wl_listener *listener, void *data)
+ {
+@@ -3482,6 +3502,7 @@ main(int argc, char *argv[])
+   if (!getenv("XDG_RUNTIME_DIR"))
+       die("XDG_RUNTIME_DIR must be set");
+   setup();
++  if (refresh_colors) reload_colors(0);
+   run(startup_cmd);
+   cleanup();
+   return EXIT_SUCCESS;
+-- 
+2.51.2
+
diff --git a/dwl/patches/bar/README.md b/dwl/patches/bar/README.md
new file mode 100644
index 0000000..5fedeeb
--- /dev/null
+++ b/dwl/patches/bar/README.md
@@ -0,0 +1,34 @@
+### Description
+
+Add a bar identical to dwm's bar.
+
+To use a status-bar, you can pass in status text via stdin:
+```
+slstatus -s | dwl
+```
+
+### Dependencies
+* tllist (build dependency, required & pulled automatically by fcft)
+* fcft
+* pixman
+
+### Download
+- [main 2026-01-05](/dwl/dwl-patches/raw/branch/main/patches/bar/bar.patch)
+- [0.7](/dwl/dwl-patches/raw/branch/main/patches/bar/bar-0.7.patch)
+- [0.6](/dwl/dwl-patches/raw/branch/main/patches/bar/bar-0.6.patch)
+
+It is required to remove, regenerate or update `config.h` after applying the patch,
+since it makes changes to the configuration structure.
+For example, in the `pertag` patch, `TAGCOUNT` must be replaced with `LENGTH(tags)`.
+
+Below is a preview of the patch.
+
+![bar patch preview](bar.png)
+
+### Authors
+- [sewn](https://codeberg.org/sewn)
+
+### Credits
+- [MadcowOG](https://github.com/MadcowOG)
+- [kolumni](https://github.com/kolunmi/dwlb)
+
diff --git a/dwl/patches/bar/bar-0.6.patch b/dwl/patches/bar/bar-0.6.patch
new file mode 100644
index 0000000..70c9f12
--- /dev/null
+++ b/dwl/patches/bar/bar-0.6.patch
@@ -0,0 +1,1245 @@
+From 85e40afc2ad8acba453ce8c57233542e340c1c2b Mon Sep 17 00:00:00 2001
+From: sewn <sewn@disroot.org>
+Date: Fri, 23 Aug 2024 09:42:04 +0300
+Subject: [PATCH] Implement dwm bar clone
+
+---
+ Makefile     |   2 +-
+ config.def.h |  31 +++-
+ drwl.h       | 311 ++++++++++++++++++++++++++++++++++++
+ dwl.c        | 442 +++++++++++++++++++++++++++++++++++++++++----------
+ 4 files changed, 691 insertions(+), 95 deletions(-)
+ create mode 100644 drwl.h
+
+diff --git a/Makefile b/Makefile
+index 0d651e7..2a11396 100644
+--- a/Makefile
++++ b/Makefile
+@@ -12,7 +12,7 @@ DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement \
+   -Wfloat-conversion
+ 
+ # CFLAGS / LDFLAGS
+-PKGS      = wlroots wayland-server xkbcommon libinput $(XLIBS)
++PKGS      = wlroots wayland-server xkbcommon libinput pixman-1 fcft $(XLIBS)
+ DWLCFLAGS = `<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>P</mi><mi>K</mi><msub><mi>G</mi><mi>C</mi></msub><mi>O</mi><mi>N</mi><mi>F</mi><mi>I</mi><mi>G</mi><mo stretchy="false">&#x00029;</mo><mo>&#x02212;</mo><mo>&#x02212;</mo><mi>c</mi><mi>f</mi><mi>l</mi><mi>a</mi><mi>g</mi><mi>s</mi></mrow></math>(PKGS)` <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>D</mi><mi>W</mi><mi>L</mi><mi>C</mi><mi>P</mi><mi>P</mi><mi>F</mi><mi>L</mi><mi>A</mi><mi>G</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo></mrow></math>(DWLDEVCFLAGS) $(CFLAGS)
+ LDLIBS    = `<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>P</mi><mi>K</mi><msub><mi>G</mi><mi>C</mi></msub><mi>O</mi><mi>N</mi><mi>F</mi><mi>I</mi><mi>G</mi><mo stretchy="false">&#x00029;</mo><mo>&#x02212;</mo><mo>&#x02212;</mo><mi>l</mi><mi>i</mi><mi>b</mi><mi>s</mi></mrow></math>(PKGS)` -lm $(LIBS)
+ 
+diff --git a/config.def.h b/config.def.h
+index 22d2171..5d1dc2b 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -7,15 +7,21 @@
+ 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 float rootcolor[]             = COLOR(0x222222ff);
+-static const float bordercolor[]           = COLOR(0x444444ff);
+-static const float focuscolor[]            = COLOR(0x005577ff);
+-static const float urgentcolor[]           = COLOR(0xff0000ff);
++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 - TAGCOUNT must be no greater than 31 */
+-#define TAGCOUNT (9)
++static char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+ 
+ /* logging */
+ static int log_level = WLR_ERROR;
+@@ -127,6 +133,7 @@ static const Key keys[] = {
+   /* 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} },
+@@ -170,7 +177,15 @@ static const Key keys[] = {
+ };
+ 
+ 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} },
+ };
+diff --git a/drwl.h b/drwl.h
+new file mode 100644
+index 0000000..b06a736
+--- /dev/null
++++ b/drwl.h
+@@ -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();
++}
+diff --git a/dwl.c b/dwl.c
+index 145fd01..ab1bc31 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -5,6 +5,7 @@
+ #include <libinput.h>
+ #include <linux/input-event-codes.h>
+ #include <math.h>
++#include <libdrm/drm_fourcc.h>
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -57,6 +58,7 @@
+ #include <wlr/types/wlr_xdg_decoration_v1.h>
+ #include <wlr/types/wlr_xdg_output_v1.h>
+ #include <wlr/types/wlr_xdg_shell.h>
++#include <wlr/interfaces/wlr_buffer.h>
+ #include <wlr/util/log.h>
+ #include <wlr/util/region.h>
+ #include <xkbcommon/xkbcommon.h>
+@@ -67,6 +69,7 @@
+ #endif
+ 
+ #include "util.h"
++#include "drwl.h"
+ 
+ /* macros */
+ #define MAX(A, B)               ((A) > (B) ? (A) : (B))
+@@ -75,14 +78,17 @@
+ #define VISIBLEON(C, M)         ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
+ #define LENGTH(X)               (sizeof X / sizeof X[0])
+ #define END(A)                  ((A) + LENGTH(A))
+-#define TAGMASK                 ((1u << TAGCOUNT) - 1)
++#define TAGMASK                 ((1u << LENGTH(tags)) - 1)
+ #define LISTEN(E, L, H)         wl_signal_add((E), ((L)->notify = (H), (L)))
+ #define LISTEN_STATIC(E, H)     do { static struct wl_listener _l = {.notify = (H)}; wl_signal_add((E), &_l); } while (0)
++#define TEXTW(mon, text)        (drwl_font_getwidth(mon->drw, text) + mon->lrpad)
+ 
+ /* enums */
++enum { SchemeNorm, SchemeSel, SchemeUrg }; /* color schemes */
+ enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
+ enum { XDGShell, LayerShell, X11 }; /* client types */
+ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock, NUM_LAYERS }; /* scene layers */
++enum { ClkTagBar, ClkLtSymbol, ClkStatus, ClkTitle, ClkClient, ClkRoot }; /* clicks */
+ #ifdef XWAYLAND
+ enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
+   NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
+@@ -96,6 +102,7 @@ typedef union {
+ } Arg;
+ 
+ typedef struct {
++  unsigned int click;
+   unsigned int mod;
+   unsigned int button;
+   void (*func)(const Arg *);
+@@ -185,10 +192,19 @@ typedef struct {
+   void (*arrange)(Monitor *);
+ } Layout;
+ 
++typedef struct {
++  struct wlr_buffer base;
++  struct wl_listener release;
++  bool busy;
++  Img *image;
++  uint32_t data[];
++} Buffer;
++
+ struct Monitor {
+   struct wl_list link;
+   struct wlr_output *wlr_output;
+   struct wlr_scene_output *scene_output;
++  struct wlr_scene_buffer *scene_buffer; /* bar buffer */
+   struct wlr_scene_rect *fullscreen_bg; /* See createmon() for info */
+   struct wl_listener frame;
+   struct wl_listener destroy;
+@@ -196,6 +212,11 @@ struct Monitor {
+   struct wl_listener destroy_lock_surface;
+   struct wlr_session_lock_surface_v1 *lock_surface;
+   struct wlr_box m; /* monitor area, layout-relative */
++  struct {
++      int width, height;
++      int real_width, real_height; /* non-scaled */
++      float scale;
++  } b; /* bar area */
+   struct wlr_box w; /* window area, layout-relative */
+   struct wl_list layers[4]; /* LayerSurface.link */
+   const Layout *lt[2];
+@@ -207,6 +228,9 @@ struct Monitor {
+   int nmaster;
+   char ltsymbol[16];
+   int asleep;
++  Drwl *drw;
++  Buffer *pool[2];
++  int lrpad;
+ };
+ 
+ typedef struct {
+@@ -249,6 +273,13 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
+       struct wlr_box *usable_area, int exclusive);
+ static void arrangelayers(Monitor *m);
+ static void axisnotify(struct wl_listener *listener, void *data);
++static bool baracceptsinput(struct wlr_scene_buffer *buffer, double *sx, double *sy);
++static void bufdestroy(struct wlr_buffer *buffer);
++static bool bufdatabegin(struct wlr_buffer *buffer, uint32_t flags,
++      void **data, uint32_t *format, size_t *stride);
++static void bufdataend(struct wlr_buffer *buffer);
++static Buffer *bufmon(Monitor *m);
++static void bufrelease(struct wl_listener *listener, void *data);
+ static void buttonpress(struct wl_listener *listener, void *data);
+ static void chvt(const Arg *arg);
+ static void checkidleinhibitor(struct wlr_surface *exclude);
+@@ -282,6 +313,8 @@ static void destroysessionlock(struct wl_listener *listener, void *data);
+ static void destroysessionmgr(struct wl_listener *listener, void *data);
+ static void destroykeyboardgroup(struct wl_listener *listener, void *data);
+ static Monitor *dirtomon(enum wlr_direction dir);
++static void drawbar(Monitor *m);
++static void drawbars(void);
+ static void focusclient(Client *c, int lift);
+ static void focusmon(const Arg *arg);
+ static void focusstack(const Arg *arg);
+@@ -309,7 +342,6 @@ static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int
+ static void outputmgrtest(struct wl_listener *listener, void *data);
+ static void pointerfocus(Client *c, struct wlr_surface *surface,
+       double sx, double sy, uint32_t time);
+-static void printstatus(void);
+ static void powermgrsetmode(struct wl_listener *listener, void *data);
+ static void quit(const Arg *arg);
+ static void rendermon(struct wl_listener *listener, void *data);
+@@ -331,9 +363,11 @@ static void setsel(struct wl_listener *listener, void *data);
+ static void setup(void);
+ static void spawn(const Arg *arg);
+ static void startdrag(struct wl_listener *listener, void *data);
++static int statusin(int fd, unsigned int mask, void *data);
+ static void tag(const Arg *arg);
+ static void tagmon(const Arg *arg);
+ static void tile(Monitor *m);
++static void togglebar(const Arg *arg);
+ static void togglefloating(const Arg *arg);
+ static void togglefullscreen(const Arg *arg);
+ static void toggletag(const Arg *arg);
+@@ -342,6 +376,7 @@ static void unlocksession(struct wl_listener *listener, void *data);
+ static void unmaplayersurfacenotify(struct wl_listener *listener, void *data);
+ static void unmapnotify(struct wl_listener *listener, void *data);
+ static void updatemons(struct wl_listener *listener, void *data);
++static void updatebar(Monitor *m);
+ static void updatetitle(struct wl_listener *listener, void *data);
+ static void urgent(struct wl_listener *listener, void *data);
+ static void view(const Arg *arg);
+@@ -408,6 +443,15 @@ static struct wlr_box sgeom;
+ static struct wl_list mons;
+ static Monitor *selmon;
+ 
++static char stext[256];
++static struct wl_event_source *status_event_source;
++
++static const struct wlr_buffer_impl buffer_impl = {
++    .destroy = bufdestroy,
++    .begin_data_ptr_access = bufdatabegin,
++    .end_data_ptr_access = bufdataend,
++};
++
+ #ifdef XWAYLAND
+ static void activatex11(struct wl_listener *listener, void *data);
+ static void associatex11(struct wl_listener *listener, void *data);
+@@ -548,6 +592,11 @@ arrangelayers(Monitor *m)
+   if (!m->wlr_output->enabled)
+       return;
+ 
++  if (m->scene_buffer->node.enabled) {
++      usable_area.height -= m->b.real_height;
++      usable_area.y += topbar ? m->b.real_height : 0;
++  }
++
+   /* Arrange exclusive surfaces from top->bottom */
+   for (i = 3; i >= 0; i--)
+       arrangelayer(m, &m->layers[i], &usable_area, 1);
+@@ -590,17 +639,102 @@ axisnotify(struct wl_listener *listener, void *data)
+           event->delta_discrete, event->source);
+ }
+ 
++bool
++baracceptsinput(struct wlr_scene_buffer *buffer, double *sx, double *sy)
++{
++  return true;
++}
++
++void
++bufdestroy(struct wlr_buffer *wlr_buffer)
++{
++  Buffer *buf = wl_container_of(wlr_buffer, buf, base);
++  if (buf->busy)
++      wl_list_remove(&buf->release.link);
++  drwl_image_destroy(buf->image);
++  free(buf);
++}
++
++bool
++bufdatabegin(struct wlr_buffer *wlr_buffer, uint32_t flags,
++      void **data, uint32_t *format, size_t *stride)
++{
++  Buffer *buf = wl_container_of(wlr_buffer, buf, base);
++
++  if (flags & WLR_BUFFER_DATA_PTR_ACCESS_WRITE) return false;
++
++  *data   = buf->data;
++  *stride = wlr_buffer->width * 4;
++  *format = DRM_FORMAT_ARGB8888;
++
++  return true;
++}
++
++void
++bufdataend(struct wlr_buffer *wlr_buffer)
++{
++}
++
++Buffer *
++bufmon(Monitor *m)
++{
++  size_t i;
++  Buffer *buf = NULL;
++
++  for (i = 0; i < LENGTH(m->pool); i++) {
++      if (m->pool[i]) {
++          if (m->pool[i]->busy)
++              continue;
++          buf = m->pool[i];
++          break;
++      }
++
++      buf = ecalloc(1, sizeof(Buffer) + (m->b.width * 4 * m->b.height));
++      buf->image = drwl_image_create(NULL, m->b.width, m->b.height, buf->data);
++      wlr_buffer_init(&buf->base, &buffer_impl, m->b.width, m->b.height);
++      m->pool[i] = buf;
++      break;
++  }
++  if (!buf)
++      return NULL;
++
++  buf->busy = true;
++  LISTEN(&buf->base.events.release, &buf->release, bufrelease);
++  wlr_buffer_lock(&buf->base);
++  drwl_setimage(m->drw, buf->image);
++  return buf;
++}
++
++void
++bufrelease(struct wl_listener *listener, void *data)
++{
++  Buffer *buf = wl_container_of(listener, buf, release);
++  buf->busy = false;
++  wl_list_remove(&buf->release.link);
++}
++
+ void
+ buttonpress(struct wl_listener *listener, void *data)
+ {
++  unsigned int i = 0, x = 0;
++  double cx;
++  unsigned int click;
+   struct wlr_pointer_button_event *event = data;
+   struct wlr_keyboard *keyboard;
++  struct wlr_scene_node *node;
++  struct wlr_scene_buffer *buffer;
+   uint32_t mods;
++  Arg arg = {0};
+   Client *c;
+   const Button *b;
+ 
+   wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
+ 
++  click = ClkRoot;
++  xytonode(cursor->x, cursor->y, NULL, &c, NULL, NULL, NULL);
++  if (c)
++      click = ClkClient;
++
+   switch (event->state) {
+   case WLR_BUTTON_PRESSED:
+       cursor_mode = CurPressed;
+@@ -608,17 +742,34 @@ buttonpress(struct wl_listener *listener, void *data)
+       if (locked)
+           break;
+ 
++      if (!c && !exclusive_focus &&
++          (node = wlr_scene_node_at(&layers[LyrBottom]->node, cursor->x, cursor->y, NULL, NULL)) &&
++          (buffer = wlr_scene_buffer_from_node(node)) && buffer == selmon->scene_buffer) {
++          cx = (cursor->x - selmon->m.x) * selmon->wlr_output->scale;
++          do
++              x += TEXTW(selmon, tags[i]);
++          while (cx >= x && ++i < LENGTH(tags));
++          if (i < LENGTH(tags)) {
++              click = ClkTagBar;
++              arg.ui = 1 << i;
++          } else if (cx < x + TEXTW(selmon, selmon->ltsymbol))
++              click = ClkLtSymbol;
++          else if (cx > selmon->b.width - (TEXTW(selmon, stext) - selmon->lrpad + 2)) {
++              click = ClkStatus;
++          } else
++              click = ClkTitle;
++      }
++
+       /* Change focus if the button was _pressed_ over a client */
+       xytonode(cursor->x, cursor->y, NULL, &c, NULL, NULL, NULL);
+-      if (c && (!client_is_unmanaged(c) || client_wants_focus(c)))
++      if (click == ClkClient && (!client_is_unmanaged(c) || client_wants_focus(c)))
+           focusclient(c, 1);
+ 
+       keyboard = wlr_seat_get_keyboard(seat);
+       mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
+       for (b = buttons; b < END(buttons); b++) {
+-          if (CLEANMASK(mods) == CLEANMASK(b->mod) &&
+-                  event->button == b->button && b->func) {
+-              b->func(&b->arg);
++          if (CLEANMASK(mods) == CLEANMASK(b->mod) && event->button == b->button && click == b->click && b->func) {
++              b->func(click == ClkTagBar && b->arg.i == 0 ? &arg : &b->arg);
+               return;
+           }
+       }
+@@ -689,6 +840,8 @@ cleanup(void)
+   /* Destroy after the wayland display (when the monitors are already destroyed)
+      to avoid destroying them with an invalid scene output. */
+   wlr_scene_node_destroy(&scene->tree.node);
++
++  drwl_fini();
+ }
+ 
+ void
+@@ -704,6 +857,12 @@ cleanupmon(struct wl_listener *listener, void *data)
+           wlr_layer_surface_v1_destroy(l->layer_surface);
+   }
+ 
++  for (i = 0; i < LENGTH(m->pool); i++)
++      wlr_buffer_drop(&m->pool[i]->base);
++
++  drwl_setimage(m->drw, NULL);
++  drwl_destroy(m->drw);
++
+   wl_list_remove(&m->destroy.link);
+   wl_list_remove(&m->frame.link);
+   wl_list_remove(&m->link);
+@@ -714,6 +873,7 @@ cleanupmon(struct wl_listener *listener, void *data)
+ 
+   closemon(m);
+   wlr_scene_node_destroy(&m->fullscreen_bg->node);
++  wlr_scene_node_destroy(&m->scene_buffer->node);
+   free(m);
+ }
+ 
+@@ -743,7 +903,7 @@ closemon(Monitor *m)
+           setmon(c, selmon, c->tags);
+   }
+   focusclient(focustop(selmon), 1);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -980,8 +1140,15 @@ createmon(struct wl_listener *listener, void *data)
+   wlr_output_commit_state(wlr_output, &state);
+   wlr_output_state_finish(&state);
+ 
++  if (!(m->drw = drwl_create()))
++      die("failed to create drwl context");
++
++  m->scene_buffer = wlr_scene_buffer_create(layers[LyrBottom], NULL);
++  m->scene_buffer->point_accepts_input = baracceptsinput;
++  updatebar(m);
++
+   wl_list_insert(&mons, &m->link);
+-  printstatus();
++  drawbars();
+ 
+   /* The xdg-protocol specifies:
+    *
+@@ -1312,6 +1479,80 @@ dirtomon(enum wlr_direction dir)
+   return selmon;
+ }
+ 
++void
++drawbar(Monitor *m)
++{
++  int x, w, tw = 0;
++  int boxs = m->drw->font->height / 9;
++  int boxw = m->drw->font->height / 6 + 2;
++  uint32_t i, occ = 0, urg = 0;
++  Client *c;
++  Buffer *buf;
++
++  if (!m->scene_buffer->node.enabled)
++      return;
++  if (!(buf = bufmon(m)))
++      return;
++
++  /* draw status first so it can be overdrawn by tags later */
++  if (m == selmon) { /* status is only drawn on selected monitor */
++      drwl_setscheme(m->drw, colors[SchemeNorm]);
++      tw = TEXTW(m, stext) - m->lrpad + 2; /* 2px right padding */
++      drwl_text(m->drw, m->b.width - tw, 0, tw, m->b.height, 0, stext, 0);
++  }
++
++  wl_list_for_each(c, &clients, link) {
++      if (c->mon != m)
++          continue;
++      occ |= c->tags;
++      if (c->isurgent)
++          urg |= c->tags;
++  }
++  x = 0;
++  c = focustop(m);
++  for (i = 0; i < LENGTH(tags); i++) {
++      w = TEXTW(m, tags[i]);
++      drwl_setscheme(m->drw, colors[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
++      drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, tags[i], urg & 1 << i);
++      if (occ & 1 << i)
++          drwl_rect(m->drw, x + boxs, boxs, boxw, boxw,
++              m == selmon && c && c->tags & 1 << i,
++              urg & 1 << i);
++      x += w;
++  }
++  w = TEXTW(m, m->ltsymbol);
++  drwl_setscheme(m->drw, colors[SchemeNorm]);
++  x = drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, m->ltsymbol, 0);
++
++  if ((w = m->b.width - tw - x) > m->b.height) {
++      if (c) {
++          drwl_setscheme(m->drw, colors[m == selmon ? SchemeSel : SchemeNorm]);
++          drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
++          if (c && c->isfloating)
++              drwl_rect(m->drw, x + boxs, boxs, boxw, boxw, 0, 0);
++      } else {
++          drwl_setscheme(m->drw, colors[SchemeNorm]);
++          drwl_rect(m->drw, x, 0, w, m->b.height, 1, 1);
++      }
++  }
++
++  wlr_scene_buffer_set_dest_size(m->scene_buffer,
++      m->b.real_width, m->b.real_height);
++  wlr_scene_node_set_position(&m->scene_buffer->node, m->m.x,
++      m->m.y + (topbar ? 0 : m->m.height - m->b.real_height));
++  wlr_scene_buffer_set_buffer(m->scene_buffer, &buf->base);
++  wlr_buffer_unlock(&buf->base);
++}
++
++void
++drawbars(void)
++{
++  Monitor *m = NULL;
++
++  wl_list_for_each(m, &mons, link)
++      drawbar(m);
++}
++
+ void
+ focusclient(Client *c, int lift)
+ {
+@@ -1347,13 +1588,13 @@ focusclient(Client *c, int lift)
+       /* Don't change border color if there is an exclusive focus or we are
+        * handling a drag operation */
+       if (!exclusive_focus && !seat->drag)
+-          client_set_border_color(c, focuscolor);
++          client_set_border_color(c, (float[])COLOR(colors[SchemeSel][ColBorder]));
+   }
+ 
+   /* Deactivate old client if focus is changing */
+   if (old && (!c || client_surface(c) != old)) {
+       /* If an overlay is focused, don't focus or activate the client,
+-       * but only update its position in fstack to render its border with focuscolor
++       * but only update its position in fstack to render its border with its color
+        * and focus it after the overlay is closed. */
+       if (old_client_type == LayerShell && wlr_scene_node_coords(
+                   &old_l->scene->node, &unused_lx, &unused_ly)
+@@ -1364,12 +1605,11 @@ focusclient(Client *c, int lift)
+       /* Don't deactivate old client if the new one wants focus, as this causes issues with winecfg
+        * and probably other clients */
+       } else if (old_c && !client_is_unmanaged(old_c) && (!c || !client_wants_focus(c))) {
+-          client_set_border_color(old_c, bordercolor);
+-
++          client_set_border_color(old_c, (float[])COLOR(colors[SchemeNorm][ColBorder]));
+           client_activate_surface(old, 0);
+       }
+   }
+-  printstatus();
++  drawbars();
+ 
+   if (!c) {
+       /* With no client, all we have left is to clear focus */
+@@ -1666,7 +1906,7 @@ mapnotify(struct wl_listener *listener, void *data)
+ 
+   for (i = 0; i < 4; i++) {
+       c->border[i] = wlr_scene_rect_create(c->scene, 0, 0,
+-              c->isurgent ? urgentcolor : bordercolor);
++          (float[])COLOR(colors[c->isurgent ? SchemeUrg : SchemeNorm][ColBorder]));
+       c->border[i]->node.data = c;
+   }
+ 
+@@ -1689,7 +1929,7 @@ mapnotify(struct wl_listener *listener, void *data)
+   } else {
+       applyrules(c);
+   }
+-  printstatus();
++  drawbars();
+ 
+ unset_fullscreen:
+   m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y);
+@@ -1982,46 +2222,6 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
+   wlr_seat_pointer_notify_motion(seat, time, sx, sy);
+ }
+ 
+-void
+-printstatus(void)
+-{
+-  Monitor *m = NULL;
+-  Client *c;
+-  uint32_t occ, urg, sel;
+-  const char *appid, *title;
+-
+-  wl_list_for_each(m, &mons, link) {
+-      occ = urg = 0;
+-      wl_list_for_each(c, &clients, link) {
+-          if (c->mon != m)
+-              continue;
+-          occ |= c->tags;
+-          if (c->isurgent)
+-              urg |= c->tags;
+-      }
+-      if ((c = focustop(m))) {
+-          title = client_get_title(c);
+-          appid = client_get_appid(c);
+-          printf("%s title %s\n", m->wlr_output->name, title ? title : broken);
+-          printf("%s appid %s\n", m->wlr_output->name, appid ? appid : broken);
+-          printf("%s fullscreen %d\n", m->wlr_output->name, c->isfullscreen);
+-          printf("%s floating %d\n", m->wlr_output->name, c->isfloating);
+-          sel = c->tags;
+-      } else {
+-          printf("%s title \n", m->wlr_output->name);
+-          printf("%s appid \n", m->wlr_output->name);
+-          printf("%s fullscreen \n", m->wlr_output->name);
+-          printf("%s floating \n", m->wlr_output->name);
+-          sel = 0;
+-      }
+-
+-      printf("%s selmon %u\n", m->wlr_output->name, m == selmon);
+-      printf("%s tags %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32"\n",
+-          m->wlr_output->name, occ, m->tagset[m->seltags], sel, urg);
+-      printf("%s layout %s\n", m->wlr_output->name, m->ltsymbol);
+-  }
+-  fflush(stdout);
+-}
+ 
+ void
+ powermgrsetmode(struct wl_listener *listener, void *data)
+@@ -2175,30 +2375,17 @@ run(char *startup_cmd)
+ 
+   /* Now that the socket exists and the backend is started, run the startup command */
+   if (startup_cmd) {
+-      int piperw[2];
+-      if (pipe(piperw) < 0)
+-          die("startup: pipe:");
+       if ((child_pid = fork()) < 0)
+           die("startup: fork:");
+       if (child_pid == 0) {
++          close(STDIN_FILENO);
+           setsid();
+-          dup2(piperw[0], STDIN_FILENO);
+-          close(piperw[0]);
+-          close(piperw[1]);
+           execl("/bin/sh", "/bin/sh", "-c", startup_cmd, NULL);
+           die("startup: execl:");
+       }
+-      dup2(piperw[1], STDOUT_FILENO);
+-      close(piperw[1]);
+-      close(piperw[0]);
+   }
+ 
+-  /* Mark stdout as non-blocking to avoid people who does not close stdin
+-   * nor consumes it in their startup script getting dwl frozen */
+-  if (fd_set_nonblock(STDOUT_FILENO) < 0)
+-      close(STDOUT_FILENO);
+-
+-  printstatus();
++  drawbars();
+ 
+   /* At this point the outputs are initialized, choose initial selmon based on
+    * cursor position, and set default cursor image */
+@@ -2262,7 +2449,7 @@ setfloating(Client *c, int floating)
+   wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen
+           ? LyrFS : c->isfloating ? LyrFloat : LyrTile]);
+   arrange(c->mon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2285,7 +2472,7 @@ setfullscreen(Client *c, int fullscreen)
+       resize(c, c->prev, 0);
+   }
+   arrange(c->mon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2310,7 +2497,7 @@ setlayout(const Arg *arg)
+       selmon->lt[selmon->sellt] = (Layout *)arg->v;
+   strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol));
+   arrange(selmon);
+-  printstatus();
++  drawbar(selmon);
+ }
+ 
+ /* arg > 1.0 will set mfact absolutely */
+@@ -2383,6 +2570,7 @@ setup(void)
+   for (i = 0; i < (int)LENGTH(sig); i++)
+       sigaction(sig[i], &sa, NULL);
+ 
++
+   wlr_log_init(log_level, NULL);
+ 
+   /* The Wayland display is managed by libwayland. It handles accepting
+@@ -2569,6 +2757,11 @@ setup(void)
+ 
+   wlr_scene_set_presentation(scene, wlr_presentation_create(dpy, backend));
+ 
++  drwl_init();
++
++  status_event_source = wl_event_loop_add_fd(wl_display_get_event_loop(dpy),
++      STDIN_FILENO, WL_EVENT_READABLE, statusin, NULL);
++
+   /* Make sure XWayland clients don't connect to the parent X server,
+    * e.g when running in the x11 backend or the wayland backend and the
+    * compositor has Xwayland support */
+@@ -2593,6 +2786,7 @@ void
+ spawn(const Arg *arg)
+ {
+   if (fork() == 0) {
++      close(STDIN_FILENO);
+       dup2(STDERR_FILENO, STDOUT_FILENO);
+       setsid();
+       execvp(((char **)arg->v)[0], (char **)arg->v);
+@@ -2611,6 +2805,30 @@ startdrag(struct wl_listener *listener, void *data)
+   LISTEN_STATIC(&drag->icon->events.destroy, destroydragicon);
+ }
+ 
++int
++statusin(int fd, unsigned int mask, void *data)
++{
++  char status[1024];
++  ssize_t n;
++
++  if (mask & WL_EVENT_ERROR)
++      die("status in event error");
++  if (mask & WL_EVENT_HANGUP)
++      wl_event_source_remove(status_event_source);
++
++  n = read(fd, status, sizeof(status) - 1);
++  if (n < 0 && errno != EWOULDBLOCK)
++      die("read:");
++
++  status[n] = '\0';
++  status[strcspn(status, "\n")] = '\0';
++
++  strncpy(stext, status, sizeof(stext));
++  drawbars();
++
++  return 0;
++}
++
+ void
+ tag(const Arg *arg)
+ {
+@@ -2621,7 +2839,7 @@ tag(const Arg *arg)
+   sel->tags = arg->ui & TAGMASK;
+   focusclient(focustop(selmon), 1);
+   arrange(selmon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2666,6 +2884,14 @@ tile(Monitor *m)
+   }
+ }
+ 
++void
++togglebar(const Arg *arg)
++{
++  wlr_scene_node_set_enabled(&selmon->scene_buffer->node,
++      !selmon->scene_buffer->node.enabled);
++  arrangelayers(selmon);
++}
++
+ void
+ togglefloating(const Arg *arg)
+ {
+@@ -2694,7 +2920,7 @@ toggletag(const Arg *arg)
+   sel->tags = newtags;
+   focusclient(focustop(selmon), 1);
+   arrange(selmon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2707,7 +2933,7 @@ toggleview(const Arg *arg)
+   selmon->tagset[selmon->seltags] = newtagset;
+   focusclient(focustop(selmon), 1);
+   arrange(selmon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2755,7 +2981,7 @@ unmapnotify(struct wl_listener *listener, void *data)
+   }
+ 
+   wlr_scene_node_destroy(&c->scene->node);
+-  printstatus();
++  drawbars();
+   motionnotify(0, NULL, 0, 0, 0, 0);
+ }
+ 
+@@ -2855,6 +3081,13 @@ updatemons(struct wl_listener *listener, void *data)
+       }
+   }
+ 
++  if (stext[0] == '\0')
++      strncpy(stext, "dwl-"VERSION, sizeof(stext));
++  wl_list_for_each(m, &mons, link) {
++      updatebar(m);
++      drawbar(m);
++  }
++
+   /* FIXME: figure out why the cursor image is at 0,0 after turning all
+    * the monitors on.
+    * Move the cursor image where it used to be. It does not generate a
+@@ -2865,12 +3098,45 @@ updatemons(struct wl_listener *listener, void *data)
+   wlr_output_manager_v1_set_configuration(output_mgr, config);
+ }
+ 
++void
++updatebar(Monitor *m)
++{
++  size_t i;
++  int rw, rh;
++  char fontattrs[12];
++
++  wlr_output_transformed_resolution(m->wlr_output, &rw, &rh);
++  m->b.width = rw;
++  m->b.real_width = (int)((float)m->b.width / m->wlr_output->scale);
++
++  wlr_scene_node_set_enabled(&m->scene_buffer->node, m->wlr_output->enabled ? showbar : 0);
++
++  for (i = 0; i < LENGTH(m->pool); i++)
++      if (m->pool[i]) {
++          wlr_buffer_drop(&m->pool[i]->base);
++          m->pool[i] = NULL;
++      }
++
++  if (m->b.scale == m->wlr_output->scale && m->drw)
++      return;
++
++  drwl_font_destroy(m->drw->font);
++  snprintf(fontattrs, sizeof(fontattrs), "dpi=%.2f", 96. * m->wlr_output->scale);
++  if (!(drwl_font_create(m->drw, LENGTH(fonts), fonts, fontattrs)))
++      die("Could not load font");
++
++  m->b.scale = m->wlr_output->scale;
++  m->lrpad = m->drw->font->height;
++  m->b.height = m->drw->font->height + 2;
++  m->b.real_height = (int)((float)m->b.height / m->wlr_output->scale);
++}
++
+ void
+ updatetitle(struct wl_listener *listener, void *data)
+ {
+   Client *c = wl_container_of(listener, c, set_title);
+   if (c == focustop(c->mon))
+-      printstatus();
++      drawbars();
+ }
+ 
+ void
+@@ -2883,10 +3149,10 @@ urgent(struct wl_listener *listener, void *data)
+       return;
+ 
+   c->isurgent = 1;
+-  printstatus();
++  drawbars();
+ 
+   if (client_surface(c)->mapped)
+-      client_set_border_color(c, urgentcolor);
++      client_set_border_color(c, (float[])COLOR(colors[SchemeUrg][ColBorder]));
+ }
+ 
+ void
+@@ -2899,7 +3165,7 @@ view(const Arg *arg)
+       selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
+   focusclient(focustop(selmon), 1);
+   arrange(selmon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2940,6 +3206,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
+ {
+   struct wlr_scene_node *node, *pnode;
+   struct wlr_surface *surface = NULL;
++  struct wlr_scene_surface *scene_surface = NULL;
+   Client *c = NULL;
+   LayerSurface *l = NULL;
+   int layer;
+@@ -2948,9 +3215,12 @@ xytonode(double x, double y, struct wlr_surface **psurface,
+       if (!(node = wlr_scene_node_at(&layers[layer]->node, x, y, nx, ny)))
+           continue;
+ 
+-      if (node->type == WLR_SCENE_NODE_BUFFER)
+-          surface = wlr_scene_surface_try_from_buffer(
+-                  wlr_scene_buffer_from_node(node))->surface;
++      if (node->type == WLR_SCENE_NODE_BUFFER) {
++          scene_surface = wlr_scene_surface_try_from_buffer(
++                  wlr_scene_buffer_from_node(node));
++          if (!scene_surface) continue;
++          surface = scene_surface->surface;
++      }
+       /* Walk the tree to find a node that knows the client */
+       for (pnode = node; pnode && !c; pnode = &pnode->parent->node)
+           c = pnode->data;
+@@ -3089,10 +3359,10 @@ sethints(struct wl_listener *listener, void *data)
+       return;
+ 
+   c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
+-  printstatus();
++  drawbars();
+ 
+   if (c->isurgent && surface && surface->mapped)
+-      client_set_border_color(c, urgentcolor);
++      client_set_border_color(c, (float[])COLOR(colors[SchemeUrg][ColBorder]));
+ }
+ 
+ void
+-- 
+2.46.0
+
diff --git a/dwl/patches/bar/bar-0.7.patch b/dwl/patches/bar/bar-0.7.patch
new file mode 100644
index 0000000..523ca36
--- /dev/null
+++ b/dwl/patches/bar/bar-0.7.patch
@@ -0,0 +1,1245 @@
+From 1431cf1e9e03c8e59050af3b37514a6a2293d71d Mon Sep 17 00:00:00 2001
+From: sewn <sewn@disroot.org>
+Date: Fri, 23 Aug 2024 09:42:04 +0300
+Subject: [PATCH] Implement dwm bar clone
+
+---
+ Makefile     |   2 +-
+ config.def.h |  31 +++-
+ drwl.h       | 311 ++++++++++++++++++++++++++++++++++++
+ dwl.c        | 442 +++++++++++++++++++++++++++++++++++++++++----------
+ 4 files changed, 691 insertions(+), 95 deletions(-)
+ create mode 100644 drwl.h
+
+diff --git a/Makefile b/Makefile
+index 3358bae..9bc67db 100644
+--- a/Makefile
++++ b/Makefile
+@@ -12,7 +12,7 @@ DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement \
+   -Wfloat-conversion
+ 
+ # CFLAGS / LDFLAGS
+-PKGS      = wlroots-0.18 wayland-server xkbcommon libinput $(XLIBS)
++PKGS      = wlroots-0.18 wayland-server xkbcommon libinput pixman-1 fcft $(XLIBS)
+ DWLCFLAGS = `<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>P</mi><mi>K</mi><msub><mi>G</mi><mi>C</mi></msub><mi>O</mi><mi>N</mi><mi>F</mi><mi>I</mi><mi>G</mi><mo stretchy="false">&#x00029;</mo><mo>&#x02212;</mo><mo>&#x02212;</mo><mi>c</mi><mi>f</mi><mi>l</mi><mi>a</mi><mi>g</mi><mi>s</mi></mrow></math>(PKGS)` <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>D</mi><mi>W</mi><mi>L</mi><mi>C</mi><mi>P</mi><mi>P</mi><mi>F</mi><mi>L</mi><mi>A</mi><mi>G</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo></mrow></math>(DWLDEVCFLAGS) $(CFLAGS)
+ LDLIBS    = `<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>P</mi><mi>K</mi><msub><mi>G</mi><mi>C</mi></msub><mi>O</mi><mi>N</mi><mi>F</mi><mi>I</mi><mi>G</mi><mo stretchy="false">&#x00029;</mo><mo>&#x02212;</mo><mo>&#x02212;</mo><mi>l</mi><mi>i</mi><mi>b</mi><mi>s</mi></mrow></math>(PKGS)` -lm $(LIBS)
+ 
+diff --git a/config.def.h b/config.def.h
+index 22d2171..5d1dc2b 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -7,15 +7,21 @@
+ 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 float rootcolor[]             = COLOR(0x222222ff);
+-static const float bordercolor[]           = COLOR(0x444444ff);
+-static const float focuscolor[]            = COLOR(0x005577ff);
+-static const float urgentcolor[]           = COLOR(0xff0000ff);
++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 - TAGCOUNT must be no greater than 31 */
+-#define TAGCOUNT (9)
++static char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+ 
+ /* logging */
+ static int log_level = WLR_ERROR;
+@@ -127,6 +133,7 @@ static const Key keys[] = {
+   /* 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} },
+@@ -170,7 +177,15 @@ static const Key keys[] = {
+ };
+ 
+ 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} },
+ };
+diff --git a/drwl.h b/drwl.h
+new file mode 100644
+index 0000000..b06a736
+--- /dev/null
++++ b/drwl.h
+@@ -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();
++}
+diff --git a/dwl.c b/dwl.c
+index a2711f6..ece537a 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -5,6 +5,7 @@
+ #include <libinput.h>
+ #include <linux/input-event-codes.h>
+ #include <math.h>
++#include <libdrm/drm_fourcc.h>
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -58,6 +59,7 @@
+ #include <wlr/types/wlr_xdg_decoration_v1.h>
+ #include <wlr/types/wlr_xdg_output_v1.h>
+ #include <wlr/types/wlr_xdg_shell.h>
++#include <wlr/interfaces/wlr_buffer.h>
+ #include <wlr/util/log.h>
+ #include <wlr/util/region.h>
+ #include <xkbcommon/xkbcommon.h>
+@@ -68,6 +70,7 @@
+ #endif
+ 
+ #include "util.h"
++#include "drwl.h"
+ 
+ /* macros */
+ #define MAX(A, B)               ((A) > (B) ? (A) : (B))
+@@ -76,14 +79,17 @@
+ #define VISIBLEON(C, M)         ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
+ #define LENGTH(X)               (sizeof X / sizeof X[0])
+ #define END(A)                  ((A) + LENGTH(A))
+-#define TAGMASK                 ((1u << TAGCOUNT) - 1)
++#define TAGMASK                 ((1u << LENGTH(tags)) - 1)
+ #define LISTEN(E, L, H)         wl_signal_add((E), ((L)->notify = (H), (L)))
+ #define LISTEN_STATIC(E, H)     do { static struct wl_listener _l = {.notify = (H)}; wl_signal_add((E), &_l); } while (0)
++#define TEXTW(mon, text)        (drwl_font_getwidth(mon->drw, text) + mon->lrpad)
+ 
+ /* enums */
++enum { SchemeNorm, SchemeSel, SchemeUrg }; /* color schemes */
+ enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
+ enum { XDGShell, LayerShell, X11 }; /* client types */
+ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock, NUM_LAYERS }; /* scene layers */
++enum { ClkTagBar, ClkLtSymbol, ClkStatus, ClkTitle, ClkClient, ClkRoot }; /* clicks */
+ #ifdef XWAYLAND
+ enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
+   NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
+@@ -97,6 +103,7 @@ typedef union {
+ } Arg;
+ 
+ typedef struct {
++  unsigned int click;
+   unsigned int mod;
+   unsigned int button;
+   void (*func)(const Arg *);
+@@ -186,10 +193,19 @@ typedef struct {
+   void (*arrange)(Monitor *);
+ } Layout;
+ 
++typedef struct {
++  struct wlr_buffer base;
++  struct wl_listener release;
++  bool busy;
++  Img *image;
++  uint32_t data[];
++} Buffer;
++
+ struct Monitor {
+   struct wl_list link;
+   struct wlr_output *wlr_output;
+   struct wlr_scene_output *scene_output;
++  struct wlr_scene_buffer *scene_buffer; /* bar buffer */
+   struct wlr_scene_rect *fullscreen_bg; /* See createmon() for info */
+   struct wl_listener frame;
+   struct wl_listener destroy;
+@@ -197,6 +213,11 @@ struct Monitor {
+   struct wl_listener destroy_lock_surface;
+   struct wlr_session_lock_surface_v1 *lock_surface;
+   struct wlr_box m; /* monitor area, layout-relative */
++  struct {
++      int width, height;
++      int real_width, real_height; /* non-scaled */
++      float scale;
++  } b; /* bar area */
+   struct wlr_box w; /* window area, layout-relative */
+   struct wl_list layers[4]; /* LayerSurface.link */
+   const Layout *lt[2];
+@@ -208,6 +229,9 @@ struct Monitor {
+   int nmaster;
+   char ltsymbol[16];
+   int asleep;
++  Drwl *drw;
++  Buffer *pool[2];
++  int lrpad;
+ };
+ 
+ typedef struct {
+@@ -250,6 +274,13 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
+       struct wlr_box *usable_area, int exclusive);
+ static void arrangelayers(Monitor *m);
+ static void axisnotify(struct wl_listener *listener, void *data);
++static bool baracceptsinput(struct wlr_scene_buffer *buffer, double *sx, double *sy);
++static void bufdestroy(struct wlr_buffer *buffer);
++static bool bufdatabegin(struct wlr_buffer *buffer, uint32_t flags,
++      void **data, uint32_t *format, size_t *stride);
++static void bufdataend(struct wlr_buffer *buffer);
++static Buffer *bufmon(Monitor *m);
++static void bufrelease(struct wl_listener *listener, void *data);
+ static void buttonpress(struct wl_listener *listener, void *data);
+ static void chvt(const Arg *arg);
+ static void checkidleinhibitor(struct wlr_surface *exclude);
+@@ -285,6 +316,8 @@ static void destroysessionlock(struct wl_listener *listener, void *data);
+ static void destroysessionmgr(struct wl_listener *listener, void *data);
+ static void destroykeyboardgroup(struct wl_listener *listener, void *data);
+ static Monitor *dirtomon(enum wlr_direction dir);
++static void drawbar(Monitor *m);
++static void drawbars(void);
+ static void focusclient(Client *c, int lift);
+ static void focusmon(const Arg *arg);
+ static void focusstack(const Arg *arg);
+@@ -313,7 +346,6 @@ static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int
+ static void outputmgrtest(struct wl_listener *listener, void *data);
+ static void pointerfocus(Client *c, struct wlr_surface *surface,
+       double sx, double sy, uint32_t time);
+-static void printstatus(void);
+ static void powermgrsetmode(struct wl_listener *listener, void *data);
+ static void quit(const Arg *arg);
+ static void rendermon(struct wl_listener *listener, void *data);
+@@ -335,9 +367,11 @@ static void setsel(struct wl_listener *listener, void *data);
+ static void setup(void);
+ static void spawn(const Arg *arg);
+ static void startdrag(struct wl_listener *listener, void *data);
++static int statusin(int fd, unsigned int mask, void *data);
+ static void tag(const Arg *arg);
+ static void tagmon(const Arg *arg);
+ static void tile(Monitor *m);
++static void togglebar(const Arg *arg);
+ static void togglefloating(const Arg *arg);
+ static void togglefullscreen(const Arg *arg);
+ static void toggletag(const Arg *arg);
+@@ -346,6 +380,7 @@ static void unlocksession(struct wl_listener *listener, void *data);
+ static void unmaplayersurfacenotify(struct wl_listener *listener, void *data);
+ static void unmapnotify(struct wl_listener *listener, void *data);
+ static void updatemons(struct wl_listener *listener, void *data);
++static void updatebar(Monitor *m);
+ static void updatetitle(struct wl_listener *listener, void *data);
+ static void urgent(struct wl_listener *listener, void *data);
+ static void view(const Arg *arg);
+@@ -413,6 +448,15 @@ static struct wlr_box sgeom;
+ static struct wl_list mons;
+ static Monitor *selmon;
+ 
++static char stext[256];
++static struct wl_event_source *status_event_source;
++
++static const struct wlr_buffer_impl buffer_impl = {
++    .destroy = bufdestroy,
++    .begin_data_ptr_access = bufdatabegin,
++    .end_data_ptr_access = bufdataend,
++};
++
+ #ifdef XWAYLAND
+ static void activatex11(struct wl_listener *listener, void *data);
+ static void associatex11(struct wl_listener *listener, void *data);
+@@ -553,6 +597,11 @@ arrangelayers(Monitor *m)
+   if (!m->wlr_output->enabled)
+       return;
+ 
++  if (m->scene_buffer->node.enabled) {
++      usable_area.height -= m->b.real_height;
++      usable_area.y += topbar ? m->b.real_height : 0;
++  }
++
+   /* Arrange exclusive surfaces from top->bottom */
+   for (i = 3; i >= 0; i--)
+       arrangelayer(m, &m->layers[i], &usable_area, 1);
+@@ -595,17 +644,102 @@ axisnotify(struct wl_listener *listener, void *data)
+           event->delta_discrete, event->source, event->relative_direction);
+ }
+ 
++bool
++baracceptsinput(struct wlr_scene_buffer *buffer, double *sx, double *sy)
++{
++  return true;
++}
++
++void
++bufdestroy(struct wlr_buffer *wlr_buffer)
++{
++  Buffer *buf = wl_container_of(wlr_buffer, buf, base);
++  if (buf->busy)
++      wl_list_remove(&buf->release.link);
++  drwl_image_destroy(buf->image);
++  free(buf);
++}
++
++bool
++bufdatabegin(struct wlr_buffer *wlr_buffer, uint32_t flags,
++      void **data, uint32_t *format, size_t *stride)
++{
++  Buffer *buf = wl_container_of(wlr_buffer, buf, base);
++
++  if (flags & WLR_BUFFER_DATA_PTR_ACCESS_WRITE) return false;
++
++  *data   = buf->data;
++  *stride = wlr_buffer->width * 4;
++  *format = DRM_FORMAT_ARGB8888;
++
++  return true;
++}
++
++void
++bufdataend(struct wlr_buffer *wlr_buffer)
++{
++}
++
++Buffer *
++bufmon(Monitor *m)
++{
++  size_t i;
++  Buffer *buf = NULL;
++
++  for (i = 0; i < LENGTH(m->pool); i++) {
++      if (m->pool[i]) {
++          if (m->pool[i]->busy)
++              continue;
++          buf = m->pool[i];
++          break;
++      }
++
++      buf = ecalloc(1, sizeof(Buffer) + (m->b.width * 4 * m->b.height));
++      buf->image = drwl_image_create(NULL, m->b.width, m->b.height, buf->data);
++      wlr_buffer_init(&buf->base, &buffer_impl, m->b.width, m->b.height);
++      m->pool[i] = buf;
++      break;
++  }
++  if (!buf)
++      return NULL;
++
++  buf->busy = true;
++  LISTEN(&buf->base.events.release, &buf->release, bufrelease);
++  wlr_buffer_lock(&buf->base);
++  drwl_setimage(m->drw, buf->image);
++  return buf;
++}
++
++void
++bufrelease(struct wl_listener *listener, void *data)
++{
++  Buffer *buf = wl_container_of(listener, buf, release);
++  buf->busy = false;
++  wl_list_remove(&buf->release.link);
++}
++
+ void
+ buttonpress(struct wl_listener *listener, void *data)
+ {
++  unsigned int i = 0, x = 0;
++  double cx;
++  unsigned int click;
+   struct wlr_pointer_button_event *event = data;
+   struct wlr_keyboard *keyboard;
++  struct wlr_scene_node *node;
++  struct wlr_scene_buffer *buffer;
+   uint32_t mods;
++  Arg arg = {0};
+   Client *c;
+   const Button *b;
+ 
+   wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
+ 
++  click = ClkRoot;
++  xytonode(cursor->x, cursor->y, NULL, &c, NULL, NULL, NULL);
++  if (c)
++      click = ClkClient;
++
+   switch (event->state) {
+   case WL_POINTER_BUTTON_STATE_PRESSED:
+       cursor_mode = CurPressed;
+@@ -613,17 +747,34 @@ buttonpress(struct wl_listener *listener, void *data)
+       if (locked)
+           break;
+ 
++      if (!c && !exclusive_focus &&
++          (node = wlr_scene_node_at(&layers[LyrBottom]->node, cursor->x, cursor->y, NULL, NULL)) &&
++          (buffer = wlr_scene_buffer_from_node(node)) && buffer == selmon->scene_buffer) {
++          cx = (cursor->x - selmon->m.x) * selmon->wlr_output->scale;
++          do
++              x += TEXTW(selmon, tags[i]);
++          while (cx >= x && ++i < LENGTH(tags));
++          if (i < LENGTH(tags)) {
++              click = ClkTagBar;
++              arg.ui = 1 << i;
++          } else if (cx < x + TEXTW(selmon, selmon->ltsymbol))
++              click = ClkLtSymbol;
++          else if (cx > selmon->b.width - (TEXTW(selmon, stext) - selmon->lrpad + 2)) {
++              click = ClkStatus;
++          } else
++              click = ClkTitle;
++      }
++
+       /* Change focus if the button was _pressed_ over a client */
+       xytonode(cursor->x, cursor->y, NULL, &c, NULL, NULL, NULL);
+-      if (c && (!client_is_unmanaged(c) || client_wants_focus(c)))
++      if (click == ClkClient && (!client_is_unmanaged(c) || client_wants_focus(c)))
+           focusclient(c, 1);
+ 
+       keyboard = wlr_seat_get_keyboard(seat);
+       mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
+       for (b = buttons; b < END(buttons); b++) {
+-          if (CLEANMASK(mods) == CLEANMASK(b->mod) &&
+-                  event->button == b->button && b->func) {
+-              b->func(&b->arg);
++          if (CLEANMASK(mods) == CLEANMASK(b->mod) && event->button == b->button && click == b->click && b->func) {
++              b->func(click == ClkTagBar && b->arg.i == 0 ? &arg : &b->arg);
+               return;
+           }
+       }
+@@ -697,6 +848,8 @@ cleanup(void)
+   /* Destroy after the wayland display (when the monitors are already destroyed)
+      to avoid destroying them with an invalid scene output. */
+   wlr_scene_node_destroy(&scene->tree.node);
++
++  drwl_fini();
+ }
+ 
+ void
+@@ -712,6 +865,12 @@ cleanupmon(struct wl_listener *listener, void *data)
+           wlr_layer_surface_v1_destroy(l->layer_surface);
+   }
+ 
++  for (i = 0; i < LENGTH(m->pool); i++)
++      wlr_buffer_drop(&m->pool[i]->base);
++
++  drwl_setimage(m->drw, NULL);
++  drwl_destroy(m->drw);
++
+   wl_list_remove(&m->destroy.link);
+   wl_list_remove(&m->frame.link);
+   wl_list_remove(&m->link);
+@@ -722,6 +881,7 @@ cleanupmon(struct wl_listener *listener, void *data)
+ 
+   closemon(m);
+   wlr_scene_node_destroy(&m->fullscreen_bg->node);
++  wlr_scene_node_destroy(&m->scene_buffer->node);
+   free(m);
+ }
+ 
+@@ -751,7 +911,7 @@ closemon(Monitor *m)
+           setmon(c, selmon, c->tags);
+   }
+   focusclient(focustop(selmon), 1);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -1022,8 +1182,15 @@ createmon(struct wl_listener *listener, void *data)
+   wlr_output_commit_state(wlr_output, &state);
+   wlr_output_state_finish(&state);
+ 
++  if (!(m->drw = drwl_create()))
++      die("failed to create drwl context");
++
++  m->scene_buffer = wlr_scene_buffer_create(layers[LyrBottom], NULL);
++  m->scene_buffer->point_accepts_input = baracceptsinput;
++  updatebar(m);
++
+   wl_list_insert(&mons, &m->link);
+-  printstatus();
++  drawbars();
+ 
+   /* The xdg-protocol specifies:
+    *
+@@ -1336,6 +1503,80 @@ dirtomon(enum wlr_direction dir)
+   return selmon;
+ }
+ 
++void
++drawbar(Monitor *m)
++{
++  int x, w, tw = 0;
++  int boxs = m->drw->font->height / 9;
++  int boxw = m->drw->font->height / 6 + 2;
++  uint32_t i, occ = 0, urg = 0;
++  Client *c;
++  Buffer *buf;
++
++  if (!m->scene_buffer->node.enabled)
++      return;
++  if (!(buf = bufmon(m)))
++      return;
++
++  /* draw status first so it can be overdrawn by tags later */
++  if (m == selmon) { /* status is only drawn on selected monitor */
++      drwl_setscheme(m->drw, colors[SchemeNorm]);
++      tw = TEXTW(m, stext) - m->lrpad + 2; /* 2px right padding */
++      drwl_text(m->drw, m->b.width - tw, 0, tw, m->b.height, 0, stext, 0);
++  }
++
++  wl_list_for_each(c, &clients, link) {
++      if (c->mon != m)
++          continue;
++      occ |= c->tags;
++      if (c->isurgent)
++          urg |= c->tags;
++  }
++  x = 0;
++  c = focustop(m);
++  for (i = 0; i < LENGTH(tags); i++) {
++      w = TEXTW(m, tags[i]);
++      drwl_setscheme(m->drw, colors[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
++      drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, tags[i], urg & 1 << i);
++      if (occ & 1 << i)
++          drwl_rect(m->drw, x + boxs, boxs, boxw, boxw,
++              m == selmon && c && c->tags & 1 << i,
++              urg & 1 << i);
++      x += w;
++  }
++  w = TEXTW(m, m->ltsymbol);
++  drwl_setscheme(m->drw, colors[SchemeNorm]);
++  x = drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, m->ltsymbol, 0);
++
++  if ((w = m->b.width - tw - x) > m->b.height) {
++      if (c) {
++          drwl_setscheme(m->drw, colors[m == selmon ? SchemeSel : SchemeNorm]);
++          drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
++          if (c && c->isfloating)
++              drwl_rect(m->drw, x + boxs, boxs, boxw, boxw, 0, 0);
++      } else {
++          drwl_setscheme(m->drw, colors[SchemeNorm]);
++          drwl_rect(m->drw, x, 0, w, m->b.height, 1, 1);
++      }
++  }
++
++  wlr_scene_buffer_set_dest_size(m->scene_buffer,
++      m->b.real_width, m->b.real_height);
++  wlr_scene_node_set_position(&m->scene_buffer->node, m->m.x,
++      m->m.y + (topbar ? 0 : m->m.height - m->b.real_height));
++  wlr_scene_buffer_set_buffer(m->scene_buffer, &buf->base);
++  wlr_buffer_unlock(&buf->base);
++}
++
++void
++drawbars(void)
++{
++  Monitor *m = NULL;
++
++  wl_list_for_each(m, &mons, link)
++      drawbar(m);
++}
++
+ void
+ focusclient(Client *c, int lift)
+ {
+@@ -1371,13 +1612,13 @@ focusclient(Client *c, int lift)
+       /* Don't change border color if there is an exclusive focus or we are
+        * handling a drag operation */
+       if (!exclusive_focus && !seat->drag)
+-          client_set_border_color(c, focuscolor);
++          client_set_border_color(c, (float[])COLOR(colors[SchemeSel][ColBorder]));
+   }
+ 
+   /* Deactivate old client if focus is changing */
+   if (old && (!c || client_surface(c) != old)) {
+       /* If an overlay is focused, don't focus or activate the client,
+-       * but only update its position in fstack to render its border with focuscolor
++       * but only update its position in fstack to render its border with its color
+        * and focus it after the overlay is closed. */
+       if (old_client_type == LayerShell && wlr_scene_node_coords(
+                   &old_l->scene->node, &unused_lx, &unused_ly)
+@@ -1388,12 +1629,11 @@ focusclient(Client *c, int lift)
+       /* Don't deactivate old client if the new one wants focus, as this causes issues with winecfg
+        * and probably other clients */
+       } else if (old_c && !client_is_unmanaged(old_c) && (!c || !client_wants_focus(c))) {
+-          client_set_border_color(old_c, bordercolor);
+-
++          client_set_border_color(old_c, (float[])COLOR(colors[SchemeNorm][ColBorder]));
+           client_activate_surface(old, 0);
+       }
+   }
+-  printstatus();
++  drawbars();
+ 
+   if (!c) {
+       /* With no client, all we have left is to clear focus */
+@@ -1715,7 +1955,7 @@ mapnotify(struct wl_listener *listener, void *data)
+ 
+   for (i = 0; i < 4; i++) {
+       c->border[i] = wlr_scene_rect_create(c->scene, 0, 0,
+-              c->isurgent ? urgentcolor : bordercolor);
++          (float[])COLOR(colors[c->isurgent ? SchemeUrg : SchemeNorm][ColBorder]));
+       c->border[i]->node.data = c;
+   }
+ 
+@@ -1738,7 +1978,7 @@ mapnotify(struct wl_listener *listener, void *data)
+   } else {
+       applyrules(c);
+   }
+-  printstatus();
++  drawbars();
+ 
+ unset_fullscreen:
+   m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y);
+@@ -2032,46 +2272,6 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
+   wlr_seat_pointer_notify_motion(seat, time, sx, sy);
+ }
+ 
+-void
+-printstatus(void)
+-{
+-  Monitor *m = NULL;
+-  Client *c;
+-  uint32_t occ, urg, sel;
+-  const char *appid, *title;
+-
+-  wl_list_for_each(m, &mons, link) {
+-      occ = urg = 0;
+-      wl_list_for_each(c, &clients, link) {
+-          if (c->mon != m)
+-              continue;
+-          occ |= c->tags;
+-          if (c->isurgent)
+-              urg |= c->tags;
+-      }
+-      if ((c = focustop(m))) {
+-          title = client_get_title(c);
+-          appid = client_get_appid(c);
+-          printf("%s title %s\n", m->wlr_output->name, title ? title : broken);
+-          printf("%s appid %s\n", m->wlr_output->name, appid ? appid : broken);
+-          printf("%s fullscreen %d\n", m->wlr_output->name, c->isfullscreen);
+-          printf("%s floating %d\n", m->wlr_output->name, c->isfloating);
+-          sel = c->tags;
+-      } else {
+-          printf("%s title \n", m->wlr_output->name);
+-          printf("%s appid \n", m->wlr_output->name);
+-          printf("%s fullscreen \n", m->wlr_output->name);
+-          printf("%s floating \n", m->wlr_output->name);
+-          sel = 0;
+-      }
+-
+-      printf("%s selmon %u\n", m->wlr_output->name, m == selmon);
+-      printf("%s tags %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32"\n",
+-          m->wlr_output->name, occ, m->tagset[m->seltags], sel, urg);
+-      printf("%s layout %s\n", m->wlr_output->name, m->ltsymbol);
+-  }
+-  fflush(stdout);
+-}
+ 
+ void
+ powermgrsetmode(struct wl_listener *listener, void *data)
+@@ -2226,30 +2426,17 @@ run(char *startup_cmd)
+ 
+   /* Now that the socket exists and the backend is started, run the startup command */
+   if (startup_cmd) {
+-      int piperw[2];
+-      if (pipe(piperw) < 0)
+-          die("startup: pipe:");
+       if ((child_pid = fork()) < 0)
+           die("startup: fork:");
+       if (child_pid == 0) {
++          close(STDIN_FILENO);
+           setsid();
+-          dup2(piperw[0], STDIN_FILENO);
+-          close(piperw[0]);
+-          close(piperw[1]);
+           execl("/bin/sh", "/bin/sh", "-c", startup_cmd, NULL);
+           die("startup: execl:");
+       }
+-      dup2(piperw[1], STDOUT_FILENO);
+-      close(piperw[1]);
+-      close(piperw[0]);
+   }
+ 
+-  /* Mark stdout as non-blocking to avoid people who does not close stdin
+-   * nor consumes it in their startup script getting dwl frozen */
+-  if (fd_set_nonblock(STDOUT_FILENO) < 0)
+-      close(STDOUT_FILENO);
+-
+-  printstatus();
++  drawbars();
+ 
+   /* At this point the outputs are initialized, choose initial selmon based on
+    * cursor position, and set default cursor image */
+@@ -2315,7 +2502,7 @@ setfloating(Client *c, int floating)
+           (p && p->isfullscreen) ? LyrFS
+           : c->isfloating ? LyrFloat : LyrTile]);
+   arrange(c->mon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2338,7 +2525,7 @@ setfullscreen(Client *c, int fullscreen)
+       resize(c, c->prev, 0);
+   }
+   arrange(c->mon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2363,7 +2550,7 @@ setlayout(const Arg *arg)
+       selmon->lt[selmon->sellt] = (Layout *)arg->v;
+   strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol));
+   arrange(selmon);
+-  printstatus();
++  drawbar(selmon);
+ }
+ 
+ /* arg > 1.0 will set mfact absolutely */
+@@ -2436,6 +2623,7 @@ setup(void)
+   for (i = 0; i < (int)LENGTH(sig); i++)
+       sigaction(sig[i], &sa, NULL);
+ 
++
+   wlr_log_init(log_level, NULL);
+ 
+   /* The Wayland display is managed by libwayland. It handles accepting
+@@ -2625,6 +2813,11 @@ setup(void)
+   LISTEN_STATIC(&output_mgr->events.apply, outputmgrapply);
+   LISTEN_STATIC(&output_mgr->events.test, outputmgrtest);
+ 
++  drwl_init();
++
++  status_event_source = wl_event_loop_add_fd(wl_display_get_event_loop(dpy),
++      STDIN_FILENO, WL_EVENT_READABLE, statusin, NULL);
++
+   /* Make sure XWayland clients don't connect to the parent X server,
+    * e.g when running in the x11 backend or the wayland backend and the
+    * compositor has Xwayland support */
+@@ -2649,6 +2842,7 @@ void
+ spawn(const Arg *arg)
+ {
+   if (fork() == 0) {
++      close(STDIN_FILENO);
+       dup2(STDERR_FILENO, STDOUT_FILENO);
+       setsid();
+       execvp(((char **)arg->v)[0], (char **)arg->v);
+@@ -2667,6 +2861,30 @@ startdrag(struct wl_listener *listener, void *data)
+   LISTEN_STATIC(&drag->icon->events.destroy, destroydragicon);
+ }
+ 
++int
++statusin(int fd, unsigned int mask, void *data)
++{
++  char status[1024];
++  ssize_t n;
++
++  if (mask & WL_EVENT_ERROR)
++      die("status in event error");
++  if (mask & WL_EVENT_HANGUP)
++      wl_event_source_remove(status_event_source);
++
++  n = read(fd, status, sizeof(status) - 1);
++  if (n < 0 && errno != EWOULDBLOCK)
++      die("read:");
++
++  status[n] = '\0';
++  status[strcspn(status, "\n")] = '\0';
++
++  strncpy(stext, status, sizeof(stext));
++  drawbars();
++
++  return 0;
++}
++
+ void
+ tag(const Arg *arg)
+ {
+@@ -2677,7 +2895,7 @@ tag(const Arg *arg)
+   sel->tags = arg->ui & TAGMASK;
+   focusclient(focustop(selmon), 1);
+   arrange(selmon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2722,6 +2940,14 @@ tile(Monitor *m)
+   }
+ }
+ 
++void
++togglebar(const Arg *arg)
++{
++  wlr_scene_node_set_enabled(&selmon->scene_buffer->node,
++      !selmon->scene_buffer->node.enabled);
++  arrangelayers(selmon);
++}
++
+ void
+ togglefloating(const Arg *arg)
+ {
+@@ -2750,7 +2976,7 @@ toggletag(const Arg *arg)
+   sel->tags = newtags;
+   focusclient(focustop(selmon), 1);
+   arrange(selmon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2763,7 +2989,7 @@ toggleview(const Arg *arg)
+   selmon->tagset[selmon->seltags] = newtagset;
+   focusclient(focustop(selmon), 1);
+   arrange(selmon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2811,7 +3037,7 @@ unmapnotify(struct wl_listener *listener, void *data)
+   }
+ 
+   wlr_scene_node_destroy(&c->scene->node);
+-  printstatus();
++  drawbars();
+   motionnotify(0, NULL, 0, 0, 0, 0);
+ }
+ 
+@@ -2911,6 +3137,13 @@ updatemons(struct wl_listener *listener, void *data)
+       }
+   }
+ 
++  if (stext[0] == '\0')
++      strncpy(stext, "dwl-"VERSION, sizeof(stext));
++  wl_list_for_each(m, &mons, link) {
++      updatebar(m);
++      drawbar(m);
++  }
++
+   /* FIXME: figure out why the cursor image is at 0,0 after turning all
+    * the monitors on.
+    * Move the cursor image where it used to be. It does not generate a
+@@ -2921,12 +3154,45 @@ updatemons(struct wl_listener *listener, void *data)
+   wlr_output_manager_v1_set_configuration(output_mgr, config);
+ }
+ 
++void
++updatebar(Monitor *m)
++{
++  size_t i;
++  int rw, rh;
++  char fontattrs[12];
++
++  wlr_output_transformed_resolution(m->wlr_output, &rw, &rh);
++  m->b.width = rw;
++  m->b.real_width = (int)((float)m->b.width / m->wlr_output->scale);
++
++  wlr_scene_node_set_enabled(&m->scene_buffer->node, m->wlr_output->enabled ? showbar : 0);
++
++  for (i = 0; i < LENGTH(m->pool); i++)
++      if (m->pool[i]) {
++          wlr_buffer_drop(&m->pool[i]->base);
++          m->pool[i] = NULL;
++      }
++
++  if (m->b.scale == m->wlr_output->scale && m->drw)
++      return;
++
++  drwl_font_destroy(m->drw->font);
++  snprintf(fontattrs, sizeof(fontattrs), "dpi=%.2f", 96. * m->wlr_output->scale);
++  if (!(drwl_font_create(m->drw, LENGTH(fonts), fonts, fontattrs)))
++      die("Could not load font");
++
++  m->b.scale = m->wlr_output->scale;
++  m->lrpad = m->drw->font->height;
++  m->b.height = m->drw->font->height + 2;
++  m->b.real_height = (int)((float)m->b.height / m->wlr_output->scale);
++}
++
+ void
+ updatetitle(struct wl_listener *listener, void *data)
+ {
+   Client *c = wl_container_of(listener, c, set_title);
+   if (c == focustop(c->mon))
+-      printstatus();
++      drawbars();
+ }
+ 
+ void
+@@ -2939,10 +3205,10 @@ urgent(struct wl_listener *listener, void *data)
+       return;
+ 
+   c->isurgent = 1;
+-  printstatus();
++  drawbars();
+ 
+   if (client_surface(c)->mapped)
+-      client_set_border_color(c, urgentcolor);
++      client_set_border_color(c, (float[])COLOR(colors[SchemeUrg][ColBorder]));
+ }
+ 
+ void
+@@ -2955,7 +3221,7 @@ view(const Arg *arg)
+       selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
+   focusclient(focustop(selmon), 1);
+   arrange(selmon);
+-  printstatus();
++  drawbars();
+ }
+ 
+ void
+@@ -2996,6 +3262,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
+ {
+   struct wlr_scene_node *node, *pnode;
+   struct wlr_surface *surface = NULL;
++  struct wlr_scene_surface *scene_surface = NULL;
+   Client *c = NULL;
+   LayerSurface *l = NULL;
+   int layer;
+@@ -3004,9 +3271,12 @@ xytonode(double x, double y, struct wlr_surface **psurface,
+       if (!(node = wlr_scene_node_at(&layers[layer]->node, x, y, nx, ny)))
+           continue;
+ 
+-      if (node->type == WLR_SCENE_NODE_BUFFER)
+-          surface = wlr_scene_surface_try_from_buffer(
+-                  wlr_scene_buffer_from_node(node))->surface;
++      if (node->type == WLR_SCENE_NODE_BUFFER) {
++          scene_surface = wlr_scene_surface_try_from_buffer(
++                  wlr_scene_buffer_from_node(node));
++          if (!scene_surface) continue;
++          surface = scene_surface->surface;
++      }
+       /* Walk the tree to find a node that knows the client */
+       for (pnode = node; pnode && !c; pnode = &pnode->parent->node)
+           c = pnode->data;
+@@ -3145,10 +3415,10 @@ sethints(struct wl_listener *listener, void *data)
+       return;
+ 
+   c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
+-  printstatus();
++  drawbars();
+ 
+   if (c->isurgent && surface && surface->mapped)
+-      client_set_border_color(c, urgentcolor);
++      client_set_border_color(c, (float[])COLOR(colors[SchemeUrg][ColBorder]));
+ }
+ 
+ void
+-- 
+2.46.0
+
diff --git a/patches/bar.patch b/dwl/patches/bar/bar.patch
similarity index 90%
rename from patches/bar.patch
rename to dwl/patches/bar/bar.patch
index 7fa2a61..e098118 100644
--- a/patches/bar.patch
+++ b/dwl/patches/bar/bar.patch
@@ -1,15 +1,14 @@
-From 8906a73dbc8996dd1bfff15f5b26aaee6d45fd61 Mon Sep 17 00:00:00 2001
+From d6a2c4e7f0d3108c7a8a1ad6e76a62e854b2f8e1 Mon Sep 17 00:00:00 2001
 From: sewn <sewn@disroot.org>
-Date: Tue, 29 Jul 2025 15:21:19 +0300
+Date: Mon, 5 Jan 2026 16:51:14 +0300
 Subject: [PATCH] Implement dwm bar clone

-Signed-off-by: sewn <sewn@disroot.org>
 ---
  Makefile     |   2 +-
  config.def.h |  33 ++--
- drwl.h       | 311 ++++++++++++++++++++++++++++++++++++
- dwl.c        | 441 +++++++++++++++++++++++++++++++++++++++++----------
- 4 files changed, 695 insertions(+), 92 deletions(-)
+ drwl.h       | 310 +++++++++++++++++++++++++++++++++++
+ dwl.c        | 444 +++++++++++++++++++++++++++++++++++++++++----------
+ 4 files changed, 697 insertions(+), 92 deletions(-)
  create mode 100644 drwl.h

 diff --git a/Makefile b/Makefile
@@ -26,7 +25,7 @@ index 578194f..279b1c0 100644
  LDLIBS    = `<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>P</mi><mi>K</mi><msub><mi>G</mi><mi>C</mi></msub><mi>O</mi><mi>N</mi><mi>F</mi><mi>I</mi><mi>G</mi><mo stretchy="false">&#x00029;</mo><mo>&#x02212;</mo><mo>&#x02212;</mo><mi>l</mi><mi>i</mi><mi>b</mi><mi>s</mi></mrow></math>(PKGS)` <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>W</mi><mi>L</mi><msub><mi>R</mi><mi>L</mi></msub><mi>I</mi><mi>B</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo><mo>&#x02212;</mo><mi>l</mi><mi>m</mi></mrow></math>(LIBS)

 diff --git a/config.def.h b/config.def.h
-index 95c2afa..1b7472d 100644
+index 8a6eda0..7da50d2 100644
 --- a/config.def.h
 +++ b/config.def.h
 @@ -7,15 +7,21 @@
@@ -57,15 +56,15 @@ index 95c2afa..1b7472d 100644

  /* logging */
  static int log_level = WLR_ERROR;
-@@ -127,6 +133,7 @@ static const Key keys[] = {
-   /* 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} },
-@@ -170,7 +177,15 @@ static const Key keys[] = {
+@@ -123,6 +129,7 @@ static const Key keys[] = {
+   /* 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} },
+@@ -166,7 +173,15 @@ static const Key keys[] = {
  };

  static const Button buttons[] = {
@@ -86,10 +85,10 @@ index 95c2afa..1b7472d 100644
  };
 diff --git a/drwl.h b/drwl.h
 new file mode 100644
-index 0000000..90cc35b
+index 0000000..21afd21
 --- /dev/null
 +++ b/drwl.h
-@@ -0,0 +1,311 @@
+@@ -0,0 +1,310 @@
 +/*
 + * drwl - https://codeberg.org/sewn/drwl
 + *
@@ -173,7 +172,6 @@ index 0000000..90cc35b
 +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);
 +}
 +
@@ -402,10 +400,15 @@ index 0000000..90cc35b
 +  fcft_fini();
 +}
 diff --git a/dwl.c b/dwl.c
-index 12f441e..bf340d8 100644
+index 44f3ad9..7b2abf5 100644
 --- a/dwl.c
 +++ b/dwl.c
-@@ -5,6 +5,7 @@
+@@ -1,10 +1,12 @@
+ /*
+  * See LICENSE file for copyright and license details.
+  */
++#include <fcntl.h>
+ #include <getopt.h>
  #include <libinput.h>
  #include <linux/input-event-codes.h>
  #include <math.h>
@@ -413,7 +416,7 @@ index 12f441e..bf340d8 100644
  #include <signal.h>
  #include <stdio.h>
  #include <stdlib.h>
-@@ -59,6 +60,7 @@
+@@ -59,6 +61,7 @@
  #include <wlr/types/wlr_xdg_decoration_v1.h>
  #include <wlr/types/wlr_xdg_output_v1.h>
  #include <wlr/types/wlr_xdg_shell.h>
@@ -421,7 +424,7 @@ index 12f441e..bf340d8 100644
  #include <wlr/util/log.h>
  #include <wlr/util/region.h>
  #include <xkbcommon/xkbcommon.h>
-@@ -69,6 +71,7 @@
+@@ -69,6 +72,7 @@
  #endif

  #include "util.h"
@@ -429,7 +432,7 @@ index 12f441e..bf340d8 100644

  /* macros */
  #define MAX(A, B)               ((A) > (B) ? (A) : (B))
-@@ -77,14 +80,17 @@
+@@ -77,14 +81,17 @@
  #define VISIBLEON(C, M)         ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
  #define LENGTH(X)               (sizeof X / sizeof X[0])
  #define END(A)                  ((A) + LENGTH(A))
@@ -448,7 +451,7 @@ index 12f441e..bf340d8 100644

  typedef union {
    int i;
-@@ -94,6 +100,7 @@ typedef union {
+@@ -94,6 +101,7 @@ typedef union {
  } Arg;

  typedef struct {
@@ -456,7 +459,7 @@ index 12f441e..bf340d8 100644
    unsigned int mod;
    unsigned int button;
    void (*func)(const Arg *);
-@@ -183,10 +190,19 @@ typedef struct {
+@@ -183,10 +191,19 @@ typedef struct {
    void (*arrange)(Monitor *);
  } Layout;

@@ -476,7 +479,7 @@ index 12f441e..bf340d8 100644
    struct wlr_scene_rect *fullscreen_bg; /* See createmon() for info */
    struct wl_listener frame;
    struct wl_listener destroy;
-@@ -194,6 +210,11 @@ struct Monitor {
+@@ -194,6 +211,11 @@ struct Monitor {
    struct wl_listener destroy_lock_surface;
    struct wlr_session_lock_surface_v1 *lock_surface;
    struct wlr_box m; /* monitor area, layout-relative */
@@ -488,7 +491,7 @@ index 12f441e..bf340d8 100644
    struct wlr_box w; /* window area, layout-relative */
    struct wl_list layers[4]; /* LayerSurface.link */
    const Layout *lt[2];
-@@ -205,6 +226,9 @@ struct Monitor {
+@@ -205,6 +227,9 @@ struct Monitor {
    int nmaster;
    char ltsymbol[16];
    int asleep;
@@ -498,7 +501,7 @@ index 12f441e..bf340d8 100644
  };

  typedef struct {
-@@ -247,6 +271,13 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
+@@ -247,6 +272,13 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
        struct wlr_box *usable_area, int exclusive);
  static void arrangelayers(Monitor *m);
  static void axisnotify(struct wl_listener *listener, void *data);
@@ -512,7 +515,7 @@ index 12f441e..bf340d8 100644
  static void buttonpress(struct wl_listener *listener, void *data);
  static void chvt(const Arg *arg);
  static void checkidleinhibitor(struct wlr_surface *exclude);
-@@ -282,6 +313,8 @@ static void destroypointerconstraint(struct wl_listener *listener, void *data);
+@@ -282,6 +314,8 @@ static void destroypointerconstraint(struct wl_listener *listener, void *data);
  static void destroysessionlock(struct wl_listener *listener, void *data);
  static void destroykeyboardgroup(struct wl_listener *listener, void *data);
  static Monitor *dirtomon(enum wlr_direction dir);
@@ -521,7 +524,7 @@ index 12f441e..bf340d8 100644
  static void focusclient(Client *c, int lift);
  static void focusmon(const Arg *arg);
  static void focusstack(const Arg *arg);
-@@ -310,7 +343,6 @@ static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int
+@@ -310,7 +344,6 @@ static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int
  static void outputmgrtest(struct wl_listener *listener, void *data);
  static void pointerfocus(Client *c, struct wlr_surface *surface,
        double sx, double sy, uint32_t time);
@@ -529,7 +532,7 @@ index 12f441e..bf340d8 100644
  static void powermgrsetmode(struct wl_listener *listener, void *data);
  static void quit(const Arg *arg);
  static void rendermon(struct wl_listener *listener, void *data);
-@@ -331,9 +363,11 @@ static void setsel(struct wl_listener *listener, void *data);
+@@ -331,9 +364,11 @@ static void setsel(struct wl_listener *listener, void *data);
  static void setup(void);
  static void spawn(const Arg *arg);
  static void startdrag(struct wl_listener *listener, void *data);
@@ -541,7 +544,7 @@ index 12f441e..bf340d8 100644
  static void togglefloating(const Arg *arg);
  static void togglefullscreen(const Arg *arg);
  static void toggletag(const Arg *arg);
-@@ -342,6 +376,7 @@ static void unlocksession(struct wl_listener *listener, void *data);
+@@ -342,6 +377,7 @@ static void unlocksession(struct wl_listener *listener, void *data);
  static void unmaplayersurfacenotify(struct wl_listener *listener, void *data);
  static void unmapnotify(struct wl_listener *listener, void *data);
  static void updatemons(struct wl_listener *listener, void *data);
@@ -549,7 +552,7 @@ index 12f441e..bf340d8 100644
  static void updatetitle(struct wl_listener *listener, void *data);
  static void urgent(struct wl_listener *listener, void *data);
  static void view(const Arg *arg);
-@@ -406,6 +441,15 @@ static struct wlr_box sgeom;
+@@ -406,6 +442,15 @@ static struct wlr_box sgeom;
  static struct wl_list mons;
  static Monitor *selmon;

@@ -565,7 +568,7 @@ index 12f441e..bf340d8 100644
  /* global event handlers */
  static struct wl_listener cursor_axis = {.notify = axisnotify};
  static struct wl_listener cursor_button = {.notify = buttonpress};
-@@ -521,7 +565,7 @@ arrange(Monitor *m)
+@@ -521,7 +566,7 @@ arrange(Monitor *m)
    wlr_scene_node_set_enabled(&m->fullscreen_bg->node,
            (c = focustop(m)) && c->isfullscreen);

@@ -574,7 +577,7 @@ index 12f441e..bf340d8 100644

    /* We move all clients (except fullscreen and unmanaged) to LyrTile while
     * in floating layout to avoid "real" floating clients be always on top */
-@@ -576,6 +620,11 @@ arrangelayers(Monitor *m)
+@@ -576,6 +621,11 @@ arrangelayers(Monitor *m)
    if (!m->wlr_output->enabled)
        return;

@@ -586,7 +589,7 @@ index 12f441e..bf340d8 100644
    /* Arrange exclusive surfaces from top->bottom */
    for (i = 3; i >= 0; i--)
        arrangelayer(m, &m->layers[i], &usable_area, 1);
-@@ -618,17 +667,102 @@ axisnotify(struct wl_listener *listener, void *data)
+@@ -618,17 +668,102 @@ axisnotify(struct wl_listener *listener, void *data)
            event->delta_discrete, event->source, event->relative_direction);
  }

@@ -689,7 +692,7 @@ index 12f441e..bf340d8 100644
    switch (event->state) {
    case WL_POINTER_BUTTON_STATE_PRESSED:
        cursor_mode = CurPressed;
-@@ -636,17 +770,34 @@ buttonpress(struct wl_listener *listener, void *data)
+@@ -636,17 +771,34 @@ buttonpress(struct wl_listener *listener, void *data)
        if (locked)
            break;

@@ -728,7 +731,7 @@ index 12f441e..bf340d8 100644
                return;
            }
        }
-@@ -721,6 +872,8 @@ cleanup(void)
+@@ -721,6 +873,8 @@ cleanup(void)
    /* Destroy after the wayland display (when the monitors are already destroyed)
       to avoid destroying them with an invalid scene output. */
    wlr_scene_node_destroy(&scene->tree.node);
@@ -737,7 +740,7 @@ index 12f441e..bf340d8 100644
  }

  void
-@@ -736,6 +889,12 @@ cleanupmon(struct wl_listener *listener, void *data)
+@@ -736,6 +890,12 @@ cleanupmon(struct wl_listener *listener, void *data)
            wlr_layer_surface_v1_destroy(l->layer_surface);
    }

@@ -750,7 +753,7 @@ index 12f441e..bf340d8 100644
    wl_list_remove(&m->destroy.link);
    wl_list_remove(&m->frame.link);
    wl_list_remove(&m->link);
-@@ -748,6 +907,7 @@ cleanupmon(struct wl_listener *listener, void *data)
+@@ -748,6 +908,7 @@ cleanupmon(struct wl_listener *listener, void *data)

    closemon(m);
    wlr_scene_node_destroy(&m->fullscreen_bg->node);
@@ -758,7 +761,7 @@ index 12f441e..bf340d8 100644
    free(m);
  }

-@@ -814,7 +974,7 @@ closemon(Monitor *m)
+@@ -814,7 +975,7 @@ closemon(Monitor *m)
            setmon(c, selmon, c->tags);
    }
    focusclient(focustop(selmon), 1);
@@ -767,7 +770,7 @@ index 12f441e..bf340d8 100644
  }

  void
-@@ -1066,7 +1226,7 @@ createmon(struct wl_listener *listener, void *data)
+@@ -1066,7 +1227,7 @@ createmon(struct wl_listener *listener, void *data)
            m->nmaster = r->nmaster;
            m->lt[0] = r->lt;
            m->lt[1] = &layouts[LENGTH(layouts) > 1 && r->lt != &layouts[1]];
@@ -776,7 +779,7 @@ index 12f441e..bf340d8 100644
            wlr_output_state_set_scale(&state, r->scale);
            wlr_output_state_set_transform(&state, r->rr);
            break;
-@@ -1088,8 +1248,15 @@ createmon(struct wl_listener *listener, void *data)
+@@ -1088,8 +1249,15 @@ createmon(struct wl_listener *listener, void *data)
    wlr_output_commit_state(wlr_output, &state);
    wlr_output_state_finish(&state);

@@ -793,7 +796,7 @@ index 12f441e..bf340d8 100644

    /* The xdg-protocol specifies:
     *
-@@ -1399,6 +1566,80 @@ dirtomon(enum wlr_direction dir)
+@@ -1399,6 +1567,80 @@ dirtomon(enum wlr_direction dir)
    return selmon;
  }

@@ -874,7 +877,7 @@ index 12f441e..bf340d8 100644
  void
  focusclient(Client *c, int lift)
  {
-@@ -1433,13 +1674,13 @@ focusclient(Client *c, int lift)
+@@ -1433,13 +1675,13 @@ focusclient(Client *c, int lift)
        /* Don't change border color if there is an exclusive focus or we are
         * handling a drag operation */
        if (!exclusive_focus && !seat->drag)
@@ -890,7 +893,7 @@ index 12f441e..bf340d8 100644
         * and focus it after the overlay is closed. */
        if (old_client_type == LayerShell && wlr_scene_node_coords(
                    &old_l->scene->node, &unused_lx, &unused_ly)
-@@ -1450,12 +1691,11 @@ focusclient(Client *c, int lift)
+@@ -1450,12 +1692,11 @@ focusclient(Client *c, int lift)
        /* Don't deactivate old client if the new one wants focus, as this causes issues with winecfg
         * and probably other clients */
        } else if (old_c && !client_is_unmanaged(old_c) && (!c || !client_wants_focus(c))) {
@@ -905,7 +908,7 @@ index 12f441e..bf340d8 100644

    if (!c) {
        /* With no client, all we have left is to clear focus */
-@@ -1768,7 +2008,7 @@ mapnotify(struct wl_listener *listener, void *data)
+@@ -1769,7 +2010,7 @@ mapnotify(struct wl_listener *listener, void *data)

    for (i = 0; i < 4; i++) {
        c->border[i] = wlr_scene_rect_create(c->scene, 0, 0,
@@ -914,7 +917,7 @@ index 12f441e..bf340d8 100644
        c->border[i]->node.data = c;
    }

-@@ -1791,7 +2031,7 @@ mapnotify(struct wl_listener *listener, void *data)
+@@ -1792,7 +2033,7 @@ mapnotify(struct wl_listener *listener, void *data)
    } else {
        applyrules(c);
    }
@@ -923,7 +926,7 @@ index 12f441e..bf340d8 100644

  unset_fullscreen:
    m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y);
-@@ -2084,44 +2324,6 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
+@@ -2085,44 +2326,6 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
    wlr_seat_pointer_notify_motion(seat, time, sx, sy);
  }

@@ -968,7 +971,7 @@ index 12f441e..bf340d8 100644
  void
  powermgrsetmode(struct wl_listener *listener, void *data)
  {
-@@ -2250,22 +2452,14 @@ run(char *startup_cmd)
+@@ -2251,22 +2454,14 @@ run(char *startup_cmd)

    /* Now that the socket exists and the backend is started, run the startup command */
    if (startup_cmd) {
@@ -992,7 +995,7 @@ index 12f441e..bf340d8 100644
    }

    /* Mark stdout as non-blocking to avoid the startup script
-@@ -2275,7 +2469,7 @@ run(char *startup_cmd)
+@@ -2276,7 +2471,7 @@ run(char *startup_cmd)
    if (fd_set_nonblock(STDOUT_FILENO) < 0)
        close(STDOUT_FILENO);

@@ -1001,7 +1004,7 @@ index 12f441e..bf340d8 100644

    /* At this point the outputs are initialized, choose initial selmon based on
     * cursor position, and set default cursor image */
-@@ -2341,7 +2535,7 @@ setfloating(Client *c, int floating)
+@@ -2342,7 +2537,7 @@ setfloating(Client *c, int floating)
            (p && p->isfullscreen) ? LyrFS
            : c->isfloating ? LyrFloat : LyrTile]);
    arrange(c->mon);
@@ -1010,7 +1013,7 @@ index 12f441e..bf340d8 100644
  }

  void
-@@ -2364,7 +2558,7 @@ setfullscreen(Client *c, int fullscreen)
+@@ -2365,7 +2560,7 @@ setfullscreen(Client *c, int fullscreen)
        resize(c, c->prev, 0);
    }
    arrange(c->mon);
@@ -1019,7 +1022,7 @@ index 12f441e..bf340d8 100644
  }

  void
-@@ -2376,9 +2570,9 @@ setlayout(const Arg *arg)
+@@ -2377,9 +2572,9 @@ setlayout(const Arg *arg)
        selmon->sellt ^= 1;
    if (arg && arg->v)
        selmon->lt[selmon->sellt] = (Layout *)arg->v;
@@ -1031,7 +1034,7 @@ index 12f441e..bf340d8 100644
  }

  /* arg > 1.0 will set mfact absolutely */
-@@ -2451,6 +2645,7 @@ setup(void)
+@@ -2452,6 +2647,7 @@ setup(void)
    for (i = 0; i < (int)LENGTH(sig); i++)
        sigaction(sig[i], &sa, NULL);

@@ -1039,7 +1042,7 @@ index 12f441e..bf340d8 100644
    wlr_log_init(log_level, NULL);

    /* The Wayland display is managed by libwayland. It handles accepting
-@@ -2645,6 +2840,11 @@ setup(void)
+@@ -2646,6 +2842,11 @@ setup(void)
    wl_signal_add(&output_mgr->events.apply, &output_mgr_apply);
    wl_signal_add(&output_mgr->events.test, &output_mgr_test);

@@ -1051,15 +1054,16 @@ index 12f441e..bf340d8 100644
    /* Make sure XWayland clients don't connect to the parent X server,
     * e.g when running in the x11 backend or the wayland backend and the
     * compositor has Xwayland support */
-@@ -2669,6 +2869,7 @@ void
+@@ -2670,6 +2871,8 @@ void
  spawn(const Arg *arg)
  {
    if (fork() == 0) {
 +      close(STDIN_FILENO);
++      open("/dev/null", O_RDWR);
        dup2(STDERR_FILENO, STDOUT_FILENO);
        setsid();
        execvp(((char **)arg->v)[0], (char **)arg->v);
-@@ -2687,6 +2888,30 @@ startdrag(struct wl_listener *listener, void *data)
+@@ -2688,6 +2891,30 @@ startdrag(struct wl_listener *listener, void *data)
    LISTEN_STATIC(&drag->icon->events.destroy, destroydragicon);
  }

@@ -1090,7 +1094,7 @@ index 12f441e..bf340d8 100644
  void
  tag(const Arg *arg)
  {
-@@ -2697,7 +2922,7 @@ tag(const Arg *arg)
+@@ -2698,7 +2925,7 @@ tag(const Arg *arg)
    sel->tags = arg->ui & TAGMASK;
    focusclient(focustop(selmon), 1);
    arrange(selmon);
@@ -1099,7 +1103,7 @@ index 12f441e..bf340d8 100644
  }

  void
-@@ -2742,6 +2967,14 @@ tile(Monitor *m)
+@@ -2743,6 +2970,15 @@ tile(Monitor *m)
    }
  }

@@ -1109,12 +1113,13 @@ index 12f441e..bf340d8 100644
 +  wlr_scene_node_set_enabled(&selmon->scene_buffer->node,
 +      !selmon->scene_buffer->node.enabled);
 +  arrangelayers(selmon);
++  drawbars();
 +}
 +
  void
  togglefloating(const Arg *arg)
  {
-@@ -2770,7 +3003,7 @@ toggletag(const Arg *arg)
+@@ -2771,7 +3007,7 @@ toggletag(const Arg *arg)
    sel->tags = newtags;
    focusclient(focustop(selmon), 1);
    arrange(selmon);
@@ -1123,7 +1128,7 @@ index 12f441e..bf340d8 100644
  }

  void
-@@ -2783,7 +3016,7 @@ toggleview(const Arg *arg)
+@@ -2784,7 +3020,7 @@ toggleview(const Arg *arg)
    selmon->tagset[selmon->seltags] = newtagset;
    focusclient(focustop(selmon), 1);
    arrange(selmon);
@@ -1132,7 +1137,7 @@ index 12f441e..bf340d8 100644
  }

  void
-@@ -2831,7 +3064,7 @@ unmapnotify(struct wl_listener *listener, void *data)
+@@ -2832,7 +3068,7 @@ unmapnotify(struct wl_listener *listener, void *data)
    }

    wlr_scene_node_destroy(&c->scene->node);
@@ -1141,7 +1146,7 @@ index 12f441e..bf340d8 100644
    motionnotify(0, NULL, 0, 0, 0, 0);
  }

-@@ -2931,6 +3164,13 @@ updatemons(struct wl_listener *listener, void *data)
+@@ -2932,6 +3168,13 @@ updatemons(struct wl_listener *listener, void *data)
        }
    }

@@ -1155,7 +1160,7 @@ index 12f441e..bf340d8 100644
    /* FIXME: figure out why the cursor image is at 0,0 after turning all
     * the monitors on.
     * Move the cursor image where it used to be. It does not generate a
-@@ -2941,12 +3181,45 @@ updatemons(struct wl_listener *listener, void *data)
+@@ -2942,12 +3185,45 @@ updatemons(struct wl_listener *listener, void *data)
    wlr_output_manager_v1_set_configuration(output_mgr, config);
  }

@@ -1202,7 +1207,7 @@ index 12f441e..bf340d8 100644
  }

  void
-@@ -2959,10 +3232,10 @@ urgent(struct wl_listener *listener, void *data)
+@@ -2960,10 +3236,10 @@ urgent(struct wl_listener *listener, void *data)
        return;

    c->isurgent = 1;
@@ -1215,7 +1220,7 @@ index 12f441e..bf340d8 100644
  }

  void
-@@ -2975,7 +3248,7 @@ view(const Arg *arg)
+@@ -2976,7 +3252,7 @@ view(const Arg *arg)
        selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
    focusclient(focustop(selmon), 1);
    arrange(selmon);
@@ -1224,7 +1229,7 @@ index 12f441e..bf340d8 100644
  }

  void
-@@ -3016,6 +3289,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
+@@ -3017,6 +3293,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
  {
    struct wlr_scene_node *node, *pnode;
    struct wlr_surface *surface = NULL;
@@ -1232,7 +1237,7 @@ index 12f441e..bf340d8 100644
    Client *c = NULL;
    LayerSurface *l = NULL;
    int layer;
-@@ -3024,9 +3298,12 @@ xytonode(double x, double y, struct wlr_surface **psurface,
+@@ -3025,9 +3302,12 @@ xytonode(double x, double y, struct wlr_surface **psurface,
        if (!(node = wlr_scene_node_at(&layers[layer]->node, x, y, nx, ny)))
            continue;

@@ -1248,7 +1253,7 @@ index 12f441e..bf340d8 100644
        /* Walk the tree to find a node that knows the client */
        for (pnode = node; pnode && !c; pnode = &pnode->parent->node)
            c = pnode->data;
-@@ -3159,10 +3436,10 @@ sethints(struct wl_listener *listener, void *data)
+@@ -3160,10 +3440,10 @@ sethints(struct wl_listener *listener, void *data)
        return;

    c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
@@ -1262,6 +1267,5 @@ index 12f441e..bf340d8 100644

  void
 -- 
-2.50.0
-
+2.52.0

diff --git a/dwl/patches/bar/bar.png b/dwl/patches/bar/bar.png
new file mode 100644
index 0000000..276256b
Binary files /dev/null and b/dwl/patches/bar/bar.png differ
diff --git a/dwl/patches/customfloat/README.md b/dwl/patches/customfloat/README.md
new file mode 100644
index 0000000..54ad011
--- /dev/null
+++ b/dwl/patches/customfloat/README.md
@@ -0,0 +1,24 @@
+### Description
+Rules for floating windows support default x, y, width, height. Defaults to the center of the screen and the client size.
+
+If the width or height is less than or equal to 1, then the value will be interpreted as a percentage. For example, 0.5 represents 50%, 0.25 represents 25%, and 1 represents 100%. **NOTE**: Some clients, like Thunar, have minimum width/height
+
+The variable `center_relative_to_monitor` allows the user to choose whether to center relative to the monitor or relative to the window area.
+
+<details>
+<summary>Explanation of center_relative_to_monitor:</summary>
+<pre>
+The "Monitor area" refers to the space enclosed by the green rectangle, while the "Window area" refers to the space enclosed by the red rectangle.
+<img src="https://i.imgur.com/xhejzPh.png"/>
+</pre>
+</details>
+
+### Download
+- [git branch](https://codeberg.org/wochap/dwl/src/branch/v0.5/customfloat)
+- [wlroots-next-f4249db](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/customfloat/customfloat-wlroots-next-f4249db.patch)
+- [0.8](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/customfloat/customfloat-0.8.patch)
+
+### Authors
+- [fauxmight](https://codeberg.org/fauxmight)
+- [wochap](https://codeberg.org/wochap)
+- [Stivvo](https://github.com/Stivvo)
diff --git a/dwl/patches/customfloat/customfloat-0.8.patch b/dwl/patches/customfloat/customfloat-0.8.patch
new file mode 100644
index 0000000..6f760d1
--- /dev/null
+++ b/dwl/patches/customfloat/customfloat-0.8.patch
@@ -0,0 +1,95 @@
+From 96125a70b7525740a42803f1faa666ca37b9433f Mon Sep 17 00:00:00 2001
+From: A Frederick Christensen <dwl@ivories.org>
+Date: Mon, 23 Feb 2026 09:06:33 -0600
+Subject: [PATCH] Apply customfloat patch
+
+---
+ config.def.h |  7 ++++---
+ dwl.c        | 26 ++++++++++++++++++++++++++
+ 2 files changed, 30 insertions(+), 3 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 8a6eda0..16afbb3 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -13,6 +13,7 @@ static const float focuscolor[]            = COLOR(0x005577ff);
+ static const float urgentcolor[]           = COLOR(0xff0000ff);
+ /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
+ static const float fullscreen_bg[]         = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
++static const int respect_monitor_reserved_area = 0;  /* 1 to monitor center while respecting the monitor's reserved area, 0 to monitor center */
+ 
+ /* tagging - TAGCOUNT must be no greater than 31 */
+ #define TAGCOUNT (9)
+@@ -21,9 +22,9 @@ static const float fullscreen_bg[]         = {0.0f, 0.0f, 0.0f, 1.0f}; /* You ca
+ static int log_level = WLR_ERROR;
+ 
+ static const Rule rules[] = {
+-  /* app_id             title       tags mask     isfloating   monitor */
+-  { "Gimp_EXAMPLE",     NULL,       0,            1,           -1 }, /* Start on currently visible tags floating, not tiled */
+-  { "firefox_EXAMPLE",  NULL,       1 << 8,       0,           -1 }, /* Start on ONLY tag "9" */
++  /* app_id             title       tags mask     isfloating   monitor   x   y   width   height */
++  { "Gimp_EXAMPLE",     NULL,       0,            1,           -1,       -1, -1, 1000,   0.75 }, /* Start on currently visible tags floating, not tiled */
++  { "firefox_EXAMPLE",  NULL,       1 << 8,       0,           -1,       -1, -1, -1,     -1 },   /* Start on ONLY tag "9" */
+     /* default/example rule: can be changed but cannot be eliminated; at least one rule must exist */
+ };
+ 
+diff --git a/dwl.c b/dwl.c
+index 44f3ad9..801696a 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -228,6 +228,10 @@ typedef struct {
+   uint32_t tags;
+   int isfloating;
+   int monitor;
++  int x;
++  int y;
++  float w;
++  float h;
+ } Rule;
+ 
+ typedef struct {
+@@ -482,6 +486,11 @@ applyrules(Client *c)
+   int i;
+   const Rule *r;
+   Monitor *mon = selmon, *m;
++  int newwidth;
++  int newheight;
++  int newx;
++  int newy;
++  int apply_resize = 0;
+ 
+   appid = client_get_appid(c);
+   title = client_get_title(c);
+@@ -495,12 +504,29 @@ applyrules(Client *c)
+           wl_list_for_each(m, &mons, link) {
+               if (r->monitor == i++)
+                   mon = m;
++              if (c->isfloating || !mon->lt[mon->sellt]->arrange) {
++                  /* client is floating or in floating layout */
++                  struct wlr_box b = respect_monitor_reserved_area ? mon->w : mon->m;
++                  newwidth  = (int)round((r->w >= 0) ? (r->w <= 1 ? b.width  * r->w       : r->w)       : c->geom.width);
++                  newheight = (int)round((r->h >= 0) ? (r->h <= 1 ? b.height * r->h       : r->h)       : c->geom.height);
++                  newx      = (int)round((r->x >= 0) ? (r->x <= 1 ? b.width  * r->x + b.x : r->x + b.x) : c->geom.x);
++                  newy      = (int)round((r->y >= 0) ? (r->y <= 1 ? b.height * r->y + b.y : r->y + b.y) : c->geom.y);
++                  apply_resize = 1;
++              }
+           }
+       }
+   }
+ 
+   c->isfloating |= client_is_float_type(c);
+   setmon(c, mon, newtags);
++  if (apply_resize) {
++      resize(c, (struct wlr_box){
++              .x = newx,
++              .y = newy,
++              .width = newwidth,
++              .height = newheight,
++      }, 1);
++  }
+ }
+ 
+ void
+-- 
+2.52.0
+
diff --git a/dwl/patches/customfloat/customfloat-wlroots-next-f4249db.patch b/dwl/patches/customfloat/customfloat-wlroots-next-f4249db.patch
new file mode 100644
index 0000000..11ba1d5
--- /dev/null
+++ b/dwl/patches/customfloat/customfloat-wlroots-next-f4249db.patch
@@ -0,0 +1,95 @@
+From d8a861b30bf93554633ff0517d5bbdcb9b9614f0 Mon Sep 17 00:00:00 2001
+From: A Frederick Christensen <dwl@ivories.org>
+Date: Mon, 23 Feb 2026 09:18:07 -0600
+Subject: [PATCH] Apply customfloat patch
+
+---
+ config.def.h |  7 ++++---
+ dwl.c        | 26 ++++++++++++++++++++++++++
+ 2 files changed, 30 insertions(+), 3 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 8a6eda0..16afbb3 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -13,6 +13,7 @@ static const float focuscolor[]            = COLOR(0x005577ff);
+ static const float urgentcolor[]           = COLOR(0xff0000ff);
+ /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
+ static const float fullscreen_bg[]         = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
++static const int respect_monitor_reserved_area = 0;  /* 1 to monitor center while respecting the monitor's reserved area, 0 to monitor center */
+ 
+ /* tagging - TAGCOUNT must be no greater than 31 */
+ #define TAGCOUNT (9)
+@@ -21,9 +22,9 @@ static const float fullscreen_bg[]         = {0.0f, 0.0f, 0.0f, 1.0f}; /* You ca
+ static int log_level = WLR_ERROR;
+ 
+ static const Rule rules[] = {
+-  /* app_id             title       tags mask     isfloating   monitor */
+-  { "Gimp_EXAMPLE",     NULL,       0,            1,           -1 }, /* Start on currently visible tags floating, not tiled */
+-  { "firefox_EXAMPLE",  NULL,       1 << 8,       0,           -1 }, /* Start on ONLY tag "9" */
++  /* app_id             title       tags mask     isfloating   monitor   x   y   width   height */
++  { "Gimp_EXAMPLE",     NULL,       0,            1,           -1,       -1, -1, 1000,   0.75 }, /* Start on currently visible tags floating, not tiled */
++  { "firefox_EXAMPLE",  NULL,       1 << 8,       0,           -1,       -1, -1, -1,     -1 },   /* Start on ONLY tag "9" */
+     /* default/example rule: can be changed but cannot be eliminated; at least one rule must exist */
+ };
+ 
+diff --git a/dwl.c b/dwl.c
+index 8a9715d..7de0655 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -230,6 +230,10 @@ typedef struct {
+   uint32_t tags;
+   int isfloating;
+   int monitor;
++  int x;
++  int y;
++  float w;
++  float h;
+ } Rule;
+ 
+ typedef struct {
+@@ -484,6 +488,11 @@ applyrules(Client *c)
+   int i;
+   const Rule *r;
+   Monitor *mon = selmon, *m;
++  int newwidth;
++  int newheight;
++  int newx;
++  int newy;
++  int apply_resize = 0;
+ 
+   appid = client_get_appid(c);
+   title = client_get_title(c);
+@@ -497,12 +506,29 @@ applyrules(Client *c)
+           wl_list_for_each(m, &mons, link) {
+               if (r->monitor == i++)
+                   mon = m;
++              if (c->isfloating || !mon->lt[mon->sellt]->arrange) {
++                  /* client is floating or in floating layout */
++                  struct wlr_box b = respect_monitor_reserved_area ? mon->w : mon->m;
++                  newwidth  = (int)round((r->w >= 0) ? (r->w <= 1 ? b.width  * r->w       : r->w)       : c->geom.width);
++                  newheight = (int)round((r->h >= 0) ? (r->h <= 1 ? b.height * r->h       : r->h)       : c->geom.height);
++                  newx      = (int)round((r->x >= 0) ? (r->x <= 1 ? b.width  * r->x + b.x : r->x + b.x) : c->geom.x);
++                  newy      = (int)round((r->y >= 0) ? (r->y <= 1 ? b.height * r->y + b.y : r->y + b.y) : c->geom.y);
++                  apply_resize = 1;
++              }
+           }
+       }
+   }
+ 
+   c->isfloating |= client_is_float_type(c);
+   setmon(c, mon, newtags);
++  if (apply_resize) {
++      resize(c, (struct wlr_box){
++              .x = newx,
++              .y = newy,
++              .width = newwidth,
++              .height = newheight,
++      }, 1);
++  }
+ }
+ 
+ void
+-- 
+2.52.0
+
diff --git a/dwl/patches/gaps/README.md b/dwl/patches/gaps/README.md
new file mode 100644
index 0000000..4925a47
--- /dev/null
+++ b/dwl/patches/gaps/README.md
@@ -0,0 +1,14 @@
+### Description
+Adds gaps between clients, providing the ability to disable them at run-time. 
+
+`smartgaps` can also be changed to remove gaps when there is only one client present.
+
+### Download
+- [git branch](https://codeberg.org/bigman/dwl/src/branch/gaps)
+- [2024-07-12](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/gaps/gaps.patch)
+
+### Authors
+- [peesock](https://codeberg.org/bigman)
+- [sewn](https://codeberg.org/sewn)
+- [Serene Void](https://github.com/serenevoid)
+- [Rayan Nakib](https://nakibrayan2.pages.dev)
diff --git a/patches/gap.patch b/dwl/patches/gaps/gaps.patch
similarity index 99%
rename from patches/gap.patch
rename to dwl/patches/gaps/gaps.patch
index 4825985..c025baf 100644
--- a/patches/gap.patch
+++ b/dwl/patches/gaps/gaps.patch
@@ -125,4 +125,3 @@ index dc0437e..dc851df 100644
 -- 
 2.45.2

-
diff --git a/dwl/patches/hide-behind-fullscreen/README.md b/dwl/patches/hide-behind-fullscreen/README.md
new file mode 100644
index 0000000..0b4bebe
--- /dev/null
+++ b/dwl/patches/hide-behind-fullscreen/README.md
@@ -0,0 +1,12 @@
+### Description
+Hide all clients (and layer surfaces) behind the current client if it is
+fullscreen, only the background  (layer surfaces at the background layer) will
+be shown
+
+### Download
+- [git branch](https://codeberg.org/sevz/dwl/src/branch/hide-behind-fullscreen)
+- [main 2025-01-20](/dwl/dwl-patches/raw/branch/main/patches/hide-behind-fullscreen/hide-behind-fullscreen.patch)
+- [hide-behind-fullscreen-0.7.patch](/dwl/dwl-patches/raw/branch/main/patches/hide-behind-fullscreen/hide-behind-fullscreen-0.7.patch)
+
+### Authors
+- [sevz](https://codeberg.org/sevz)
diff --git a/dwl/patches/hide-behind-fullscreen/hide-behind-fullscreen-0.7.patch b/dwl/patches/hide-behind-fullscreen/hide-behind-fullscreen-0.7.patch
new file mode 100644
index 0000000..de2dfc6
--- /dev/null
+++ b/dwl/patches/hide-behind-fullscreen/hide-behind-fullscreen-0.7.patch
@@ -0,0 +1,73 @@
+From 78e5c4b42cf125be70814fd65a09cbcf0a18aa7e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
+ <leohdz172@proton.me>
+Date: Sun, 10 Apr 2022 22:38:53 -0500
+Subject: [PATCH] hide-behind-fullscreen
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
+---
+ config.def.h |  2 +-
+ dwl.c        | 24 +++++++++++++++++++++++-
+ 2 files changed, 24 insertions(+), 2 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 22d2171d..1d5a4c84 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -12,7 +12,7 @@ static const float bordercolor[]           = COLOR(0x444444ff);
+ static const float focuscolor[]            = COLOR(0x005577ff);
+ static const float urgentcolor[]           = COLOR(0xff0000ff);
+ /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
+-static const float fullscreen_bg[]         = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
++static const float fullscreen_bg[]         = {0.1f, 0.1f, 0.1f, 0.0f}; /* You can also use glsl colors */
+ 
+ /* tagging - TAGCOUNT must be no greater than 31 */
+ #define TAGCOUNT (9)
+diff --git a/dwl.c b/dwl.c
+index a2711f67..56356f29 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -484,7 +484,9 @@ applyrules(Client *c)
+ void
+ arrange(Monitor *m)
+ {
+-  Client *c;
++  LayerSurface *l;
++  Client *c, *sel = focustop(m);
++  int i;
+ 
+   if (!m->wlr_output->enabled)
+       return;
+@@ -515,6 +517,26 @@ arrange(Monitor *m)
+                               : c->scene->node.parent);
+   }
+ 
++  if (sel && sel->isfullscreen && VISIBLEON(sel, m)) {
++      for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
++          wl_list_for_each(l, &sel->mon->layers[i], link)
++              wlr_scene_node_set_enabled(&l->scene->node, 0);
++      }
++
++      wl_list_for_each(c, &clients, link) {
++          if (c->mon != m)
++              continue;
++          wlr_scene_node_set_enabled(&c->scene->node, (sel->isfullscreen && c == sel)
++                  || !sel->isfullscreen);
++      }
++  }
++  if (!sel || (!sel->isfullscreen && VISIBLEON(sel, m))) {
++      for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
++          wl_list_for_each(l, &m->layers[i], link)
++              wlr_scene_node_set_enabled(&l->scene->node, 1);
++      }
++  }
++
+   if (m->lt[m->sellt]->arrange)
+       m->lt[m->sellt]->arrange(m);
+   motionnotify(0, NULL, 0, 0, 0, 0);
+-- 
+2.46.0
+
diff --git a/dwl/patches/hide-behind-fullscreen/hide-behind-fullscreen.patch b/dwl/patches/hide-behind-fullscreen/hide-behind-fullscreen.patch
new file mode 100644
index 0000000..f82d0e6
--- /dev/null
+++ b/dwl/patches/hide-behind-fullscreen/hide-behind-fullscreen.patch
@@ -0,0 +1,73 @@
+From ac1537f068ea626f1984803ed8db08faf7943b18 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
+ <leohdz172@proton.me>
+Date: Sun, 10 Apr 2022 22:38:53 -0500
+Subject: [PATCH] hide-behind-fullscreen
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
+---
+ config.def.h |  2 +-
+ dwl.c        | 24 +++++++++++++++++++++++-
+ 2 files changed, 24 insertions(+), 2 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 22d2171d..1d5a4c84 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -12,7 +12,7 @@ static const float bordercolor[]           = COLOR(0x444444ff);
+ static const float focuscolor[]            = COLOR(0x005577ff);
+ static const float urgentcolor[]           = COLOR(0xff0000ff);
+ /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
+-static const float fullscreen_bg[]         = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
++static const float fullscreen_bg[]         = {0.1f, 0.1f, 0.1f, 0.0f}; /* You can also use glsl colors */
+ 
+ /* tagging - TAGCOUNT must be no greater than 31 */
+ #define TAGCOUNT (9)
+diff --git a/dwl.c b/dwl.c
+index ad21e1ba..f5395fe6 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -505,7 +505,9 @@ applyrules(Client *c)
+ void
+ arrange(Monitor *m)
+ {
+-  Client *c;
++  LayerSurface *l;
++  Client *c, *sel = focustop(m);
++  int i;
+ 
+   if (!m->wlr_output->enabled)
+       return;
+@@ -536,6 +538,26 @@ arrange(Monitor *m)
+                               : c->scene->node.parent);
+   }
+ 
++  if (sel && sel->isfullscreen && VISIBLEON(sel, m)) {
++      for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
++          wl_list_for_each(l, &sel->mon->layers[i], link)
++              wlr_scene_node_set_enabled(&l->scene->node, 0);
++      }
++
++      wl_list_for_each(c, &clients, link) {
++          if (c->mon != m)
++              continue;
++          wlr_scene_node_set_enabled(&c->scene->node, (sel->isfullscreen && c == sel)
++                  || !sel->isfullscreen);
++      }
++  }
++  if (!sel || (!sel->isfullscreen && VISIBLEON(sel, m))) {
++      for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
++          wl_list_for_each(l, &m->layers[i], link)
++              wlr_scene_node_set_enabled(&l->scene->node, 1);
++      }
++  }
++
+   if (m->lt[m->sellt]->arrange)
+       m->lt[m->sellt]->arrange(m);
+   motionnotify(0, NULL, 0, 0, 0, 0);
+-- 
+2.48.0
+
diff --git a/dwl/patches/hide-behind-monocle/README.md b/dwl/patches/hide-behind-monocle/README.md
new file mode 100644
index 0000000..507d2e1
--- /dev/null
+++ b/dwl/patches/hide-behind-monocle/README.md
@@ -0,0 +1,10 @@
+### Description
+Hide all clients behind the focused one in the monocle layout
+
+### Download
+- [git branch](https://codeberg.org/sevz/dwl/src/branch/hide-behind-monocle)
+- [main 2025-01-20](/dwl/dwl-patches/raw/branch/main/patches/hide-behind-monocle/hide-behind-monocle.patch)
+- [hide-behind-monocle-0.7.patch](/dwl/dwl-patches/raw/branch/main/patches/hide-behind-monocle/hide-behind-monocle-0.7.patch)
+
+### Authors
+- [sevz](https://codeberg.org/sevz)
diff --git a/dwl/patches/hide-behind-monocle/hide-behind-monocle-0.7.patch b/dwl/patches/hide-behind-monocle/hide-behind-monocle-0.7.patch
new file mode 100644
index 0000000..76b6e96
--- /dev/null
+++ b/dwl/patches/hide-behind-monocle/hide-behind-monocle-0.7.patch
@@ -0,0 +1,332 @@
+From 9bb408e6921b582dbcf5adfc36a7618086219998 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
+ <leohdz172@proton.me>
+Date: Sat, 8 Jul 2023 17:25:16 -0600
+Subject: [PATCH] hide behind monocle
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
+---
+ dwl.c | 87 +++++++++++++++++++++++++++++++++++++----------------------
+ 1 file changed, 55 insertions(+), 32 deletions(-)
+
+diff --git a/dwl.c b/dwl.c
+index a2711f67..70687178 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -288,10 +288,11 @@ static Monitor *dirtomon(enum wlr_direction dir);
+ static void focusclient(Client *c, int lift);
+ static void focusmon(const Arg *arg);
+ static void focusstack(const Arg *arg);
+-static Client *focustop(Monitor *m);
++static Client *focustop(Monitor *m, int onlytiled);
+ static void fullscreennotify(struct wl_listener *listener, void *data);
+ static void gpureset(struct wl_listener *listener, void *data);
+ static void handlesig(int signo);
++static void hidebehindmonocle(Monitor *m);
+ static void incnmaster(const Arg *arg);
+ static void inputdevice(struct wl_listener *listener, void *data);
+ static int keybinding(uint32_t mods, xkb_keysym_t sym);
+@@ -497,7 +498,7 @@ arrange(Monitor *m)
+   }
+ 
+   wlr_scene_node_set_enabled(&m->fullscreen_bg->node,
+-          (c = focustop(m)) && c->isfullscreen);
++          (c = focustop(m, 0)) && c->isfullscreen);
+ 
+   strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
+ 
+@@ -750,7 +751,7 @@ closemon(Monitor *m)
+       if (c->mon == m)
+           setmon(c, selmon, c->tags);
+   }
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   printstatus();
+ }
+ 
+@@ -1185,7 +1186,7 @@ void
+ destroydragicon(struct wl_listener *listener, void *data)
+ {
+   /* Focus enter isn't sent during drag, so refocus the focused node. */
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   motionnotify(0, NULL, 0, 0, 0, 0);
+ }
+ 
+@@ -1220,7 +1221,7 @@ destroylock(SessionLock *lock, int unlock)
+ 
+   wlr_scene_node_set_enabled(&locked_bg->node, 0);
+ 
+-  focusclient(focustop(selmon), 0);
++  focusclient(focustop(selmon, 0), 0);
+   motionnotify(0, NULL, 0, 0, 0, 0);
+ 
+ destroy:
+@@ -1249,7 +1250,7 @@ destroylocksurface(struct wl_listener *listener, void *data)
+       surface = wl_container_of(cur_lock->surfaces.next, surface, link);
+       client_notify_enter(surface->surface, wlr_seat_get_keyboard(seat));
+   } else if (!locked) {
+-      focusclient(focustop(selmon), 1);
++      focusclient(focustop(selmon, 0), 1);
+   } else {
+       wlr_seat_keyboard_clear_focus(seat);
+   }
+@@ -1366,6 +1367,7 @@ focusclient(Client *c, int lift)
+       wl_list_insert(&fstack, &c->flink);
+       selmon = c->mon;
+       c->isurgent = 0;
++      hidebehindmonocle(c->mon);
+       client_restack_surface(c);
+ 
+       /* Don't change border color if there is an exclusive focus or we are
+@@ -1420,14 +1422,14 @@ focusmon(const Arg *arg)
+           selmon = dirtomon(arg->i);
+       while (!selmon->wlr_output->enabled && i++ < nmons);
+   }
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+ }
+ 
+ void
+ focusstack(const Arg *arg)
+ {
+   /* Focus the next or previous client (in tiling order) on selmon */
+-  Client *c, *sel = focustop(selmon);
++  Client *c, *sel = focustop(selmon, 0);
+   if (!sel || (sel->isfullscreen && !client_has_children(sel)))
+       return;
+   if (arg->i > 0) {
+@@ -1453,12 +1455,15 @@ focusstack(const Arg *arg)
+  * will focus the topmost client of this mon, when actually will
+  * only return that client */
+ Client *
+-focustop(Monitor *m)
++focustop(Monitor *m, int onlytiled)
+ {
+   Client *c;
+   wl_list_for_each(c, &fstack, flink) {
+-      if (VISIBLEON(c, m))
++      if (VISIBLEON(c, m)) {
++          if (onlytiled && c->isfloating)
++              continue;
+           return c;
++      }
+   }
+   return NULL;
+ }
+@@ -1515,6 +1520,25 @@ handlesig(int signo)
+   }
+ }
+ 
++void
++hidebehindmonocle(Monitor *m)
++{
++  Client *c;
++  if (m && m->lt[m->sellt]->arrange == monocle) {
++      wl_list_for_each(c, &clients, link) {
++          if (c->mon != m)
++              continue;
++          wlr_scene_node_set_enabled(&c->scene->node, VISIBLEON(c, m) && c->isfloating);
++      }
++
++      c = NULL;
++
++      /* Enable top tiled client, fullscreen is considered tiled */
++      if ((c = focustop(m, 1)))
++          wlr_scene_node_set_enabled(&c->scene->node, 1);
++  }
++}
++
+ void
+ incnmaster(const Arg *arg)
+ {
+@@ -1653,7 +1677,7 @@ keyrepeat(void *data)
+ void
+ killclient(const Arg *arg)
+ {
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   if (sel)
+       client_send_close(sel);
+ }
+@@ -1780,8 +1804,7 @@ monocle(Monitor *m)
+   }
+   if (n)
+       snprintf(m->ltsymbol, LENGTH(m->ltsymbol), "[%d]", n);
+-  if ((c = focustop(m)))
+-      wlr_scene_node_raise_to_top(&c->scene->node);
++  hidebehindmonocle(m);
+ }
+ 
+ void
+@@ -2049,7 +2072,7 @@ printstatus(void)
+           if (c->isurgent)
+               urg |= c->tags;
+       }
+-      if ((c = focustop(m))) {
++      if ((c = focustop(m, 0))) {
+           title = client_get_title(c);
+           appid = client_get_appid(c);
+           printf("%s title %s\n", m->wlr_output->name, title ? title : broken);
+@@ -2401,7 +2424,7 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
+       setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
+       setfloating(c, c->isfloating);
+   }
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+ }
+ 
+ void
+@@ -2670,12 +2693,12 @@ startdrag(struct wl_listener *listener, void *data)
+ void
+ tag(const Arg *arg)
+ {
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   if (!sel || (arg->ui & TAGMASK) == 0)
+       return;
+ 
+   sel->tags = arg->ui & TAGMASK;
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   arrange(selmon);
+   printstatus();
+ }
+@@ -2683,7 +2706,7 @@ tag(const Arg *arg)
+ void
+ tagmon(const Arg *arg)
+ {
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   if (sel)
+       setmon(sel, dirtomon(arg->i), 0);
+ }
+@@ -2725,7 +2748,7 @@ tile(Monitor *m)
+ void
+ togglefloating(const Arg *arg)
+ {
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   /* return if fullscreen */
+   if (sel && !sel->isfullscreen)
+       setfloating(sel, !sel->isfloating);
+@@ -2734,7 +2757,7 @@ togglefloating(const Arg *arg)
+ void
+ togglefullscreen(const Arg *arg)
+ {
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   if (sel)
+       setfullscreen(sel, !sel->isfullscreen);
+ }
+@@ -2743,12 +2766,12 @@ void
+ toggletag(const Arg *arg)
+ {
+   uint32_t newtags;
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   if (!sel || !(newtags = sel->tags ^ (arg->ui & TAGMASK)))
+       return;
+ 
+   sel->tags = newtags;
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   arrange(selmon);
+   printstatus();
+ }
+@@ -2761,7 +2784,7 @@ toggleview(const Arg *arg)
+       return;
+ 
+   selmon->tagset[selmon->seltags] = newtagset;
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   arrange(selmon);
+   printstatus();
+ }
+@@ -2785,7 +2808,7 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data)
+   if (l->layer_surface->output && (l->mon = l->layer_surface->output->data))
+       arrangelayers(l->mon);
+   if (l->layer_surface->surface == seat->keyboard_state.focused_surface)
+-      focusclient(focustop(selmon), 1);
++      focusclient(focustop(selmon, 0), 1);
+   motionnotify(0, NULL, 0, 0, 0, 0);
+ }
+ 
+@@ -2802,7 +2825,7 @@ unmapnotify(struct wl_listener *listener, void *data)
+   if (client_is_unmanaged(c)) {
+       if (c == exclusive_focus) {
+           exclusive_focus = NULL;
+-          focusclient(focustop(selmon), 1);
++          focusclient(focustop(selmon, 0), 1);
+       }
+   } else {
+       wl_list_remove(&c->link);
+@@ -2883,7 +2906,7 @@ updatemons(struct wl_listener *listener, void *data)
+       /* Don't move clients to the left output when plugging monitors */
+       arrange(m);
+       /* make sure fullscreen clients have the right size */
+-      if ((c = focustop(m)) && c->isfullscreen)
++      if ((c = focustop(m, 0)) && c->isfullscreen)
+           resize(c, m->m, 0);
+ 
+       /* Try to re-set the gamma LUT when updating monitors,
+@@ -2903,7 +2926,7 @@ updatemons(struct wl_listener *listener, void *data)
+           if (!c->mon && client_surface(c)->mapped)
+               setmon(c, selmon, c->tags);
+       }
+-      focusclient(focustop(selmon), 1);
++      focusclient(focustop(selmon, 0), 1);
+       if (selmon->lock_surface) {
+           client_notify_enter(selmon->lock_surface->surface,
+                   wlr_seat_get_keyboard(seat));
+@@ -2925,7 +2948,7 @@ void
+ updatetitle(struct wl_listener *listener, void *data)
+ {
+   Client *c = wl_container_of(listener, c, set_title);
+-  if (c == focustop(c->mon))
++  if (c == focustop(c->mon, 0))
+       printstatus();
+ }
+ 
+@@ -2935,7 +2958,7 @@ urgent(struct wl_listener *listener, void *data)
+   struct wlr_xdg_activation_v1_request_activate_event *event = data;
+   Client *c = NULL;
+   toplevel_from_wlr_surface(event->surface, &c, NULL);
+-  if (!c || c == focustop(selmon))
++  if (!c || c == focustop(selmon, 0))
+       return;
+ 
+   c->isurgent = 1;
+@@ -2953,7 +2976,7 @@ view(const Arg *arg)
+   selmon->seltags ^= 1; /* toggle sel tagset */
+   if (arg->ui & TAGMASK)
+       selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   arrange(selmon);
+   printstatus();
+ }
+@@ -3024,7 +3047,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
+ void
+ zoom(const Arg *arg)
+ {
+-  Client *c, *sel = focustop(selmon);
++  Client *c, *sel = focustop(selmon, 0);
+ 
+   if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating)
+       return;
+@@ -3141,7 +3164,7 @@ sethints(struct wl_listener *listener, void *data)
+ {
+   Client *c = wl_container_of(listener, c, set_hints);
+   struct wlr_surface *surface = client_surface(c);
+-  if (c == focustop(selmon))
++  if (c == focustop(selmon, 0))
+       return;
+ 
+   c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
+-- 
+2.46.0
+
diff --git a/dwl/patches/hide-behind-monocle/hide-behind-monocle.patch b/dwl/patches/hide-behind-monocle/hide-behind-monocle.patch
new file mode 100644
index 0000000..dfe23dd
--- /dev/null
+++ b/dwl/patches/hide-behind-monocle/hide-behind-monocle.patch
@@ -0,0 +1,332 @@
+From 8022376ee59d616831271dbc9f289a8bfd4fedda Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
+ <leohdz172@proton.me>
+Date: Sat, 8 Jul 2023 17:25:16 -0600
+Subject: [PATCH] hide behind monocle
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
+---
+ dwl.c | 87 +++++++++++++++++++++++++++++++++++++----------------------
+ 1 file changed, 55 insertions(+), 32 deletions(-)
+
+diff --git a/dwl.c b/dwl.c
+index ad21e1ba..cad3b0b2 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -285,10 +285,11 @@ static Monitor *dirtomon(enum wlr_direction dir);
+ static void focusclient(Client *c, int lift);
+ static void focusmon(const Arg *arg);
+ static void focusstack(const Arg *arg);
+-static Client *focustop(Monitor *m);
++static Client *focustop(Monitor *m, int onlytiled);
+ static void fullscreennotify(struct wl_listener *listener, void *data);
+ static void gpureset(struct wl_listener *listener, void *data);
+ static void handlesig(int signo);
++static void hidebehindmonocle(Monitor *m);
+ static void incnmaster(const Arg *arg);
+ static void inputdevice(struct wl_listener *listener, void *data);
+ static int keybinding(uint32_t mods, xkb_keysym_t sym);
+@@ -518,7 +519,7 @@ arrange(Monitor *m)
+   }
+ 
+   wlr_scene_node_set_enabled(&m->fullscreen_bg->node,
+-          (c = focustop(m)) && c->isfullscreen);
++          (c = focustop(m, 0)) && c->isfullscreen);
+ 
+   strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
+ 
+@@ -807,7 +808,7 @@ closemon(Monitor *m)
+       if (c->mon == m)
+           setmon(c, selmon, c->tags);
+   }
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   printstatus();
+ }
+ 
+@@ -1243,7 +1244,7 @@ void
+ destroydragicon(struct wl_listener *listener, void *data)
+ {
+   /* Focus enter isn't sent during drag, so refocus the focused node. */
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   motionnotify(0, NULL, 0, 0, 0, 0);
+   wl_list_remove(&listener->link);
+ }
+@@ -1280,7 +1281,7 @@ destroylock(SessionLock *lock, int unlock)
+ 
+   wlr_scene_node_set_enabled(&locked_bg->node, 0);
+ 
+-  focusclient(focustop(selmon), 0);
++  focusclient(focustop(selmon, 0), 0);
+   motionnotify(0, NULL, 0, 0, 0, 0);
+ 
+ destroy:
+@@ -1309,7 +1310,7 @@ destroylocksurface(struct wl_listener *listener, void *data)
+       surface = wl_container_of(cur_lock->surfaces.next, surface, link);
+       client_notify_enter(surface->surface, wlr_seat_get_keyboard(seat));
+   } else if (!locked) {
+-      focusclient(focustop(selmon), 1);
++      focusclient(focustop(selmon, 0), 1);
+   } else {
+       wlr_seat_keyboard_clear_focus(seat);
+   }
+@@ -1420,6 +1421,7 @@ focusclient(Client *c, int lift)
+       wl_list_insert(&fstack, &c->flink);
+       selmon = c->mon;
+       c->isurgent = 0;
++      hidebehindmonocle(c->mon);
+ 
+       /* Don't change border color if there is an exclusive focus or we are
+        * handling a drag operation */
+@@ -1473,14 +1475,14 @@ focusmon(const Arg *arg)
+           selmon = dirtomon(arg->i);
+       while (!selmon->wlr_output->enabled && i++ < nmons);
+   }
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+ }
+ 
+ void
+ focusstack(const Arg *arg)
+ {
+   /* Focus the next or previous client (in tiling order) on selmon */
+-  Client *c, *sel = focustop(selmon);
++  Client *c, *sel = focustop(selmon, 0);
+   if (!sel || (sel->isfullscreen && !client_has_children(sel)))
+       return;
+   if (arg->i > 0) {
+@@ -1506,12 +1508,15 @@ focusstack(const Arg *arg)
+  * will focus the topmost client of this mon, when actually will
+  * only return that client */
+ Client *
+-focustop(Monitor *m)
++focustop(Monitor *m, int onlytiled)
+ {
+   Client *c;
+   wl_list_for_each(c, &fstack, flink) {
+-      if (VISIBLEON(c, m))
++      if (VISIBLEON(c, m)) {
++          if (onlytiled && c->isfloating)
++              continue;
+           return c;
++      }
+   }
+   return NULL;
+ }
+@@ -1557,6 +1562,25 @@ handlesig(int signo)
+       quit(NULL);
+ }
+ 
++void
++hidebehindmonocle(Monitor *m)
++{
++  Client *c;
++  if (m && m->lt[m->sellt]->arrange == monocle) {
++      wl_list_for_each(c, &clients, link) {
++          if (c->mon != m)
++              continue;
++          wlr_scene_node_set_enabled(&c->scene->node, VISIBLEON(c, m) && c->isfloating);
++      }
++
++      c = NULL;
++
++      /* Enable top tiled client, fullscreen is considered tiled */
++      if ((c = focustop(m, 1)))
++          wlr_scene_node_set_enabled(&c->scene->node, 1);
++  }
++}
++
+ void
+ incnmaster(const Arg *arg)
+ {
+@@ -1695,7 +1719,7 @@ keyrepeat(void *data)
+ void
+ killclient(const Arg *arg)
+ {
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   if (sel)
+       client_send_close(sel);
+ }
+@@ -1824,8 +1848,7 @@ monocle(Monitor *m)
+   }
+   if (n)
+       snprintf(m->ltsymbol, LENGTH(m->ltsymbol), "[%d]", n);
+-  if ((c = focustop(m)))
+-      wlr_scene_node_raise_to_top(&c->scene->node);
++  hidebehindmonocle(m);
+ }
+ 
+ void
+@@ -2092,7 +2115,7 @@ printstatus(void)
+           if (c->isurgent)
+               urg |= c->tags;
+       }
+-      if ((c = focustop(m))) {
++      if ((c = focustop(m, 0))) {
+           printf("%s title %s\n", m->wlr_output->name, client_get_title(c));
+           printf("%s appid %s\n", m->wlr_output->name, client_get_appid(c));
+           printf("%s fullscreen %d\n", m->wlr_output->name, c->isfullscreen);
+@@ -2406,7 +2429,7 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
+       setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
+       setfloating(c, c->isfloating);
+   }
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+ }
+ 
+ void
+@@ -2680,12 +2703,12 @@ startdrag(struct wl_listener *listener, void *data)
+ void
+ tag(const Arg *arg)
+ {
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   if (!sel || (arg->ui & TAGMASK) == 0)
+       return;
+ 
+   sel->tags = arg->ui & TAGMASK;
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   arrange(selmon);
+   printstatus();
+ }
+@@ -2693,7 +2716,7 @@ tag(const Arg *arg)
+ void
+ tagmon(const Arg *arg)
+ {
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   if (sel)
+       setmon(sel, dirtomon(arg->i), 0);
+ }
+@@ -2735,7 +2758,7 @@ tile(Monitor *m)
+ void
+ togglefloating(const Arg *arg)
+ {
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   /* return if fullscreen */
+   if (sel && !sel->isfullscreen)
+       setfloating(sel, !sel->isfloating);
+@@ -2744,7 +2767,7 @@ togglefloating(const Arg *arg)
+ void
+ togglefullscreen(const Arg *arg)
+ {
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   if (sel)
+       setfullscreen(sel, !sel->isfullscreen);
+ }
+@@ -2753,12 +2776,12 @@ void
+ toggletag(const Arg *arg)
+ {
+   uint32_t newtags;
+-  Client *sel = focustop(selmon);
++  Client *sel = focustop(selmon, 0);
+   if (!sel || !(newtags = sel->tags ^ (arg->ui & TAGMASK)))
+       return;
+ 
+   sel->tags = newtags;
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   arrange(selmon);
+   printstatus();
+ }
+@@ -2771,7 +2794,7 @@ toggleview(const Arg *arg)
+       return;
+ 
+   selmon->tagset[selmon->seltags] = newtagset;
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   arrange(selmon);
+   printstatus();
+ }
+@@ -2795,7 +2818,7 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data)
+   if (l->layer_surface->output && (l->mon = l->layer_surface->output->data))
+       arrangelayers(l->mon);
+   if (l->layer_surface->surface == seat->keyboard_state.focused_surface)
+-      focusclient(focustop(selmon), 1);
++      focusclient(focustop(selmon, 0), 1);
+   motionnotify(0, NULL, 0, 0, 0, 0);
+ }
+ 
+@@ -2812,7 +2835,7 @@ unmapnotify(struct wl_listener *listener, void *data)
+   if (client_is_unmanaged(c)) {
+       if (c == exclusive_focus) {
+           exclusive_focus = NULL;
+-          focusclient(focustop(selmon), 1);
++          focusclient(focustop(selmon, 0), 1);
+       }
+   } else {
+       wl_list_remove(&c->link);
+@@ -2893,7 +2916,7 @@ updatemons(struct wl_listener *listener, void *data)
+       /* Don't move clients to the left output when plugging monitors */
+       arrange(m);
+       /* make sure fullscreen clients have the right size */
+-      if ((c = focustop(m)) && c->isfullscreen)
++      if ((c = focustop(m, 0)) && c->isfullscreen)
+           resize(c, m->m, 0);
+ 
+       /* Try to re-set the gamma LUT when updating monitors,
+@@ -2913,7 +2936,7 @@ updatemons(struct wl_listener *listener, void *data)
+           if (!c->mon && client_surface(c)->mapped)
+               setmon(c, selmon, c->tags);
+       }
+-      focusclient(focustop(selmon), 1);
++      focusclient(focustop(selmon, 0), 1);
+       if (selmon->lock_surface) {
+           client_notify_enter(selmon->lock_surface->surface,
+                   wlr_seat_get_keyboard(seat));
+@@ -2935,7 +2958,7 @@ void
+ updatetitle(struct wl_listener *listener, void *data)
+ {
+   Client *c = wl_container_of(listener, c, set_title);
+-  if (c == focustop(c->mon))
++  if (c == focustop(c->mon, 0))
+       printstatus();
+ }
+ 
+@@ -2945,7 +2968,7 @@ urgent(struct wl_listener *listener, void *data)
+   struct wlr_xdg_activation_v1_request_activate_event *event = data;
+   Client *c = NULL;
+   toplevel_from_wlr_surface(event->surface, &c, NULL);
+-  if (!c || c == focustop(selmon))
++  if (!c || c == focustop(selmon, 0))
+       return;
+ 
+   c->isurgent = 1;
+@@ -2963,7 +2986,7 @@ view(const Arg *arg)
+   selmon->seltags ^= 1; /* toggle sel tagset */
+   if (arg->ui & TAGMASK)
+       selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
+-  focusclient(focustop(selmon), 1);
++  focusclient(focustop(selmon, 0), 1);
+   arrange(selmon);
+   printstatus();
+ }
+@@ -3034,7 +3057,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
+ void
+ zoom(const Arg *arg)
+ {
+-  Client *c, *sel = focustop(selmon);
++  Client *c, *sel = focustop(selmon, 0);
+ 
+   if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating)
+       return;
+@@ -3145,7 +3168,7 @@ sethints(struct wl_listener *listener, void *data)
+ {
+   Client *c = wl_container_of(listener, c, set_hints);
+   struct wlr_surface *surface = client_surface(c);
+-  if (c == focustop(selmon))
++  if (c == focustop(selmon, 0))
+       return;
+ 
+   c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
+-- 
+2.48.0
+
diff --git a/dwl/patches/hide-cursor-when-typing/README.md b/dwl/patches/hide-cursor-when-typing/README.md
new file mode 100644
index 0000000..95b4961
--- /dev/null
+++ b/dwl/patches/hide-cursor-when-typing/README.md
@@ -0,0 +1,15 @@
+### Description
+
+Hide the mouse cursor when you start typing, and restore it again when the
+mouse cursor moves or a mouse button is pressed, just like
+[xbanish](https://github.com/jcs/xbanish).
+
+### credits
+Some code is taken from the
+[unclutter](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/unclutter) patch.
+
+### Download
+[v0.8](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/hide-cursor-when-typing/hide-cursor-when-typing.patch)
+
+### Authors
+- [unixchad](https://codeberg.org/unixchad/)
diff --git a/dwl/patches/hide-cursor-when-typing/hide-cursor-when-typing.patch b/dwl/patches/hide-cursor-when-typing/hide-cursor-when-typing.patch
new file mode 100644
index 0000000..fe71534
--- /dev/null
+++ b/dwl/patches/hide-cursor-when-typing/hide-cursor-when-typing.patch
@@ -0,0 +1,170 @@
+From c72de058e6635c5bb3d973995ccbdb6e028f354d Mon Sep 17 00:00:00 2001
+From: nate zhou <gnuunixchad@outlook.com>
+Date: Tue, 3 Mar 2026 16:48:46 +0800
+Subject: [PATCH] Patch: hide-cursor-when-typing-0.8.patch
+
+Hide the cursor when start typing, and restore it when start moving
+cursor again, just like xbanish.
+---
+ config.def.h |  2 ++
+ dwl.c        | 68 ++++++++++++++++++++++++++++++++++++++++++++++------
+ 2 files changed, 63 insertions(+), 7 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 8a6eda0..6205c0a 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -102,6 +102,8 @@ 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;
+ 
++static const int hide_cursor_when_typing = 1;
++
+ /* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
+ #define MODKEY WLR_MODIFIER_ALT
+ 
+diff --git a/dwl.c b/dwl.c
+index 44f3ad9..9a076b6 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -289,6 +289,8 @@ static Client *focustop(Monitor *m);
+ static void fullscreennotify(struct wl_listener *listener, void *data);
+ static void gpureset(struct wl_listener *listener, void *data);
+ static void handlesig(int signo);
++static void handlecursoractivity(void);
++static int hidecursor(void *data);
+ static void incnmaster(const Arg *arg);
+ static void inputdevice(struct wl_listener *listener, void *data);
+ static int keybinding(uint32_t mods, xkb_keysym_t sym);
+@@ -389,6 +391,14 @@ static struct wlr_pointer_constraint_v1 *active_constraint;
+ 
+ static struct wlr_cursor *cursor;
+ static struct wlr_xcursor_manager *cursor_mgr;
++static struct wl_event_source *hide_source;
++static bool cursor_hidden = false;
++static struct {
++  enum wp_cursor_shape_device_v1_shape shape;
++  struct wlr_surface *surface;
++  int hotspot_x;
++  int hotspot_y;
++} last_cursor;
+ 
+ static struct wlr_scene_rect *root_bg;
+ static struct wlr_session_lock_manager_v1 *session_lock_mgr;
+@@ -610,6 +620,7 @@ axisnotify(struct wl_listener *listener, void *data)
+    * for example when you move the scroll wheel. */
+   struct wlr_pointer_axis_event *event = data;
+   wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
++    handlecursoractivity();
+   /* TODO: allow usage of scroll wheel for mousebindings, it can be implemented
+    * by checking the event's orientation and the delta of the event */
+   /* Notify the client with pointer focus of the axis event. */
+@@ -628,6 +639,7 @@ buttonpress(struct wl_listener *listener, void *data)
+   const Button *b;
+ 
+   wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
++    handlecursoractivity();
+ 
+   switch (event->state) {
+   case WL_POINTER_BUTTON_STATE_PRESSED:
+@@ -1566,6 +1578,30 @@ handlesig(int signo)
+       quit(NULL);
+ }
+ 
++void
++handlecursoractivity(void)
++{
++  if (!cursor_hidden)
++      return;
++
++  cursor_hidden = false;
++
++  if (last_cursor.shape)
++      wlr_cursor_set_xcursor(cursor, cursor_mgr,
++                wlr_cursor_shape_v1_name(last_cursor.shape));
++  else
++      wlr_cursor_set_surface(cursor, last_cursor.surface,
++                last_cursor.hotspot_x, last_cursor.hotspot_y);
++}
++
++int
++hidecursor(void *data)
++{
++  wlr_cursor_unset_image(cursor);
++  cursor_hidden = true;
++  return 1;
++}
++
+ void
+ incnmaster(const Arg *arg)
+ {
+@@ -1645,6 +1681,11 @@ keypress(struct wl_listener *listener, void *data)
+ 
+   wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
+ 
++     /* hide cursor when typing starts */
++    if (hide_cursor_when_typing && !cursor_hidden && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
++        hidecursor(NULL);
++    }
++
+   /* On _press_ if there is no active screen locker,
+    * attempt to process a compositor keybinding. */
+   if (!locked && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
+@@ -1907,6 +1948,7 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
+ 
+       wlr_cursor_move(cursor, device, dx, dy);
+       wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
++        handlecursoractivity();
+ 
+       /* Update selmon (even while dragging a window) */
+       if (sloppyfocus)
+@@ -1931,7 +1973,7 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
+   /* If there's no client surface under the cursor, set the cursor image to a
+    * default. This is what makes the cursor image appear when you move it
+    * off of a client or over its border. */
+-  if (!surface && !seat->drag)
++  if (!surface && !seat->drag && !cursor_hidden)
+       wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
+ 
+   pointerfocus(c, surface, sx, sy, time);
+@@ -2311,9 +2353,16 @@ setcursor(struct wl_listener *listener, void *data)
+    * use the provided surface as the cursor image. It will set the
+    * hardware cursor on the output that it's currently on and continue to
+    * do so as the cursor moves between outputs. */
+-  if (event->seat_client == seat->pointer_state.focused_client)
+-      wlr_cursor_set_surface(cursor, event->surface,
+-              event->hotspot_x, event->hotspot_y);
++  if (event->seat_client == seat->pointer_state.focused_client) {
++        last_cursor.shape = 0;
++        last_cursor.surface = event->surface;
++        last_cursor.hotspot_x = event->hotspot_x;
++        last_cursor.hotspot_y = event->hotspot_y;
++
++        if (!cursor_hidden)
++          wlr_cursor_set_surface(cursor, event->surface,
++                    event->hotspot_x, event->hotspot_y);
++    }
+ }
+ 
+ void
+@@ -2325,9 +2374,14 @@ setcursorshape(struct wl_listener *listener, void *data)
+   /* This can be sent by any client, so we check to make sure this one
+    * actually has pointer focus first. If so, we can tell the cursor to
+    * use the provided cursor shape. */
+-  if (event->seat_client == seat->pointer_state.focused_client)
+-      wlr_cursor_set_xcursor(cursor, cursor_mgr,
+-              wlr_cursor_shape_v1_name(event->shape));
++  if (event->seat_client == seat->pointer_state.focused_client) {
++      last_cursor.shape = event->shape;
++      last_cursor.surface = NULL;
++
++      if (!cursor_hidden)
++          wlr_cursor_set_xcursor(cursor, cursor_mgr,
++                    wlr_cursor_shape_v1_name(event->shape));
++  }
+ }
+ 
+ void
+-- 
+2.53.0
+
diff --git a/dwl/patches/pertag/README.md b/dwl/patches/pertag/README.md
new file mode 100644
index 0000000..7473da0
--- /dev/null
+++ b/dwl/patches/pertag/README.md
@@ -0,0 +1,12 @@
+### Description
+Makes layout, mwfact and nmaster individual for every tag.
+
+### Download
+- [git branch](https://codeberg.org/wochap/dwl/src/branch/v0.6/pertag)
+- [v0.6](https://codeberg.org/dwl/dwl-patches/raw/commit/65ea99519bbf7a52f48932aea7385f81f8b30867/patches/pertag/pertag.patch)
+- [2024-04-11](https://codeberg.org/dwl/dwl-patches/raw/commit/bf098459219e7a473d8edb4c0435aeb6a4b82e38/pertag/pertag.patch)
+- [v0.5](https://codeberg.org/dwl/dwl-patches/raw/commit/3f9a58cde9e3aa02991b3e5a22d371b153cb1459/pertag/pertag.patch)
+
+### Authors
+- [wochap](https://codeberg.org/wochap)
+- [Guido Cella](https://github.com/guidocella)
diff --git a/dwl/patches/pertag/pertag.patch b/dwl/patches/pertag/pertag.patch
new file mode 100644
index 0000000..971732a
--- /dev/null
+++ b/dwl/patches/pertag/pertag.patch
@@ -0,0 +1,170 @@
+From d3b551ffe3ec85e16341962e322150b81af6722f Mon Sep 17 00:00:00 2001
+From: wochap <gean.marroquin@gmail.com>
+Date: Wed, 31 Jul 2024 08:27:26 -0500
+Subject: [PATCH] makes layout, mwfact and nmaster individual for every tag
+
+inspiration: https://github.com/djpohly/dwl/wiki/pertag
+---
+ dwl.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 70 insertions(+), 5 deletions(-)
+
+diff --git a/dwl.c b/dwl.c
+index 145fd01..2f364bc 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -102,6 +102,7 @@ typedef struct {
+   const Arg arg;
+ } Button;
+ 
++typedef struct Pertag Pertag;
+ typedef struct Monitor Monitor;
+ typedef struct {
+   /* Must keep these three elements in this order */
+@@ -199,6 +200,7 @@ struct Monitor {
+   struct wlr_box w; /* window area, layout-relative */
+   struct wl_list layers[4]; /* LayerSurface.link */
+   const Layout *lt[2];
++  Pertag *pertag;
+   unsigned int seltags;
+   unsigned int sellt;
+   uint32_t tagset[2];
+@@ -427,6 +429,14 @@ static xcb_atom_t netatom[NetLast];
+ /* attempt to encapsulate suck into one file */
+ #include "client.h"
+ 
++struct Pertag {
++  unsigned int curtag, prevtag; /* current and previous tag */
++  int nmasters[TAGCOUNT + 1]; /* number of windows in master area */
++  float mfacts[TAGCOUNT + 1]; /* mfacts per tag */
++  unsigned int sellts[TAGCOUNT + 1]; /* selected layouts */
++  const Layout *ltidxs[TAGCOUNT + 1][2]; /* matrix of tags and layouts indexes  */
++};
++
+ /* function implementations */
+ void
+ applybounds(Client *c, struct wlr_box *bbox)
+@@ -712,6 +722,7 @@ cleanupmon(struct wl_listener *listener, void *data)
+   wlr_output_layout_remove(output_layout, m->wlr_output);
+   wlr_scene_output_destroy(m->scene_output);
+ 
++  free(m->pertag);
+   closemon(m);
+   wlr_scene_node_destroy(&m->fullscreen_bg->node);
+   free(m);
+@@ -983,6 +994,18 @@ createmon(struct wl_listener *listener, void *data)
+   wl_list_insert(&mons, &m->link);
+   printstatus();
+ 
++  m->pertag = calloc(1, sizeof(Pertag));
++  m->pertag->curtag = m->pertag->prevtag = 1;
++
++  for (i = 0; i <= TAGCOUNT; i++) {
++      m->pertag->nmasters[i] = m->nmaster;
++      m->pertag->mfacts[i] = m->mfact;
++
++      m->pertag->ltidxs[i][0] = m->lt[0];
++      m->pertag->ltidxs[i][1] = m->lt[1];
++      m->pertag->sellts[i] = m->sellt;
++  }
++
+   /* The xdg-protocol specifies:
+    *
+    * If the fullscreened surface is not opaque, the compositor must make
+@@ -1472,7 +1495,7 @@ incnmaster(const Arg *arg)
+ {
+   if (!arg || !selmon)
+       return;
+-  selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
++  selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0);
+   arrange(selmon);
+ }
+ 
+@@ -2305,9 +2328,9 @@ setlayout(const Arg *arg)
+   if (!selmon)
+       return;
+   if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
+-      selmon->sellt ^= 1;
++      selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
+   if (arg && arg->v)
+-      selmon->lt[selmon->sellt] = (Layout *)arg->v;
++      selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
+   strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol));
+   arrange(selmon);
+   printstatus();
+@@ -2324,7 +2347,7 @@ setmfact(const Arg *arg)
+   f = arg->f < 1.0f ? arg->f + selmon->mfact : arg->f - 1.0f;
+   if (f < 0.1 || f > 0.9)
+       return;
+-  selmon->mfact = f;
++  selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f;
+   arrange(selmon);
+ }
+ 
+@@ -2701,9 +2724,29 @@ void
+ toggleview(const Arg *arg)
+ {
+   uint32_t newtagset;
++  size_t i;
+   if (!(newtagset = selmon ? selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK) : 0))
+       return;
+ 
++  if (newtagset == (uint32_t)~0) {
++      selmon->pertag->prevtag = selmon->pertag->curtag;
++      selmon->pertag->curtag = 0;
++  }
++
++  /* test if the user did not select the same tag */
++  if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) {
++      selmon->pertag->prevtag = selmon->pertag->curtag;
++      for (i = 0; !(newtagset & 1 << i); i++) ;
++      selmon->pertag->curtag = i + 1;
++  }
++
++  /* apply settings for this view */
++  selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
++  selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
++  selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
++  selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
++  selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
++
+   selmon->tagset[selmon->seltags] = newtagset;
+   focusclient(focustop(selmon), 1);
+   arrange(selmon);
+@@ -2892,11 +2935,33 @@ urgent(struct wl_listener *listener, void *data)
+ void
+ view(const Arg *arg)
+ {
++  size_t i, tmptag;
++
+   if (!selmon || (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
+       return;
+   selmon->seltags ^= 1; /* toggle sel tagset */
+-  if (arg->ui & TAGMASK)
++  if (arg->ui & ~0) {
+       selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
++      selmon->pertag->prevtag = selmon->pertag->curtag;
++
++      if (arg->ui == TAGMASK)
++          selmon->pertag->curtag = 0;
++      else {
++          for (i = 0; !(arg->ui & 1 << i); i++) ;
++          selmon->pertag->curtag = i + 1;
++      }
++  } else {
++      tmptag = selmon->pertag->prevtag;
++      selmon->pertag->prevtag = selmon->pertag->curtag;
++      selmon->pertag->curtag = tmptag;
++  }
++
++  selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
++  selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
++  selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
++  selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
++  selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
++
+   focusclient(focustop(selmon), 1);
+   arrange(selmon);
+   printstatus();
+-- 
+2.45.2
+
diff --git a/dwl/patches/restore-monitor/README.md b/dwl/patches/restore-monitor/README.md
new file mode 100644
index 0000000..8380967
--- /dev/null
+++ b/dwl/patches/restore-monitor/README.md
@@ -0,0 +1,8 @@
+### Description
+Moves clients to their old output when it is reattached.
+
+### Download
+- [git branch](https://codeberg.org/eyusupov/dwl/src/branch/restore-monitor)
+- [2024-04-07](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/restore-monitor/restore-monitor.patch)
+### Authors
+- [eyusupov](https://codeberg.org/eyusupov)
\ No newline at end of file
diff --git a/dwl/patches/restore-monitor/restore-monitor.patch b/dwl/patches/restore-monitor/restore-monitor.patch
new file mode 100644
index 0000000..2a818c6
--- /dev/null
+++ b/dwl/patches/restore-monitor/restore-monitor.patch
@@ -0,0 +1,82 @@
+From e42ca1c539437d3098d80983cfe2ad6f938d7a08 Mon Sep 17 00:00:00 2001
+From: Eldar Yusupov <eyusupov@gmail.com>
+Date: Sun, 17 Mar 2024 19:12:29 +0300
+Subject: [PATCH] Restore correct monitor for client when it is reattached
+
+---
+ dwl.c | 24 ++++++++++++++++++++++--
+ 1 file changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/dwl.c b/dwl.c
+index bf763df..d8d8139 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -107,6 +107,7 @@ typedef struct {
+   unsigned int type; /* XDGShell or X11* */
+   struct wlr_box geom; /* layout-relative, includes border */
+   Monitor *mon;
++  char *output;
+   struct wlr_scene_tree *scene;
+   struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
+   struct wlr_scene_tree *scene_surface;
+@@ -869,6 +870,7 @@ createmon(struct wl_listener *listener, void *data)
+   size_t i;
+   struct wlr_output_state state;
+   Monitor *m;
++  Client *c;
+ 
+   if (!wlr_output_init_render(wlr_output, alloc, drw))
+       return;
+@@ -938,6 +940,13 @@ createmon(struct wl_listener *listener, void *data)
+       wlr_output_layout_add_auto(output_layout, wlr_output);
+   else
+       wlr_output_layout_add(output_layout, wlr_output, m->m.x, m->m.y);
++
++  wl_list_for_each(c, &clients, link) {
++      if (strcmp(wlr_output->name, c->output) == 0) {
++          c->mon = m;
++      }
++  }
++  updatemons(NULL, NULL);
+ }
+ 
+ void
+@@ -1186,6 +1195,7 @@ destroynotify(struct wl_listener *listener, void *data)
+       wl_list_remove(&c->map.link);
+       wl_list_remove(&c->unmap.link);
+   }
++  free(c->output);
+   free(c);
+ }
+ 
+@@ -1618,6 +1628,10 @@ mapnotify(struct wl_listener *listener, void *data)
+   } else {
+       applyrules(c);
+   }
++  c->output = strdup(c->mon->wlr_output->name);
++  if (c->output == NULL) {
++      die("oom");
++  }
+   printstatus();
+ 
+ unset_fullscreen:
+@@ -2565,8 +2579,14 @@ void
+ tagmon(const Arg *arg)
+ {
+   Client *sel = focustop(selmon);
+-  if (sel)
+-      setmon(sel, dirtomon(arg->i), 0);
++  if (!sel)
++      return;
++  setmon(sel, dirtomon(arg->i), 0);
++  free(sel->output);
++  sel->output = strdup(sel->mon->wlr_output->name);
++  if (sel->output == NULL) {
++      die("oom");
++  }
+ }
+ 
+ void
+-- 
+2.44.0
+
diff --git a/dwl/patches/smartborders/README.md b/dwl/patches/smartborders/README.md
new file mode 100644
index 0000000..6fe0e59
--- /dev/null
+++ b/dwl/patches/smartborders/README.md
@@ -0,0 +1,14 @@
+### Description
+The borders of a window aren't drawn when the window is the only tiling window
+in its tag OR if the window is in a monocle layout.
+
+### Download
+- [git branch](https://codeberg.org/sevz/dwl/src/branch/smartborders)
+- [main 2025-01-20](/dwl/dwl-patches/raw/branch/main/patches/smartborders/smartborders.patch)
+- [smartborders-0.7.patch](/dwl/dwl-patches/raw/branch/main/patches/smartborders/smartborders-0.7.patch)
+
+### Authors
+- [sevz](https://codeberg.org/sevz)
+- [fauxmight](https://codeberg.org/fauxmight)
+- [Piotr Marendowski](https://github.com/piotr-marendowski)
+- Andrey Proskurin
diff --git a/dwl/patches/smartborders/smartborders-0.7.patch b/dwl/patches/smartborders/smartborders-0.7.patch
new file mode 100644
index 0000000..732f06f
--- /dev/null
+++ b/dwl/patches/smartborders/smartborders-0.7.patch
@@ -0,0 +1,204 @@
+From b10e044d95072994d9b00b31ea70051ab02a026b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
+ <leohdz172@protonmail.com>
+Date: Tue, 16 Aug 2022 15:28:00 -0500
+Subject: [PATCH] don't draw borders if there is only one window
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Co-authored-by: A Frederick Christensen <dwl@ivories.org>
+Co-authored-by: Andrey Proskurin <andreyproskurin@protonmail.com>
+Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
+---
+ config.def.h |  1 +
+ dwl.c        | 47 +++++++++++++++++++++++++++++++----------------
+ 2 files changed, 32 insertions(+), 16 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 22d2171d..632f151f 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -6,6 +6,7 @@
+ /* 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 int smartborders              = 1;
+ static const unsigned int borderpx         = 1;  /* border pixel of windows */
+ static const float rootcolor[]             = COLOR(0x222222ff);
+ static const float bordercolor[]           = COLOR(0x444444ff);
+diff --git a/dwl.c b/dwl.c
+index a2711f67..647ce38c 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -320,7 +320,7 @@ static void rendermon(struct wl_listener *listener, void *data);
+ static void requestdecorationmode(struct wl_listener *listener, void *data);
+ static void requeststartdrag(struct wl_listener *listener, void *data);
+ static void requestmonstate(struct wl_listener *listener, void *data);
+-static void resize(Client *c, struct wlr_box geo, int interact);
++static void resize(Client *c, struct wlr_box geo, int interact, int draw_borders);
+ static void run(char *startup_cmd);
+ static void setcursor(struct wl_listener *listener, void *data);
+ static void setcursorshape(struct wl_listener *listener, void *data);
+@@ -746,7 +746,7 @@ closemon(Monitor *m)
+   wl_list_for_each(c, &clients, link) {
+       if (c->isfloating && c->geom.x > m->m.width)
+           resize(c, (struct wlr_box){.x = c->geom.x - m->w.width, .y = c->geom.y,
+-                  .width = c->geom.width, .height = c->geom.height}, 0);
++                  .width = c->geom.width, .height = c->geom.height}, 0, 1);
+       if (c->mon == m)
+           setmon(c, selmon, c->tags);
+   }
+@@ -814,8 +814,11 @@ commitnotify(struct wl_listener *listener, void *data)
+       return;
+   }
+ 
+-  if (client_surface(c)->mapped && c->mon)
+-      resize(c, c->geom, (c->isfloating && !c->isfullscreen));
++  if (client_surface(c)->mapped && c->mon && c->mon->lt[c->mon->sellt]->arrange
++          && !c->isfullscreen && !c->isfloating)
++      c->mon->lt[c->mon->sellt]->arrange(c->mon);
++  else
++      resize(c, c->geom, (c->isfloating && !c->isfullscreen), (c->isfloating && !c->isfullscreen));
+ 
+   /* mark a pending resize as completed */
+   if (c->resize && c->resize <= c->surface.xdg->current.configure_serial)
+@@ -1775,7 +1778,7 @@ monocle(Monitor *m)
+   wl_list_for_each(c, &clients, link) {
+       if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
+           continue;
+-      resize(c, m->w, 0);
++      resize(c, m->w, 0, !smartborders);
+       n++;
+   }
+   if (n)
+@@ -1867,11 +1870,11 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
+   if (cursor_mode == CurMove) {
+       /* Move the grabbed client to the new position. */
+       resize(grabc, (struct wlr_box){.x = (int)round(cursor->x) - grabcx, .y = (int)round(cursor->y) - grabcy,
+-          .width = grabc->geom.width, .height = grabc->geom.height}, 1);
++          .width = grabc->geom.width, .height = grabc->geom.height}, 1, 1);
+       return;
+   } else if (cursor_mode == CurResize) {
+       resize(grabc, (struct wlr_box){.x = grabc->geom.x, .y = grabc->geom.y,
+-          .width = (int)round(cursor->x) - grabc->geom.x, .height = (int)round(cursor->y) - grabc->geom.y}, 1);
++          .width = (int)round(cursor->x) - grabc->geom.x, .height = (int)round(cursor->y) - grabc->geom.y}, 1, 1);
+       return;
+   }
+ 
+@@ -2178,7 +2181,7 @@ requestmonstate(struct wl_listener *listener, void *data)
+ }
+ 
+ void
+-resize(Client *c, struct wlr_box geo, int interact)
++resize(Client *c, struct wlr_box geo, int interact, int draw_borders)
+ {
+   struct wlr_box *bbox;
+   struct wlr_box clip;
+@@ -2190,6 +2193,7 @@ resize(Client *c, struct wlr_box geo, int interact)
+ 
+   client_set_bounds(c, geo.width, geo.height);
+   c->geom = geo;
++  c->bw = draw_borders ? borderpx : 0;
+   applybounds(c, bbox);
+ 
+   /* Update scene-graph, including borders */
+@@ -2314,6 +2318,8 @@ setfloating(Client *c, int floating)
+   wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen ||
+           (p && p->isfullscreen) ? LyrFS
+           : c->isfloating ? LyrFloat : LyrTile]);
++  if (c->isfloating && !c->bw)
++      resize(c, c->mon->m, 0, 1);
+   arrange(c->mon);
+   printstatus();
+ }
+@@ -2331,11 +2337,11 @@ setfullscreen(Client *c, int fullscreen)
+ 
+   if (fullscreen) {
+       c->prev = c->geom;
+-      resize(c, c->mon->m, 0);
++      resize(c, c->mon->m, 0, 0);
+   } else {
+       /* restore previous size instead of arrange for floating windows since
+        * client positions are set by the user and cannot be recalculated */
+-      resize(c, c->prev, 0);
++      resize(c, c->prev, 0, 1);
+   }
+   arrange(c->mon);
+   printstatus();
+@@ -2362,6 +2368,12 @@ setlayout(const Arg *arg)
+   if (arg && arg->v)
+       selmon->lt[selmon->sellt] = (Layout *)arg->v;
+   strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol));
++  if (!selmon->lt[selmon->sellt]->arrange) {
++      /* floating layout, draw borders around all clients */
++      Client *c;
++      wl_list_for_each(c, &clients, link)
++          resize(c, c->mon->m, 0, 1);
++  }
+   arrange(selmon);
+   printstatus();
+ }
+@@ -2396,7 +2408,7 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
+       arrange(oldmon);
+   if (m) {
+       /* Make sure window actually overlaps with the monitor */
+-      resize(c, c->geom, 0);
++      resize(c, c->geom, 0, 1);
+       c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
+       setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
+       setfloating(c, c->isfloating);
+@@ -2691,7 +2703,7 @@ tagmon(const Arg *arg)
+ void
+ tile(Monitor *m)
+ {
+-  unsigned int mw, my, ty;
++  unsigned int mw, my, ty, draw_borders = 1;
+   int i, n = 0;
+   Client *c;
+ 
+@@ -2701,6 +2713,9 @@ tile(Monitor *m)
+   if (n == 0)
+       return;
+ 
++  if (n == smartborders)
++      draw_borders = 0;
++
+   if (n > m->nmaster)
+       mw = m->nmaster ? (int)roundf(m->w.width * m->mfact) : 0;
+   else
+@@ -2711,11 +2726,11 @@ tile(Monitor *m)
+           continue;
+       if (i < m->nmaster) {
+           resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw,
+-              .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0);
++              .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0, draw_borders);
+           my += c->geom.height;
+       } else {
+           resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty,
+-              .width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0);
++              .width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0, draw_borders);
+           ty += c->geom.height;
+       }
+       i++;
+@@ -2884,7 +2899,7 @@ updatemons(struct wl_listener *listener, void *data)
+       arrange(m);
+       /* make sure fullscreen clients have the right size */
+       if ((c = focustop(m)) && c->isfullscreen)
+-          resize(c, m->m, 0);
++          resize(c, m->m, 0, 0);
+ 
+       /* Try to re-set the gamma LUT when updating monitors,
+        * it's only really needed when enabling a disabled output, but meh. */
+@@ -3087,7 +3102,7 @@ configurex11(struct wl_listener *listener, void *data)
+   }
+   if (c->isfloating || client_is_unmanaged(c))
+       resize(c, (struct wlr_box){.x = event->x, .y = event->y,
+-              .width = event->width + c->bw * 2, .height = event->height + c->bw * 2}, 0);
++              .width = event->width + c->bw * 2, .height = event->height + c->bw * 2}, 0, 1);
+   else
+       arrange(c->mon);
+ }
+-- 
+2.46.0
+
diff --git a/dwl/patches/smartborders/smartborders.patch b/dwl/patches/smartborders/smartborders.patch
new file mode 100644
index 0000000..5eac3ee
--- /dev/null
+++ b/dwl/patches/smartborders/smartborders.patch
@@ -0,0 +1,203 @@
+From 38010bdecf63bdb8acfc584825b398838310eed1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
+ <leohdz172@protonmail.com>
+Date: Tue, 16 Aug 2022 15:28:00 -0500
+Subject: [PATCH] don't draw borders if there is only one window
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Co-authored-by: A Frederick Christensen <dwl@ivories.org>
+Co-authored-by: Andrey Proskurin <andreyproskurin@protonmail.com>
+Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
+---
+ config.def.h |  1 +
+ dwl.c        | 46 +++++++++++++++++++++++++++++++---------------
+ 2 files changed, 32 insertions(+), 15 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 22d2171d..632f151f 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -6,6 +6,7 @@
+ /* 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 int smartborders              = 1;
+ static const unsigned int borderpx         = 1;  /* border pixel of windows */
+ static const float rootcolor[]             = COLOR(0x222222ff);
+ static const float bordercolor[]           = COLOR(0x444444ff);
+diff --git a/dwl.c b/dwl.c
+index ad21e1ba..0c56431a 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -317,7 +317,7 @@ static void rendermon(struct wl_listener *listener, void *data);
+ static void requestdecorationmode(struct wl_listener *listener, void *data);
+ static void requeststartdrag(struct wl_listener *listener, void *data);
+ static void requestmonstate(struct wl_listener *listener, void *data);
+-static void resize(Client *c, struct wlr_box geo, int interact);
++static void resize(Client *c, struct wlr_box geo, int interact, int draw_borders);
+ static void run(char *startup_cmd);
+ static void setcursor(struct wl_listener *listener, void *data);
+ static void setcursorshape(struct wl_listener *listener, void *data);
+@@ -803,7 +803,7 @@ closemon(Monitor *m)
+   wl_list_for_each(c, &clients, link) {
+       if (c->isfloating && c->geom.x > m->m.width)
+           resize(c, (struct wlr_box){.x = c->geom.x - m->w.width, .y = c->geom.y,
+-                  .width = c->geom.width, .height = c->geom.height}, 0);
++                  .width = c->geom.width, .height = c->geom.height}, 0, 1);
+       if (c->mon == m)
+           setmon(c, selmon, c->tags);
+   }
+@@ -872,7 +872,11 @@ commitnotify(struct wl_listener *listener, void *data)
+       return;
+   }
+ 
+-  resize(c, c->geom, (c->isfloating && !c->isfullscreen));
++  if (client_surface(c)->mapped && c->mon && c->mon->lt[c->mon->sellt]->arrange
++          && !c->isfullscreen && !c->isfloating)
++      c->mon->lt[c->mon->sellt]->arrange(c->mon);
++  else
++      resize(c, c->geom, (c->isfloating && !c->isfullscreen), (c->isfloating && !c->isfullscreen));
+ 
+   /* mark a pending resize as completed */
+   if (c->resize && c->resize <= c->surface.xdg->current.configure_serial)
+@@ -1819,7 +1823,7 @@ monocle(Monitor *m)
+   wl_list_for_each(c, &clients, link) {
+       if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
+           continue;
+-      resize(c, m->w, 0);
++      resize(c, m->w, 0, !smartborders);
+       n++;
+   }
+   if (n)
+@@ -1911,11 +1915,11 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
+   if (cursor_mode == CurMove) {
+       /* Move the grabbed client to the new position. */
+       resize(grabc, (struct wlr_box){.x = (int)round(cursor->x) - grabcx, .y = (int)round(cursor->y) - grabcy,
+-          .width = grabc->geom.width, .height = grabc->geom.height}, 1);
++          .width = grabc->geom.width, .height = grabc->geom.height}, 1, 1);
+       return;
+   } else if (cursor_mode == CurResize) {
+       resize(grabc, (struct wlr_box){.x = grabc->geom.x, .y = grabc->geom.y,
+-          .width = (int)round(cursor->x) - grabc->geom.x, .height = (int)round(cursor->y) - grabc->geom.y}, 1);
++          .width = (int)round(cursor->x) - grabc->geom.x, .height = (int)round(cursor->y) - grabc->geom.y}, 1, 1);
+       return;
+   }
+ 
+@@ -2194,7 +2198,7 @@ requestmonstate(struct wl_listener *listener, void *data)
+ }
+ 
+ void
+-resize(Client *c, struct wlr_box geo, int interact)
++resize(Client *c, struct wlr_box geo, int interact, int draw_borders)
+ {
+   struct wlr_box *bbox;
+   struct wlr_box clip;
+@@ -2206,6 +2210,7 @@ resize(Client *c, struct wlr_box geo, int interact)
+ 
+   client_set_bounds(c, geo.width, geo.height);
+   c->geom = geo;
++  c->bw = draw_borders ? borderpx : 0;
+   applybounds(c, bbox);
+ 
+   /* Update scene-graph, including borders */
+@@ -2330,6 +2335,8 @@ setfloating(Client *c, int floating)
+   wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen ||
+           (p && p->isfullscreen) ? LyrFS
+           : c->isfloating ? LyrFloat : LyrTile]);
++  if (c->isfloating && !c->bw)
++      resize(c, c->mon->m, 0, 1);
+   arrange(c->mon);
+   printstatus();
+ }
+@@ -2347,11 +2354,11 @@ setfullscreen(Client *c, int fullscreen)
+ 
+   if (fullscreen) {
+       c->prev = c->geom;
+-      resize(c, c->mon->m, 0);
++      resize(c, c->mon->m, 0, 0);
+   } else {
+       /* restore previous size instead of arrange for floating windows since
+        * client positions are set by the user and cannot be recalculated */
+-      resize(c, c->prev, 0);
++      resize(c, c->prev, 0, 1);
+   }
+   arrange(c->mon);
+   printstatus();
+@@ -2367,6 +2374,12 @@ setlayout(const Arg *arg)
+   if (arg && arg->v)
+       selmon->lt[selmon->sellt] = (Layout *)arg->v;
+   strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol));
++  if (!selmon->lt[selmon->sellt]->arrange) {
++      /* floating layout, draw borders around all clients */
++      Client *c;
++      wl_list_for_each(c, &clients, link)
++          resize(c, c->mon->m, 0, 1);
++  }
+   arrange(selmon);
+   printstatus();
+ }
+@@ -2401,7 +2414,7 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
+       arrange(oldmon);
+   if (m) {
+       /* Make sure window actually overlaps with the monitor */
+-      resize(c, c->geom, 0);
++      resize(c, c->geom, 0, 1);
+       c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
+       setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
+       setfloating(c, c->isfloating);
+@@ -2701,7 +2714,7 @@ tagmon(const Arg *arg)
+ void
+ tile(Monitor *m)
+ {
+-  unsigned int mw, my, ty;
++  unsigned int mw, my, ty, draw_borders = 1;
+   int i, n = 0;
+   Client *c;
+ 
+@@ -2711,6 +2724,9 @@ tile(Monitor *m)
+   if (n == 0)
+       return;
+ 
++  if (n == smartborders)
++      draw_borders = 0;
++
+   if (n > m->nmaster)
+       mw = m->nmaster ? (int)roundf(m->w.width * m->mfact) : 0;
+   else
+@@ -2721,11 +2737,11 @@ tile(Monitor *m)
+           continue;
+       if (i < m->nmaster) {
+           resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw,
+-              .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0);
++              .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0, draw_borders);
+           my += c->geom.height;
+       } else {
+           resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty,
+-              .width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0);
++              .width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0, draw_borders);
+           ty += c->geom.height;
+       }
+       i++;
+@@ -2894,7 +2910,7 @@ updatemons(struct wl_listener *listener, void *data)
+       arrange(m);
+       /* make sure fullscreen clients have the right size */
+       if ((c = focustop(m)) && c->isfullscreen)
+-          resize(c, m->m, 0);
++          resize(c, m->m, 0, 0);
+ 
+       /* Try to re-set the gamma LUT when updating monitors,
+        * it's only really needed when enabling a disabled output, but meh. */
+@@ -3103,7 +3119,7 @@ configurex11(struct wl_listener *listener, void *data)
+   if ((c->isfloating && c != grabc) || !c->mon->lt[c->mon->sellt]->arrange) {
+       resize(c, (struct wlr_box){.x = event->x - c->bw,
+               .y = event->y - c->bw, .width = event->width + c->bw * 2,
+-              .height = event->height + c->bw * 2}, 0);
++              .height = event->height + c->bw * 2}, 0, 1);
+   } else {
+       arrange(c->mon);
+   }
+-- 
+2.48.0
+
diff --git a/dwl/patches/swallow/README.md b/dwl/patches/swallow/README.md
new file mode 100644
index 0000000..6c16162
--- /dev/null
+++ b/dwl/patches/swallow/README.md
@@ -0,0 +1,53 @@
+### Description
+
+This patch adds "window swallowing" to dwl.
+
+If a user runs a graphical program from the terminal (e.g., `mpv`), the terminal
+will be hidden and only a window of the newly spawned graphical program will
+be visible. The terminal stays hidden until the graphical program is closed.
+This patch helps users spawning a lot of graphical programs from their command
+line by avoiding cluttering the screen with many unusable terminals.
+
+`foot` is the terminal by default, you can change it in client rules in config.h.
+
+In `2025-03-03 v0.7` version and above, the patch had been rewritten from
+scratch to make it more robust and add a few more features:
+
+- "dynamically swallow" windows by pressing `Alt+a` (a focused window will
+  swallow/unswallow the previously focused one)
+- toggle automatic swallowing by `Alt+Shift+a`
+- if a window has swallowed another, it get thicker borders
+
+### Download
+
+#### swallow.patch
+
+- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/swallow/swallow.patch)
+- [2025-03-03 v0.7](https://codeberg.org/dwl/dwl-patches/raw/commit/2e5748edfe1129f95c7bb1bf9dd590a897f55f57/patches/swallow/swallow.patch) (added "dynamic swallowing" support)
+- [2024-07-13](https://codeberg.org/dwl/dwl-patches/raw/commit/f1ed83eaeba46108f4ee8164094cb431d64a3e68/patches/swallow/swallow.patch)
+- [2024-07-13](https://codeberg.org/dwl/dwl-patches/raw/commit/f64d701bab2f9f52d3637edd091684f920407d87/patches/swallow/swallow.patch)
+- [2024-05-02](https://codeberg.org/dwl/dwl-patches/raw/commit/9c5d5d85f3ac780e7a14d5d0535e3349ce8b8f53/patches/swallow/swallow.patch)
+- [2024-04-03](https://codeberg.org/dwl/dwl-patches/raw/commit/3c9a8e3232a8531871924484cef1ef0938730e15/swallow/swallow.patch)
+- [2024-01-01](https://codeberg.org/dwl/dwl-patches/raw/commit/8a352a1b27a64821ba9fbfda52fe82463ac84c66/swallow/swallow.patch)
+- [2023-10-26](https://github.com/djpohly/dwl/compare/main...youbitchoc:swallow.patch)
+- [2023-08-16](https://github.com/djpohly/dwl/compare/main...mewkl:swallowx.patch) (added XWayland support)
+- [2023-07-15](https://github.com/djpohly/dwl/compare/main...NikitaIvanovV:swallow.patch)
+- [v0.4](https://github.com/djpohly/dwl/compare/main...dm1tz:04-swallow.patch)
+- [2021-12-03](https://github.com/djpohly/dwl/compare/main...dm1tz:swallow.patch)
+
+#### swallow-freebsd.patch
+
+Apply this patch on top of the swallow.patch if you use FreeBSD.
+
+- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/swallow/swallow-freebsd.patch)
+- [2025-03-03 v0.7](https://codeberg.org/dwl/dwl-patches/raw/commit/2e5748edfe1129f95c7bb1bf9dd590a897f55f57/patches/swallow/swallow-freebsd.patch) (added "dynamic swallowing" support)
+- [2024-07-13](https://codeberg.org/dwl/dwl-patches/raw/commit/f1ed83eaeba46108f4ee8164094cb431d64a3e68/patches/swallow/swallow-freebsd.patch)
+
+### Authors
+
+- [Nikita Ivanov](https://codeberg.org/nikitaivanov) ([GitHub](https://github.com/NikitaIvanovV))
+- [Dmitry Zakharchenko](https://github.com/dm1tz)
+- [Palanix](https://codeberg.org/Palanix)
+- [Connor Worrell](https://github.com/ConnorWorrell)
+- [Mewkl](https://github.com/mewkl)
+- [Choc](https://codeberg.org/notchoc)
diff --git a/dwl/patches/swallow/swallow-freebsd.patch b/dwl/patches/swallow/swallow-freebsd.patch
new file mode 100644
index 0000000..795a5e1
--- /dev/null
+++ b/dwl/patches/swallow/swallow-freebsd.patch
@@ -0,0 +1,54 @@
+From 301e1b368d92a32a7bdcd4bd1f0ede0295977e3e Mon Sep 17 00:00:00 2001
+From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
+Date: Mon, 3 Mar 2025 19:49:07 +0100
+Subject: [PATCH] swallow: add FreeBSD support
+
+---
+ dwl.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/dwl.c b/dwl.c
+index 71d500a..52fdd9c 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -67,6 +67,14 @@
+ #include <xcb/xcb_icccm.h>
+ #endif
+ 
++#ifdef __FreeBSD__
++#define __BSD_VISIBLE
++#include <sys/types.h>
++#include <sys/param.h>
++#include <sys/sysctl.h>
++#include <sys/user.h>
++#endif
++
+ #include "util.h"
+ 
+ /* macros */
+@@ -2032,6 +2040,7 @@ outputmgrtest(struct wl_listener *listener, void *data)
+ pid_t
+ parentpid(pid_t pid)
+ {
++#ifdef __linux__
+   unsigned int v = 0;
+   FILE *f;
+   char buf[256];
+@@ -2041,6 +2050,14 @@ parentpid(pid_t pid)
+   fscanf(f, "%*u %*s %*c %u", &v);
+   fclose(f);
+   return (pid_t)v;
++#elif defined(__FreeBSD__)
++  struct kinfo_proc kip;
++  size_t len = sizeof(struct kinfo_proc);
++  int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, p };
++  if (sysctl(mib, 4, &kip, &len, NULL, 0) < 0 || len == 0)
++      return 0;
++  return kip.ki_ppid;
++#endif
+ }
+ 
+ void
+-- 
+2.49.0
+
diff --git a/dwl/patches/swallow/swallow.patch b/dwl/patches/swallow/swallow.patch
new file mode 100644
index 0000000..ee1a1c1
--- /dev/null
+++ b/dwl/patches/swallow/swallow.patch
@@ -0,0 +1,351 @@
+From a220e1ed4b04a66c837dfc8e3363d3e696cbf541 Mon Sep 17 00:00:00 2001
+From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
+Date: Wed, 5 Feb 2025 02:34:39 +0100
+Subject: [PATCH] Swallow: hide the terminal when it spawns a client
+
+---
+ client.h     |  12 ++++
+ config.def.h |  11 +++-
+ dwl.c        | 152 +++++++++++++++++++++++++++++++++++++++++++++++++--
+ 3 files changed, 168 insertions(+), 7 deletions(-)
+
+diff --git a/client.h b/client.h
+index 42f225f..bc9cad2 100644
+--- a/client.h
++++ b/client.h
+@@ -131,6 +131,18 @@ client_get_appid(Client *c)
+   return c->surface.xdg->toplevel->app_id;
+ }
+ 
++static inline int
++client_get_pid(Client *c)
++{
++  pid_t pid;
++#ifdef XWAYLAND
++  if (client_is_x11(c))
++      return c->surface.xwayland->pid;
++#endif
++  wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
++  return pid;
++}
++
+ static inline void
+ client_get_clip(Client *c, struct wlr_box *clip)
+ {
+diff --git a/config.def.h b/config.def.h
+index 22d2171..42342f1 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -13,6 +13,8 @@ static const float focuscolor[]            = COLOR(0x005577ff);
+ static const float urgentcolor[]           = COLOR(0xff0000ff);
+ /* 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 int enableautoswallow = 1; /* enables autoswallowing newly spawned clients */
++static float swallowborder = 1.0f; /* add this multiplied by borderpx to border when a client is swallowed */
+ 
+ /* tagging - TAGCOUNT must be no greater than 31 */
+ #define TAGCOUNT (9)
+@@ -22,10 +24,11 @@ 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 */
++  /* app_id             title       tags mask     isfloating   isterm   noswallow   monitor */
+   /* examples: */
+-  { "Gimp_EXAMPLE",     NULL,       0,            1,           -1 }, /* Start on currently visible tags floating, not tiled */
+-  { "firefox_EXAMPLE",  NULL,       1 << 8,       0,           -1 }, /* Start on ONLY tag "9" */
++  { "foot",             NULL,       0,            0,           1,       1,          -1 },
++  { "Gimp_EXAMPLE",     NULL,       0,            1,           0,       0,          -1 }, /* Start on currently visible tags floating, not tiled */
++  { "firefox_EXAMPLE",  NULL,       1 << 8,       0,           0,       0,          -1 }, /* Start on ONLY tag "9" */
+ };
+ 
+ /* layout(s) */
+@@ -142,6 +145,8 @@ static const Key keys[] = {
+   { MODKEY,                    XKB_KEY_space,      setlayout,      {0} },
+   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space,      togglefloating, {0} },
+   { MODKEY,                    XKB_KEY_e,         togglefullscreen, {0} },
++  { MODKEY,                    XKB_KEY_a,          toggleswallow,  {0} },
++  { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_A,          toggleautoswallow,{0} },
+   { MODKEY,                    XKB_KEY_0,          view,           {.ui = ~0} },
+   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag,            {.ui = ~0} },
+   { MODKEY,                    XKB_KEY_comma,      focusmon,       {.i = WLR_DIRECTION_LEFT} },
+diff --git a/dwl.c b/dwl.c
+index def2562..71d500a 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -73,12 +73,13 @@
+ #define MAX(A, B)               ((A) > (B) ? (A) : (B))
+ #define MIN(A, B)               ((A) < (B) ? (A) : (B))
+ #define CLEANMASK(mask)         (mask & ~WLR_MODIFIER_CAPS)
+-#define VISIBLEON(C, M)         ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
++#define VISIBLEON(C, M)         ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]) && !(C)->swallowedby)
+ #define LENGTH(X)               (sizeof X / sizeof X[0])
+ #define END(A)                  ((A) + LENGTH(A))
+ #define TAGMASK                 ((1u << TAGCOUNT) - 1)
+ #define LISTEN(E, L, H)         wl_signal_add((E), ((L)->notify = (H), (L)))
+ #define LISTEN_STATIC(E, H)     do { static struct wl_listener _l = {.notify = (H)}; wl_signal_add((E), &_l); } while (0)
++#define BORDERPX(C)             (borderpx + ((C)->swallowing ? (int)ceilf(swallowborder * (C)->swallowing->bw) : 0))
+ 
+ /* enums */
+ enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
+@@ -104,7 +105,8 @@ typedef struct {
+ } Button;
+ 
+ typedef struct Monitor Monitor;
+-typedef struct {
++typedef struct Client Client;
++struct Client {
+   /* Must keep these three elements in this order */
+   unsigned int type; /* XDGShell or X11* */
+   struct wlr_box geom; /* layout-relative, includes border */
+@@ -140,8 +142,12 @@ typedef struct {
+   unsigned int bw;
+   uint32_t tags;
+   int isfloating, isurgent, isfullscreen;
++  int isterm, noswallow;
+   uint32_t resize; /* configure serial of a pending resize */
+-} Client;
++  pid_t pid;
++  Client *swallowing;  /* client being hidden */
++  Client *swallowedby;
++};
+ 
+ typedef struct {
+   uint32_t mod;
+@@ -230,6 +236,8 @@ typedef struct {
+   const char *title;
+   uint32_t tags;
+   int isfloating;
++  int isterm;
++  int noswallow;
+   int monitor;
+ } Rule;
+ 
+@@ -311,6 +319,7 @@ static void moveresize(const Arg *arg);
+ static void outputmgrapply(struct wl_listener *listener, void *data);
+ static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test);
+ static void outputmgrtest(struct wl_listener *listener, void *data);
++static pid_t parentpid(pid_t pid);
+ static void pointerfocus(Client *c, struct wlr_surface *surface,
+       double sx, double sy, uint32_t time);
+ static void printstatus(void);
+@@ -335,11 +344,15 @@ static void setsel(struct wl_listener *listener, void *data);
+ static void setup(void);
+ static void spawn(const Arg *arg);
+ static void startdrag(struct wl_listener *listener, void *data);
++static void swallow(Client *c, Client *toswallow);
+ static void tag(const Arg *arg);
+ static void tagmon(const Arg *arg);
++static Client *termforwin(Client *c);
+ static void tile(Monitor *m);
+ static void togglefloating(const Arg *arg);
+ static void togglefullscreen(const Arg *arg);
++static void toggleswallow(const Arg *arg);
++static void toggleautoswallow(const Arg *arg);
+ static void toggletag(const Arg *arg);
+ static void toggleview(const Arg *arg);
+ static void unlocksession(struct wl_listener *listener, void *data);
+@@ -466,11 +479,15 @@ applyrules(Client *c)
+   if (!(title = client_get_title(c)))
+       title = broken;
+ 
++  c->pid = client_get_pid(c);
++
+   for (r = rules; r < END(rules); r++) {
+       if ((!r->title || strstr(title, r->title))
+               && (!r->id || strstr(appid, r->id))) {
+           c->isfloating = r->isfloating;
+           newtags |= r->tags;
++          c->isterm = r->isterm;
++          c->noswallow = r->noswallow;
+           i = 0;
+           wl_list_for_each(m, &mons, link) {
+               if (r->monitor == i++)
+@@ -478,6 +495,12 @@ applyrules(Client *c)
+           }
+       }
+   }
++  if (enableautoswallow && !c->noswallow && !c->isfloating &&
++          !c->surface.xdg->initial_commit) {
++      Client *p = termforwin(c);
++      if (p)
++          swallow(c, p);
++  }
+   setmon(c, mon, newtags);
+ }
+ 
+@@ -2006,6 +2029,20 @@ outputmgrtest(struct wl_listener *listener, void *data)
+   outputmgrapplyortest(config, 1);
+ }
+ 
++pid_t
++parentpid(pid_t pid)
++{
++  unsigned int v = 0;
++  FILE *f;
++  char buf[256];
++  snprintf(buf, sizeof(buf) - 1, "/proc/%u/stat", (unsigned)pid);
++  if (!(f = fopen(buf, "r")))
++      return 0;
++  fscanf(f, "%*u %*s %*c %u", &v);
++  fclose(f);
++  return (pid_t)v;
++}
++
+ void
+ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
+       uint32_t time)
+@@ -2326,7 +2363,7 @@ setfullscreen(Client *c, int fullscreen)
+   c->isfullscreen = fullscreen;
+   if (!c->mon || !client_surface(c)->mapped)
+       return;
+-  c->bw = fullscreen ? 0 : borderpx;
++  c->bw = fullscreen ? 0 : BORDERPX(c);
+   client_set_fullscreen(c, fullscreen);
+   wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen
+           ? LyrFS : c->isfloating ? LyrFloat : LyrTile]);
+@@ -2404,6 +2441,9 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
+       setfloating(c, c->isfloating);
+   }
+   focusclient(focustop(selmon), 1);
++
++  if (c->swallowing)
++      setmon(c->swallowing, m, newtags);
+ }
+ 
+ void
+@@ -2669,6 +2709,44 @@ startdrag(struct wl_listener *listener, void *data)
+   LISTEN_STATIC(&drag->icon->events.destroy, destroydragicon);
+ }
+ 
++void
++swallow(Client *c, Client *toswallow)
++{
++  /* Do not allow a client to swallow itself */
++  if (c == toswallow)
++      return;
++
++  /* Swallow */
++  if (toswallow && !c->swallowing) {
++      c->swallowing = toswallow;
++      toswallow->swallowedby = c;
++      toswallow->mon = c->mon;
++      toswallow->mon = c->mon;
++      wl_list_remove(&c->link);
++      wl_list_insert(&c->swallowing->link, &c->link);
++      wl_list_remove(&c->flink);
++      wl_list_insert(&c->swallowing->flink, &c->flink);
++      c->bw = BORDERPX(c);
++      c->tags = toswallow->tags;
++      c->isfloating = toswallow->isfloating;
++      c->geom = toswallow->geom;
++      setfullscreen(toswallow, 0);
++  }
++
++  /* Unswallow */
++  else if (c->swallowing) {
++      wl_list_remove(&c->swallowing->link);
++      wl_list_insert(&c->link, &c->swallowing->link);
++      wl_list_remove(&c->swallowing->flink);
++      wl_list_insert(&c->flink, &c->swallowing->flink);
++      c->swallowing->tags = c->tags;
++      c->swallowing->swallowedby = NULL;
++      c->swallowing = NULL;
++      c->bw = BORDERPX(c);
++      setfullscreen(c, 0);
++  }
++}
++
+ void
+ tag(const Arg *arg)
+ {
+@@ -2690,6 +2768,40 @@ tagmon(const Arg *arg)
+       setmon(sel, dirtomon(arg->i), 0);
+ }
+ 
++Client *
++termforwin(Client *c)
++{
++  Client *p;
++  pid_t pid;
++  pid_t pids[32];
++  size_t i, pids_len;
++
++  if (!c->pid || c->isterm)
++      return NULL;
++
++  /* Get all parent pids */
++  pids_len = 0;
++  pid = c->pid;
++  while (pids_len < LENGTH(pids)) {
++      pid = parentpid(pid);
++      if (!pid)
++          break;
++      pids[pids_len++] = pid;
++  }
++
++  /* Find closest parent */
++  for (i = 0; i < pids_len; i++) {
++      wl_list_for_each(p, &clients, link) {
++          if (!p->pid || !p->isterm || p->swallowedby)
++              continue;
++          if (pids[i] == p->pid)
++              return p;
++      }
++  }
++
++  return NULL;
++}
++
+ void
+ tile(Monitor *m)
+ {
+@@ -2741,6 +2853,32 @@ togglefullscreen(const Arg *arg)
+       setfullscreen(sel, !sel->isfullscreen);
+ }
+ 
++void
++toggleswallow(const Arg *arg)
++{
++  Client *c, *sel = focustop(selmon);
++  if (!sel)
++      return;
++
++  if (sel->swallowing) {
++      swallow(sel, NULL);
++  } else {
++      wl_list_for_each(c, &sel->flink, flink) {
++          if (&c->flink == &fstack)
++              continue; /* wrap past the sentinel node */
++          if (VISIBLEON(c, selmon))
++              break; /* found it */
++      }
++      swallow(sel, c);
++  }
++}
++
++void
++toggleautoswallow(const Arg *arg)
++{
++  enableautoswallow = !enableautoswallow;
++}
++
+ void
+ toggletag(const Arg *arg)
+ {
+@@ -2801,6 +2939,12 @@ unmapnotify(struct wl_listener *listener, void *data)
+       grabc = NULL;
+   }
+ 
++  if (c->swallowing) {
++      swallow(c, NULL);
++  } else if (c->swallowedby) {
++      swallow(c->swallowedby, NULL);
++  }
++
+   if (client_is_unmanaged(c)) {
+       if (c == exclusive_focus) {
+           exclusive_focus = NULL;
+-- 
+2.49.0
+
diff --git a/dwl/patches/tablet-input/README.md b/dwl/patches/tablet-input/README.md
new file mode 100644
index 0000000..29cdc98
--- /dev/null
+++ b/dwl/patches/tablet-input/README.md
@@ -0,0 +1,19 @@
+### Description
+Implements wlr-tablet-v2 for drawing tablets with cursor emulation.
+Inspired by @guyuming76's [branch](https://codeberg.org/guyuming76/dwl/commits/branch/graphic_tablet), with coding help from @Palanix and testing by @Thanatos.
+
+- **Tablet area**: define the active drawing zone using the `tablet_pad` array
+`{x, y, width, height}`, values range from 0.0 to 1.0 (as a fraction of the
+tablet's full surface). Only input within this area is mapped to the screen.
+- **Button bindings**: bind tablet pad and stylus buttons to compositor actions.
+
+### Download
+- [git branch](https://codeberg.org/pi66/dwl/src/branch/tablet-input)
+- [tablet-input-main-a2d03cf.patch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/tablet-input/tablet-input-main-a2d03cf.patch)
+- [tablet-input-0.8.patch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/tablet-input/tablet-input-0.8.patch)
+
+### Authors
+- [fauxmight](https://codeberg.org/fauxmight)
+- [notchoc](https://codeberg.org/notchoc)
+- [Palanix](https://codeberg.org/Palanix)
+- [pi66](https://codeberg.org/pi66)
diff --git a/dwl/patches/tablet-input/tablet-input-0.8.patch b/dwl/patches/tablet-input/tablet-input-0.8.patch
new file mode 100644
index 0000000..d014a21
--- /dev/null
+++ b/dwl/patches/tablet-input/tablet-input-0.8.patch
@@ -0,0 +1,484 @@
+From a14dff19f38fffa498f3de4679952b39b4323502 Mon Sep 17 00:00:00 2001
+From: pi66 <pixel2176@proton.me>
+Date: Wed, 8 Apr 2026 21:47:41 +0100
+Subject: [PATCH] feat: add pad/tool bindings and pen region
+
+---
+ Makefile     |   6 +-
+ config.def.h |  19 ++++
+ dwl.c        | 303 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 327 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 578194f..e0d1835 100644
+--- a/Makefile
++++ b/Makefile
+@@ -21,7 +21,8 @@ dwl: dwl.o util.o
+   <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>C</mi><mi>C</mi><mo stretchy="false">&#x00029;</mo><mi>d</mi><mi>w</mi><mi>l</mi><mo>&#x0002E;</mo><mi>o</mi><mi>u</mi><mi>t</mi><mi>i</mi><mi>l</mi><mo>&#x0002E;</mo><mi>o</mi></mrow></math>(DWLCFLAGS) <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>L</mi><mi>D</mi><mi>F</mi><mi>L</mi><mi>A</mi><mi>G</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo></mrow></math>(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
++  wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h \
++  tablet-v2-protocol.h
+ util.o: util.c util.h
+ 
+ # wayland-scanner is a tool which generates C headers and rigging for Wayland
+@@ -45,6 +46,9 @@ wlr-output-power-management-unstable-v1-protocol.h:
+ xdg-shell-protocol.h:
+   $(WAYLAND_SCANNER) server-header \
+       <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>W</mi><mi>A</mi><mi>Y</mi><mi>L</mi><mi>A</mi><mi>N</mi><msub><mi>D</mi><mi>P</mi></msub><mi>R</mi><mi>O</mi><mi>T</mi><mi>O</mi><mi>C</mi><mi>O</mi><mi>L</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo><mo>&#x0002F;</mo><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x0002F;</mo><mi>x</mi><mi>d</mi><mi>g</mi><mo>&#x02212;</mo><mi>s</mi><mi>h</mi><mi>e</mi><mi>l</mi><mi>l</mi><mo>&#x0002F;</mo><mi>x</mi><mi>d</mi><mi>g</mi><mo>&#x02212;</mo><mi>s</mi><mi>h</mi><mi>e</mi><mi>l</mi><mi>l</mi><mo>&#x0002E;</mo><mi>x</mi><mi>m</mi><mi>l</mi></mrow></math>@
++tablet-v2-protocol.h:
++  $(WAYLAND_SCANNER) server-header \
++      <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>W</mi><mi>A</mi><mi>Y</mi><mi>L</mi><mi>A</mi><mi>N</mi><msub><mi>D</mi><mi>P</mi></msub><mi>R</mi><mi>O</mi><mi>T</mi><mi>O</mi><mi>C</mi><mi>O</mi><mi>L</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo><mo>&#x0002F;</mo><mi>u</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x0002F;</mo><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mi>t</mi><mo>&#x0002F;</mo><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mi>t</mi><mo>&#x02212;</mo><mi>u</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x02212;</mo><mi>v</mi><mn>2</mn><mo>&#x0002E;</mo><mi>x</mi><mi>m</mi><mi>l</mi></mrow></math>@
+ 
+ config.h:
+   cp config.def.h $@
+diff --git a/config.def.h b/config.def.h
+index 8a6eda0..288494e 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -4,6 +4,7 @@
+                         ((hex >> 8) & 0xFF) / 255.0f, \
+                         (hex & 0xFF) / 255.0f }
+ /* appearance */
++static const int tabletmaptosurface        = 1;  /* map tablet input to surface(1) or monitor(0) */
+ 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 */
+@@ -13,6 +14,8 @@ static const float focuscolor[]            = COLOR(0x005577ff);
+ static const float urgentcolor[]           = COLOR(0xff0000ff);
+ /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
+ static const float fullscreen_bg[]         = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
++/* Pen active area: value 0.0 => 1.0         { x,    y,    width, height } */
++static const double tablet_area[4]           = { 0.4,  0.4,  0.4,   0.4 };
+ 
+ /* tagging - TAGCOUNT must be no greater than 31 */
+ #define TAGCOUNT (9)
+@@ -170,3 +173,19 @@ static const Button buttons[] = {
+   { MODKEY, BTN_MIDDLE, togglefloating, {0} },
+   { MODKEY, BTN_RIGHT,  moveresize,     {.ui = CurResize} },
+ };
++
++static const TabletButton tabletbuttons[] = {
++    /* button       state                  function    argument */
++//  { BTN_STYLUS,   WLR_BUTTON_PRESSED,    spawn,      {.v = termcmd} },
++//  { BTN_STYLUS2,  WLR_BUTTON_PRESSED,    killclient, {0} },
++  { 0,            0,                     NULL,       {0} }
++};
++
++static const TabletPadButton tabletpadbuttons[] = {
++  /* button  state                  function          argument */
++/*  { 0,       WLR_BUTTON_PRESSED,    spawn,            {.v = termcmd} }, */
++/*  { 1,       WLR_BUTTON_PRESSED,    killclient,       {0} },*/
++/*  { 2,       WLR_BUTTON_PRESSED,    togglefloating,   {0} },*/
++/*  { 3,       WLR_BUTTON_PRESSED,    zoom,             {0} },*/
++  { 0,            0,                     NULL,       {0} }
++};
+diff --git a/dwl.c b/dwl.c
+index 44f3ad9..7572756 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -51,6 +51,9 @@
+ #include <wlr/types/wlr_session_lock_v1.h>
+ #include <wlr/types/wlr_single_pixel_buffer_v1.h>
+ #include <wlr/types/wlr_subcompositor.h>
++#include <wlr/types/wlr_tablet_pad.h>
++#include <wlr/types/wlr_tablet_tool.h>
++#include <wlr/types/wlr_tablet_v2.h>
+ #include <wlr/types/wlr_viewporter.h>
+ #include <wlr/types/wlr_virtual_keyboard_v1.h>
+ #include <wlr/types/wlr_virtual_pointer_v1.h>
+@@ -239,6 +242,20 @@ typedef struct {
+   struct wl_listener destroy;
+ } SessionLock;
+ 
++typedef struct {
++    uint32_t button;
++    uint32_t state;
++    void (*func)(const Arg *);
++    const Arg arg;
++} TabletPadButton;
++
++typedef struct {
++    uint32_t button;
++    uint32_t state;
++    void (*func)(const Arg *);
++    const Arg arg;
++} TabletButton;
++
+ /* function declarations */
+ static void applybounds(Client *c, struct wlr_box *bbox);
+ static void applyrules(Client *c);
+@@ -268,6 +285,7 @@ static void createnotify(struct wl_listener *listener, void *data);
+ static void createpointer(struct wlr_pointer *pointer);
+ static void createpointerconstraint(struct wl_listener *listener, void *data);
+ static void createpopup(struct wl_listener *listener, void *data);
++static void createtablet(struct wlr_input_device *device);
+ static void cursorconstrain(struct wlr_pointer_constraint_v1 *constraint);
+ static void cursorframe(struct wl_listener *listener, void *data);
+ static void cursorwarptohint(void);
+@@ -281,6 +299,10 @@ static void destroynotify(struct wl_listener *listener, void *data);
+ static void destroypointerconstraint(struct wl_listener *listener, void *data);
+ static void destroysessionlock(struct wl_listener *listener, void *data);
+ static void destroykeyboardgroup(struct wl_listener *listener, void *data);
++static void destroytablet(struct wl_listener *listener, void *data);
++static void destroytabletpad(struct wl_listener *listener, void *data);
++static void destroytabletsurfacenotify(struct wl_listener *listener, void *data);
++static void destroytablettool(struct wl_listener *listener, void *data);
+ static Monitor *dirtomon(enum wlr_direction dir);
+ static void focusclient(Client *c, int lift);
+ static void focusmon(const Arg *arg);
+@@ -333,6 +355,12 @@ static void spawn(const Arg *arg);
+ static void startdrag(struct wl_listener *listener, void *data);
+ static void tag(const Arg *arg);
+ static void tagmon(const Arg *arg);
++static void tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x, bool change_y, double x, double y, double dx, double dy);
++static void tablettoolproximity(struct wl_listener *listener, void *data);
++static void tabletpadbutton(struct wl_listener *listener, void *data);
++static void tablettoolaxis(struct wl_listener *listener, void *data);
++static void tablettoolbutton(struct wl_listener *listener, void *data);
++static void tablettooltip(struct wl_listener *listener, void *data);
+ static void tile(Monitor *m);
+ static void togglefloating(const Arg *arg);
+ static void togglefullscreen(const Arg *arg);
+@@ -390,6 +418,13 @@ static struct wlr_pointer_constraint_v1 *active_constraint;
+ static struct wlr_cursor *cursor;
+ static struct wlr_xcursor_manager *cursor_mgr;
+ 
++static struct wlr_tablet_manager_v2 *tablet_mgr;
++static struct wlr_tablet_v2_tablet *tablet = NULL;
++static struct wlr_tablet_v2_tablet_tool *tablet_tool = NULL;
++static struct wlr_tablet_v2_tablet_pad *tablet_pad = NULL;
++static struct wlr_surface *tablet_curr_surface = NULL;
++static struct wl_listener destroy_tablet_surface_listener = {.notify = destroytabletsurfacenotify};
++
+ static struct wlr_scene_rect *root_bg;
+ static struct wlr_session_lock_manager_v1 *session_lock_mgr;
+ static struct wlr_scene_rect *locked_bg;
+@@ -412,6 +447,14 @@ static struct wl_listener cursor_button = {.notify = buttonpress};
+ static struct wl_listener cursor_frame = {.notify = cursorframe};
+ static struct wl_listener cursor_motion = {.notify = motionrelative};
+ static struct wl_listener cursor_motion_absolute = {.notify = motionabsolute};
++static struct wl_listener tablet_device_destroy = {.notify = destroytablet};
++static struct wl_listener tablet_pad_destroy = {.notify = destroytabletpad};
++static struct wl_listener tablet_pad_button = {.notify = tabletpadbutton};
++static struct wl_listener tablet_tool_axis = {.notify = tablettoolaxis};
++static struct wl_listener tablet_tool_button = {.notify = tablettoolbutton};
++static struct wl_listener tablet_tool_destroy = {.notify = destroytablettool};
++static struct wl_listener tablet_tool_proximity = {.notify = tablettoolproximity};
++static struct wl_listener tablet_tool_tip = {.notify = tablettooltip};
+ static struct wl_listener gpu_reset = {.notify = gpureset};
+ static struct wl_listener layout_change = {.notify = updatemons};
+ static struct wl_listener new_idle_inhibitor = {.notify = createidleinhibitor};
+@@ -1199,6 +1242,27 @@ createpopup(struct wl_listener *listener, void *data)
+   LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup);
+ }
+ 
++void
++createtablet(struct wlr_input_device *device)
++{
++  if (!tablet) {
++      struct libinput_device *device_handle = NULL;
++      if (!wlr_input_device_is_libinput(device) ||
++              !(device_handle = wlr_libinput_get_device_handle(device)))
++          return;
++      tablet = wlr_tablet_create(tablet_mgr, seat, device);
++      wl_signal_add(&tablet->wlr_device->events.destroy, &tablet_device_destroy);
++      if (libinput_device_config_send_events_get_modes(device_handle)) {
++          libinput_device_config_send_events_set_mode(device_handle, send_events_mode);
++          wlr_cursor_attach_input_device(cursor, device);
++      }
++  } else if (device == tablet->wlr_device) {
++      wlr_log(WLR_ERROR, "createtablet: duplicate device");
++  } else {
++      wlr_log(WLR_ERROR, "createtablet: already have one tablet");
++  }
++}
++
+ void
+ cursorconstrain(struct wlr_pointer_constraint_v1 *constraint)
+ {
+@@ -1383,6 +1447,37 @@ destroykeyboardgroup(struct wl_listener *listener, void *data)
+   free(group);
+ }
+ 
++void
++destroytablet(struct wl_listener *listener, void *data)
++{
++  wl_list_remove(&tablet_device_destroy.link);
++  wlr_cursor_detach_input_device(cursor, tablet->wlr_device);
++  tablet = NULL;
++}
++
++void
++destroytabletpad(struct wl_listener *listener, void *data)
++{
++  wl_list_remove(&tablet_pad_button.link);
++  wl_list_remove(&tablet_pad_destroy.link);
++  tablet_pad = NULL;
++}
++
++void
++destroytabletsurfacenotify(struct wl_listener *listener, void *data)
++{
++  if (tablet_curr_surface)
++      wl_list_remove(&destroy_tablet_surface_listener.link);
++  tablet_curr_surface = NULL;
++}
++
++void
++destroytablettool(struct wl_listener *listener, void *data)
++{
++  destroytabletsurfacenotify(NULL, NULL);
++  tablet_tool = NULL;
++}
++
+ Monitor *
+ dirtomon(enum wlr_direction dir)
+ {
+@@ -1581,6 +1676,7 @@ inputdevice(struct wl_listener *listener, void *data)
+   /* This event is raised by the backend when a new input device becomes
+    * available. */
+   struct wlr_input_device *device = data;
++  struct wlr_tablet_pad *pad = NULL;
+   uint32_t caps;
+ 
+   switch (device->type) {
+@@ -1590,6 +1686,15 @@ inputdevice(struct wl_listener *listener, void *data)
+   case WLR_INPUT_DEVICE_POINTER:
+       createpointer(wlr_pointer_from_input_device(device));
+       break;
++        case WLR_INPUT_DEVICE_TABLET:
++      createtablet(device);
++      break;
++  case WLR_INPUT_DEVICE_TABLET_PAD:
++      pad = wlr_tablet_pad_from_input_device(device);
++      tablet_pad = wlr_tablet_pad_create(tablet_mgr, seat, device);
++      wl_signal_add(&pad->events.button,  &tablet_pad_button);
++      wl_signal_add(&device->events.destroy, &tablet_pad_destroy);
++      break;
+   default:
+       /* TODO handle other input device types */
+       break;
+@@ -2585,6 +2690,8 @@ setup(void)
+ 
+   relative_pointer_mgr = wlr_relative_pointer_manager_v1_create(dpy);
+ 
++  tablet_mgr = wlr_tablet_v2_create(dpy);
++
+   /*
+    * Creates a cursor, which is a wlroots utility for tracking the cursor
+    * image shown on screen.
+@@ -2614,6 +2721,11 @@ setup(void)
+   wl_signal_add(&cursor->events.button, &cursor_button);
+   wl_signal_add(&cursor->events.axis, &cursor_axis);
+   wl_signal_add(&cursor->events.frame, &cursor_frame);
++  wl_signal_add(&cursor->events.tablet_tool_proximity, &tablet_tool_proximity);
++  wl_signal_add(&cursor->events.tablet_tool_axis, &tablet_tool_axis);
++  wl_signal_add(&cursor->events.tablet_tool_button, &tablet_tool_button);
++  wl_signal_add(&cursor->events.tablet_tool_tip, &tablet_tool_tip);
++
+ 
+   cursor_shape_mgr = wlr_cursor_shape_manager_v1_create(dpy, 1);
+   wl_signal_add(&cursor_shape_mgr->events.request_set_shape, &request_set_cursor_shape);
+@@ -2709,6 +2821,197 @@ tagmon(const Arg *arg)
+       setmon(sel, dirtomon(arg->i), 0);
+ }
+ 
++void
++tabletapplymap(double x, double y, struct wlr_input_device *dev)
++{
++  Client *p;
++  struct wlr_box geom = {0};
++  if (tabletmaptosurface && tablet_curr_surface) {
++      toplevel_from_wlr_surface(tablet_curr_surface, &p, NULL);
++      if (p) {
++          for (; client_get_parent(p); p = client_get_parent(p));
++          geom.x = p->geom.x + p->bw;
++          geom.y = p->geom.y + p->bw;
++          geom.width = p->geom.width - 2 * p->bw;
++          geom.height = p->geom.height - 2 * p->bw;
++          wlr_cursor_map_input_to_region(cursor, dev, &geom);
++      }
++  }
++  wlr_cursor_map_input_to_output(cursor, dev, selmon->wlr_output);
++}
++
++void
++tabletpadbutton(struct wl_listener *listener, void *data)
++{
++    struct wlr_tablet_pad_button_event *event = data;
++    const TabletPadButton *pb;
++
++    for (pb = tabletpadbuttons; pb < END(tabletpadbuttons); pb++) {
++        if (event->button == pb->button
++                && event->state == pb->state
++                && pb->func) {
++            pb->func(&pb->arg);
++        }
++    }
++
++    if (tablet_pad)
++        wlr_tablet_v2_tablet_pad_notify_button(tablet_pad,
++            event->button, event->time_msec,
++            (enum zwp_tablet_pad_v2_button_state)event->state);
++}
++
++void
++tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x, bool change_y,
++      double x, double y, double dx, double dy)
++{
++  struct wlr_surface *surface = NULL;
++  double sx, sy;
++
++  if (!change_x && !change_y)
++      return;
++
++  tabletapplymap(x, y, tablet->wlr_device);
++
++  x = (MAX(tablet_area[0], MIN(tablet_area[0] + tablet_area[2], x)) - tablet_area[0]) / tablet_area[2];
++  y = (MAX(tablet_area[1], MIN(tablet_area[1] + tablet_area[3], y)) - tablet_area[1]) / tablet_area[3];
++
++
++  // TODO: apply constraints
++  switch (tablet_tool->wlr_tool->type) {
++  case WLR_TABLET_TOOL_TYPE_LENS:
++  case WLR_TABLET_TOOL_TYPE_MOUSE:
++      wlr_cursor_move(cursor, tablet->wlr_device, dx, dy);
++      break;
++  default:
++      wlr_cursor_warp_absolute(cursor, tablet->wlr_device, change_x ? x : NAN, change_y ? y : NAN);
++      break;
++  }
++
++  motionnotify(0, NULL, 0, 0, 0, 0);
++
++  xytonode(cursor->x, cursor->y, &surface, NULL, NULL, &sx, &sy);
++  if (surface && !wlr_surface_accepts_tablet_v2(surface, tablet))
++      surface = NULL;
++
++  if (surface != tablet_curr_surface) {
++      if (tablet_curr_surface) {
++          // TODO: wait until all buttons released before leaving
++          if (tablet_tool)
++              wlr_tablet_v2_tablet_tool_notify_proximity_out(tablet_tool);
++          if (tablet_pad)
++              wlr_tablet_v2_tablet_pad_notify_leave(tablet_pad, tablet_curr_surface);
++          wl_list_remove(&destroy_tablet_surface_listener.link);
++      }
++      if (surface) {
++          if (tablet_pad)
++              wlr_tablet_v2_tablet_pad_notify_enter(tablet_pad, tablet, surface);
++          if (tablet_tool)
++              wlr_tablet_v2_tablet_tool_notify_proximity_in(tablet_tool, tablet, surface);
++          wl_signal_add(&surface->events.destroy, &destroy_tablet_surface_listener);
++      }
++      tablet_curr_surface = surface;
++  }
++
++  if (surface)
++      wlr_tablet_v2_tablet_tool_notify_motion(tablet_tool, sx, sy);
++}
++
++void
++tablettoolproximity(struct wl_listener *listener, void *data)
++{
++  struct wlr_tablet_tool_proximity_event *event = data;
++  struct wlr_tablet_tool *tool = event->tool;
++
++  if (!tablet_tool) {
++      tablet_tool = wlr_tablet_tool_create(tablet_mgr, seat, tool);
++      wl_signal_add(&tablet_tool->wlr_tool->events.destroy, &tablet_tool_destroy);
++      wl_signal_add(&tablet_tool->events.set_cursor, &request_cursor);
++  }
++
++  switch (event->state) {
++  case WLR_TABLET_TOOL_PROXIMITY_OUT:
++      wlr_tablet_v2_tablet_tool_notify_proximity_out(tablet_tool);
++      destroytabletsurfacenotify(NULL, NULL);
++      break;
++  case WLR_TABLET_TOOL_PROXIMITY_IN:
++      tablettoolmotion(tablet_tool, true, true, event->x, event->y, 0, 0);
++      break;
++  }
++}
++
++double tilt_x = 0;
++double tilt_y = 0;
++
++void
++tablettoolaxis(struct wl_listener *listener, void *data)
++{
++  struct wlr_tablet_tool_axis_event *event = data;
++
++  tablettoolmotion(tablet_tool,
++      event->updated_axes & WLR_TABLET_TOOL_AXIS_X,
++      event->updated_axes & WLR_TABLET_TOOL_AXIS_Y,
++      event->x, event->y, event->dx, event->dy);
++
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_PRESSURE)
++      wlr_tablet_v2_tablet_tool_notify_pressure(tablet_tool, event->pressure);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_DISTANCE)
++      wlr_tablet_v2_tablet_tool_notify_distance(tablet_tool, event->distance);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_X)
++      tilt_x = event->tilt_x;
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_Y)
++      tilt_y = event->tilt_y;
++  if (event->updated_axes & (WLR_TABLET_TOOL_AXIS_TILT_X | WLR_TABLET_TOOL_AXIS_TILT_Y))
++      wlr_tablet_v2_tablet_tool_notify_tilt(tablet_tool, tilt_x, tilt_y);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_ROTATION)
++      wlr_tablet_v2_tablet_tool_notify_rotation(tablet_tool, event->rotation);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_SLIDER)
++      wlr_tablet_v2_tablet_tool_notify_slider(tablet_tool, event->slider);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_WHEEL)
++      wlr_tablet_v2_tablet_tool_notify_wheel(tablet_tool, event->wheel_delta, 0);
++}
++
++void
++tablettoolbutton(struct wl_listener *listener, void *data)
++{
++    struct wlr_tablet_tool_button_event *event = data;
++    const TabletButton *tb;
++
++    for (tb = tabletbuttons; tb < END(tabletbuttons); tb++) {
++        if (event->button == tb->button
++                && event->state == tb->state
++                && tb->func) {
++            tb->func(&tb->arg);
++        }
++    }
++
++    wlr_tablet_v2_tablet_tool_notify_button(tablet_tool, event->button,
++        (enum zwp_tablet_pad_v2_button_state)event->state);
++}
++
++void
++tablettooltip(struct wl_listener *listener, void *data)
++{
++  struct wlr_tablet_tool_tip_event *event = data;
++
++  if (!tablet_curr_surface) {
++      struct wlr_pointer_button_event fakeptrbtnevent = {
++          .button = BTN_LEFT,
++          .state = event->state == WLR_TABLET_TOOL_TIP_UP ?
++              WL_POINTER_BUTTON_STATE_RELEASED : WL_POINTER_BUTTON_STATE_PRESSED,
++          .time_msec = event->time_msec,
++      };
++      buttonpress(NULL, (void *)&fakeptrbtnevent);
++  }
++
++  if (event->state == WLR_TABLET_TOOL_TIP_UP) {
++      wlr_tablet_v2_tablet_tool_notify_up(tablet_tool);
++      return;
++  }
++
++  wlr_tablet_v2_tablet_tool_notify_down(tablet_tool);
++  wlr_tablet_tool_v2_start_implicit_grab(tablet_tool);
++}
++
+ void
+ tile(Monitor *m)
+ {
+-- 
+2.53.0
+
diff --git a/dwl/patches/tablet-input/tablet-input-main-a2d03cf.patch b/dwl/patches/tablet-input/tablet-input-main-a2d03cf.patch
new file mode 100644
index 0000000..d014a21
--- /dev/null
+++ b/dwl/patches/tablet-input/tablet-input-main-a2d03cf.patch
@@ -0,0 +1,484 @@
+From a14dff19f38fffa498f3de4679952b39b4323502 Mon Sep 17 00:00:00 2001
+From: pi66 <pixel2176@proton.me>
+Date: Wed, 8 Apr 2026 21:47:41 +0100
+Subject: [PATCH] feat: add pad/tool bindings and pen region
+
+---
+ Makefile     |   6 +-
+ config.def.h |  19 ++++
+ dwl.c        | 303 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 327 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 578194f..e0d1835 100644
+--- a/Makefile
++++ b/Makefile
+@@ -21,7 +21,8 @@ dwl: dwl.o util.o
+   <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>C</mi><mi>C</mi><mo stretchy="false">&#x00029;</mo><mi>d</mi><mi>w</mi><mi>l</mi><mo>&#x0002E;</mo><mi>o</mi><mi>u</mi><mi>t</mi><mi>i</mi><mi>l</mi><mo>&#x0002E;</mo><mi>o</mi></mrow></math>(DWLCFLAGS) <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>L</mi><mi>D</mi><mi>F</mi><mi>L</mi><mi>A</mi><mi>G</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo></mrow></math>(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
++  wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h \
++  tablet-v2-protocol.h
+ util.o: util.c util.h
+ 
+ # wayland-scanner is a tool which generates C headers and rigging for Wayland
+@@ -45,6 +46,9 @@ wlr-output-power-management-unstable-v1-protocol.h:
+ xdg-shell-protocol.h:
+   $(WAYLAND_SCANNER) server-header \
+       <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>W</mi><mi>A</mi><mi>Y</mi><mi>L</mi><mi>A</mi><mi>N</mi><msub><mi>D</mi><mi>P</mi></msub><mi>R</mi><mi>O</mi><mi>T</mi><mi>O</mi><mi>C</mi><mi>O</mi><mi>L</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo><mo>&#x0002F;</mo><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x0002F;</mo><mi>x</mi><mi>d</mi><mi>g</mi><mo>&#x02212;</mo><mi>s</mi><mi>h</mi><mi>e</mi><mi>l</mi><mi>l</mi><mo>&#x0002F;</mo><mi>x</mi><mi>d</mi><mi>g</mi><mo>&#x02212;</mo><mi>s</mi><mi>h</mi><mi>e</mi><mi>l</mi><mi>l</mi><mo>&#x0002E;</mo><mi>x</mi><mi>m</mi><mi>l</mi></mrow></math>@
++tablet-v2-protocol.h:
++  $(WAYLAND_SCANNER) server-header \
++      <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>W</mi><mi>A</mi><mi>Y</mi><mi>L</mi><mi>A</mi><mi>N</mi><msub><mi>D</mi><mi>P</mi></msub><mi>R</mi><mi>O</mi><mi>T</mi><mi>O</mi><mi>C</mi><mi>O</mi><mi>L</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo><mo>&#x0002F;</mo><mi>u</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x0002F;</mo><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mi>t</mi><mo>&#x0002F;</mo><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mi>t</mi><mo>&#x02212;</mo><mi>u</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x02212;</mo><mi>v</mi><mn>2</mn><mo>&#x0002E;</mo><mi>x</mi><mi>m</mi><mi>l</mi></mrow></math>@
+ 
+ config.h:
+   cp config.def.h $@
+diff --git a/config.def.h b/config.def.h
+index 8a6eda0..288494e 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -4,6 +4,7 @@
+                         ((hex >> 8) & 0xFF) / 255.0f, \
+                         (hex & 0xFF) / 255.0f }
+ /* appearance */
++static const int tabletmaptosurface        = 1;  /* map tablet input to surface(1) or monitor(0) */
+ 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 */
+@@ -13,6 +14,8 @@ static const float focuscolor[]            = COLOR(0x005577ff);
+ static const float urgentcolor[]           = COLOR(0xff0000ff);
+ /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
+ static const float fullscreen_bg[]         = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
++/* Pen active area: value 0.0 => 1.0         { x,    y,    width, height } */
++static const double tablet_area[4]           = { 0.4,  0.4,  0.4,   0.4 };
+ 
+ /* tagging - TAGCOUNT must be no greater than 31 */
+ #define TAGCOUNT (9)
+@@ -170,3 +173,19 @@ static const Button buttons[] = {
+   { MODKEY, BTN_MIDDLE, togglefloating, {0} },
+   { MODKEY, BTN_RIGHT,  moveresize,     {.ui = CurResize} },
+ };
++
++static const TabletButton tabletbuttons[] = {
++    /* button       state                  function    argument */
++//  { BTN_STYLUS,   WLR_BUTTON_PRESSED,    spawn,      {.v = termcmd} },
++//  { BTN_STYLUS2,  WLR_BUTTON_PRESSED,    killclient, {0} },
++  { 0,            0,                     NULL,       {0} }
++};
++
++static const TabletPadButton tabletpadbuttons[] = {
++  /* button  state                  function          argument */
++/*  { 0,       WLR_BUTTON_PRESSED,    spawn,            {.v = termcmd} }, */
++/*  { 1,       WLR_BUTTON_PRESSED,    killclient,       {0} },*/
++/*  { 2,       WLR_BUTTON_PRESSED,    togglefloating,   {0} },*/
++/*  { 3,       WLR_BUTTON_PRESSED,    zoom,             {0} },*/
++  { 0,            0,                     NULL,       {0} }
++};
+diff --git a/dwl.c b/dwl.c
+index 44f3ad9..7572756 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -51,6 +51,9 @@
+ #include <wlr/types/wlr_session_lock_v1.h>
+ #include <wlr/types/wlr_single_pixel_buffer_v1.h>
+ #include <wlr/types/wlr_subcompositor.h>
++#include <wlr/types/wlr_tablet_pad.h>
++#include <wlr/types/wlr_tablet_tool.h>
++#include <wlr/types/wlr_tablet_v2.h>
+ #include <wlr/types/wlr_viewporter.h>
+ #include <wlr/types/wlr_virtual_keyboard_v1.h>
+ #include <wlr/types/wlr_virtual_pointer_v1.h>
+@@ -239,6 +242,20 @@ typedef struct {
+   struct wl_listener destroy;
+ } SessionLock;
+ 
++typedef struct {
++    uint32_t button;
++    uint32_t state;
++    void (*func)(const Arg *);
++    const Arg arg;
++} TabletPadButton;
++
++typedef struct {
++    uint32_t button;
++    uint32_t state;
++    void (*func)(const Arg *);
++    const Arg arg;
++} TabletButton;
++
+ /* function declarations */
+ static void applybounds(Client *c, struct wlr_box *bbox);
+ static void applyrules(Client *c);
+@@ -268,6 +285,7 @@ static void createnotify(struct wl_listener *listener, void *data);
+ static void createpointer(struct wlr_pointer *pointer);
+ static void createpointerconstraint(struct wl_listener *listener, void *data);
+ static void createpopup(struct wl_listener *listener, void *data);
++static void createtablet(struct wlr_input_device *device);
+ static void cursorconstrain(struct wlr_pointer_constraint_v1 *constraint);
+ static void cursorframe(struct wl_listener *listener, void *data);
+ static void cursorwarptohint(void);
+@@ -281,6 +299,10 @@ static void destroynotify(struct wl_listener *listener, void *data);
+ static void destroypointerconstraint(struct wl_listener *listener, void *data);
+ static void destroysessionlock(struct wl_listener *listener, void *data);
+ static void destroykeyboardgroup(struct wl_listener *listener, void *data);
++static void destroytablet(struct wl_listener *listener, void *data);
++static void destroytabletpad(struct wl_listener *listener, void *data);
++static void destroytabletsurfacenotify(struct wl_listener *listener, void *data);
++static void destroytablettool(struct wl_listener *listener, void *data);
+ static Monitor *dirtomon(enum wlr_direction dir);
+ static void focusclient(Client *c, int lift);
+ static void focusmon(const Arg *arg);
+@@ -333,6 +355,12 @@ static void spawn(const Arg *arg);
+ static void startdrag(struct wl_listener *listener, void *data);
+ static void tag(const Arg *arg);
+ static void tagmon(const Arg *arg);
++static void tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x, bool change_y, double x, double y, double dx, double dy);
++static void tablettoolproximity(struct wl_listener *listener, void *data);
++static void tabletpadbutton(struct wl_listener *listener, void *data);
++static void tablettoolaxis(struct wl_listener *listener, void *data);
++static void tablettoolbutton(struct wl_listener *listener, void *data);
++static void tablettooltip(struct wl_listener *listener, void *data);
+ static void tile(Monitor *m);
+ static void togglefloating(const Arg *arg);
+ static void togglefullscreen(const Arg *arg);
+@@ -390,6 +418,13 @@ static struct wlr_pointer_constraint_v1 *active_constraint;
+ static struct wlr_cursor *cursor;
+ static struct wlr_xcursor_manager *cursor_mgr;
+ 
++static struct wlr_tablet_manager_v2 *tablet_mgr;
++static struct wlr_tablet_v2_tablet *tablet = NULL;
++static struct wlr_tablet_v2_tablet_tool *tablet_tool = NULL;
++static struct wlr_tablet_v2_tablet_pad *tablet_pad = NULL;
++static struct wlr_surface *tablet_curr_surface = NULL;
++static struct wl_listener destroy_tablet_surface_listener = {.notify = destroytabletsurfacenotify};
++
+ static struct wlr_scene_rect *root_bg;
+ static struct wlr_session_lock_manager_v1 *session_lock_mgr;
+ static struct wlr_scene_rect *locked_bg;
+@@ -412,6 +447,14 @@ static struct wl_listener cursor_button = {.notify = buttonpress};
+ static struct wl_listener cursor_frame = {.notify = cursorframe};
+ static struct wl_listener cursor_motion = {.notify = motionrelative};
+ static struct wl_listener cursor_motion_absolute = {.notify = motionabsolute};
++static struct wl_listener tablet_device_destroy = {.notify = destroytablet};
++static struct wl_listener tablet_pad_destroy = {.notify = destroytabletpad};
++static struct wl_listener tablet_pad_button = {.notify = tabletpadbutton};
++static struct wl_listener tablet_tool_axis = {.notify = tablettoolaxis};
++static struct wl_listener tablet_tool_button = {.notify = tablettoolbutton};
++static struct wl_listener tablet_tool_destroy = {.notify = destroytablettool};
++static struct wl_listener tablet_tool_proximity = {.notify = tablettoolproximity};
++static struct wl_listener tablet_tool_tip = {.notify = tablettooltip};
+ static struct wl_listener gpu_reset = {.notify = gpureset};
+ static struct wl_listener layout_change = {.notify = updatemons};
+ static struct wl_listener new_idle_inhibitor = {.notify = createidleinhibitor};
+@@ -1199,6 +1242,27 @@ createpopup(struct wl_listener *listener, void *data)
+   LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup);
+ }
+ 
++void
++createtablet(struct wlr_input_device *device)
++{
++  if (!tablet) {
++      struct libinput_device *device_handle = NULL;
++      if (!wlr_input_device_is_libinput(device) ||
++              !(device_handle = wlr_libinput_get_device_handle(device)))
++          return;
++      tablet = wlr_tablet_create(tablet_mgr, seat, device);
++      wl_signal_add(&tablet->wlr_device->events.destroy, &tablet_device_destroy);
++      if (libinput_device_config_send_events_get_modes(device_handle)) {
++          libinput_device_config_send_events_set_mode(device_handle, send_events_mode);
++          wlr_cursor_attach_input_device(cursor, device);
++      }
++  } else if (device == tablet->wlr_device) {
++      wlr_log(WLR_ERROR, "createtablet: duplicate device");
++  } else {
++      wlr_log(WLR_ERROR, "createtablet: already have one tablet");
++  }
++}
++
+ void
+ cursorconstrain(struct wlr_pointer_constraint_v1 *constraint)
+ {
+@@ -1383,6 +1447,37 @@ destroykeyboardgroup(struct wl_listener *listener, void *data)
+   free(group);
+ }
+ 
++void
++destroytablet(struct wl_listener *listener, void *data)
++{
++  wl_list_remove(&tablet_device_destroy.link);
++  wlr_cursor_detach_input_device(cursor, tablet->wlr_device);
++  tablet = NULL;
++}
++
++void
++destroytabletpad(struct wl_listener *listener, void *data)
++{
++  wl_list_remove(&tablet_pad_button.link);
++  wl_list_remove(&tablet_pad_destroy.link);
++  tablet_pad = NULL;
++}
++
++void
++destroytabletsurfacenotify(struct wl_listener *listener, void *data)
++{
++  if (tablet_curr_surface)
++      wl_list_remove(&destroy_tablet_surface_listener.link);
++  tablet_curr_surface = NULL;
++}
++
++void
++destroytablettool(struct wl_listener *listener, void *data)
++{
++  destroytabletsurfacenotify(NULL, NULL);
++  tablet_tool = NULL;
++}
++
+ Monitor *
+ dirtomon(enum wlr_direction dir)
+ {
+@@ -1581,6 +1676,7 @@ inputdevice(struct wl_listener *listener, void *data)
+   /* This event is raised by the backend when a new input device becomes
+    * available. */
+   struct wlr_input_device *device = data;
++  struct wlr_tablet_pad *pad = NULL;
+   uint32_t caps;
+ 
+   switch (device->type) {
+@@ -1590,6 +1686,15 @@ inputdevice(struct wl_listener *listener, void *data)
+   case WLR_INPUT_DEVICE_POINTER:
+       createpointer(wlr_pointer_from_input_device(device));
+       break;
++        case WLR_INPUT_DEVICE_TABLET:
++      createtablet(device);
++      break;
++  case WLR_INPUT_DEVICE_TABLET_PAD:
++      pad = wlr_tablet_pad_from_input_device(device);
++      tablet_pad = wlr_tablet_pad_create(tablet_mgr, seat, device);
++      wl_signal_add(&pad->events.button,  &tablet_pad_button);
++      wl_signal_add(&device->events.destroy, &tablet_pad_destroy);
++      break;
+   default:
+       /* TODO handle other input device types */
+       break;
+@@ -2585,6 +2690,8 @@ setup(void)
+ 
+   relative_pointer_mgr = wlr_relative_pointer_manager_v1_create(dpy);
+ 
++  tablet_mgr = wlr_tablet_v2_create(dpy);
++
+   /*
+    * Creates a cursor, which is a wlroots utility for tracking the cursor
+    * image shown on screen.
+@@ -2614,6 +2721,11 @@ setup(void)
+   wl_signal_add(&cursor->events.button, &cursor_button);
+   wl_signal_add(&cursor->events.axis, &cursor_axis);
+   wl_signal_add(&cursor->events.frame, &cursor_frame);
++  wl_signal_add(&cursor->events.tablet_tool_proximity, &tablet_tool_proximity);
++  wl_signal_add(&cursor->events.tablet_tool_axis, &tablet_tool_axis);
++  wl_signal_add(&cursor->events.tablet_tool_button, &tablet_tool_button);
++  wl_signal_add(&cursor->events.tablet_tool_tip, &tablet_tool_tip);
++
+ 
+   cursor_shape_mgr = wlr_cursor_shape_manager_v1_create(dpy, 1);
+   wl_signal_add(&cursor_shape_mgr->events.request_set_shape, &request_set_cursor_shape);
+@@ -2709,6 +2821,197 @@ tagmon(const Arg *arg)
+       setmon(sel, dirtomon(arg->i), 0);
+ }
+ 
++void
++tabletapplymap(double x, double y, struct wlr_input_device *dev)
++{
++  Client *p;
++  struct wlr_box geom = {0};
++  if (tabletmaptosurface && tablet_curr_surface) {
++      toplevel_from_wlr_surface(tablet_curr_surface, &p, NULL);
++      if (p) {
++          for (; client_get_parent(p); p = client_get_parent(p));
++          geom.x = p->geom.x + p->bw;
++          geom.y = p->geom.y + p->bw;
++          geom.width = p->geom.width - 2 * p->bw;
++          geom.height = p->geom.height - 2 * p->bw;
++          wlr_cursor_map_input_to_region(cursor, dev, &geom);
++      }
++  }
++  wlr_cursor_map_input_to_output(cursor, dev, selmon->wlr_output);
++}
++
++void
++tabletpadbutton(struct wl_listener *listener, void *data)
++{
++    struct wlr_tablet_pad_button_event *event = data;
++    const TabletPadButton *pb;
++
++    for (pb = tabletpadbuttons; pb < END(tabletpadbuttons); pb++) {
++        if (event->button == pb->button
++                && event->state == pb->state
++                && pb->func) {
++            pb->func(&pb->arg);
++        }
++    }
++
++    if (tablet_pad)
++        wlr_tablet_v2_tablet_pad_notify_button(tablet_pad,
++            event->button, event->time_msec,
++            (enum zwp_tablet_pad_v2_button_state)event->state);
++}
++
++void
++tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x, bool change_y,
++      double x, double y, double dx, double dy)
++{
++  struct wlr_surface *surface = NULL;
++  double sx, sy;
++
++  if (!change_x && !change_y)
++      return;
++
++  tabletapplymap(x, y, tablet->wlr_device);
++
++  x = (MAX(tablet_area[0], MIN(tablet_area[0] + tablet_area[2], x)) - tablet_area[0]) / tablet_area[2];
++  y = (MAX(tablet_area[1], MIN(tablet_area[1] + tablet_area[3], y)) - tablet_area[1]) / tablet_area[3];
++
++
++  // TODO: apply constraints
++  switch (tablet_tool->wlr_tool->type) {
++  case WLR_TABLET_TOOL_TYPE_LENS:
++  case WLR_TABLET_TOOL_TYPE_MOUSE:
++      wlr_cursor_move(cursor, tablet->wlr_device, dx, dy);
++      break;
++  default:
++      wlr_cursor_warp_absolute(cursor, tablet->wlr_device, change_x ? x : NAN, change_y ? y : NAN);
++      break;
++  }
++
++  motionnotify(0, NULL, 0, 0, 0, 0);
++
++  xytonode(cursor->x, cursor->y, &surface, NULL, NULL, &sx, &sy);
++  if (surface && !wlr_surface_accepts_tablet_v2(surface, tablet))
++      surface = NULL;
++
++  if (surface != tablet_curr_surface) {
++      if (tablet_curr_surface) {
++          // TODO: wait until all buttons released before leaving
++          if (tablet_tool)
++              wlr_tablet_v2_tablet_tool_notify_proximity_out(tablet_tool);
++          if (tablet_pad)
++              wlr_tablet_v2_tablet_pad_notify_leave(tablet_pad, tablet_curr_surface);
++          wl_list_remove(&destroy_tablet_surface_listener.link);
++      }
++      if (surface) {
++          if (tablet_pad)
++              wlr_tablet_v2_tablet_pad_notify_enter(tablet_pad, tablet, surface);
++          if (tablet_tool)
++              wlr_tablet_v2_tablet_tool_notify_proximity_in(tablet_tool, tablet, surface);
++          wl_signal_add(&surface->events.destroy, &destroy_tablet_surface_listener);
++      }
++      tablet_curr_surface = surface;
++  }
++
++  if (surface)
++      wlr_tablet_v2_tablet_tool_notify_motion(tablet_tool, sx, sy);
++}
++
++void
++tablettoolproximity(struct wl_listener *listener, void *data)
++{
++  struct wlr_tablet_tool_proximity_event *event = data;
++  struct wlr_tablet_tool *tool = event->tool;
++
++  if (!tablet_tool) {
++      tablet_tool = wlr_tablet_tool_create(tablet_mgr, seat, tool);
++      wl_signal_add(&tablet_tool->wlr_tool->events.destroy, &tablet_tool_destroy);
++      wl_signal_add(&tablet_tool->events.set_cursor, &request_cursor);
++  }
++
++  switch (event->state) {
++  case WLR_TABLET_TOOL_PROXIMITY_OUT:
++      wlr_tablet_v2_tablet_tool_notify_proximity_out(tablet_tool);
++      destroytabletsurfacenotify(NULL, NULL);
++      break;
++  case WLR_TABLET_TOOL_PROXIMITY_IN:
++      tablettoolmotion(tablet_tool, true, true, event->x, event->y, 0, 0);
++      break;
++  }
++}
++
++double tilt_x = 0;
++double tilt_y = 0;
++
++void
++tablettoolaxis(struct wl_listener *listener, void *data)
++{
++  struct wlr_tablet_tool_axis_event *event = data;
++
++  tablettoolmotion(tablet_tool,
++      event->updated_axes & WLR_TABLET_TOOL_AXIS_X,
++      event->updated_axes & WLR_TABLET_TOOL_AXIS_Y,
++      event->x, event->y, event->dx, event->dy);
++
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_PRESSURE)
++      wlr_tablet_v2_tablet_tool_notify_pressure(tablet_tool, event->pressure);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_DISTANCE)
++      wlr_tablet_v2_tablet_tool_notify_distance(tablet_tool, event->distance);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_X)
++      tilt_x = event->tilt_x;
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_Y)
++      tilt_y = event->tilt_y;
++  if (event->updated_axes & (WLR_TABLET_TOOL_AXIS_TILT_X | WLR_TABLET_TOOL_AXIS_TILT_Y))
++      wlr_tablet_v2_tablet_tool_notify_tilt(tablet_tool, tilt_x, tilt_y);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_ROTATION)
++      wlr_tablet_v2_tablet_tool_notify_rotation(tablet_tool, event->rotation);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_SLIDER)
++      wlr_tablet_v2_tablet_tool_notify_slider(tablet_tool, event->slider);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_WHEEL)
++      wlr_tablet_v2_tablet_tool_notify_wheel(tablet_tool, event->wheel_delta, 0);
++}
++
++void
++tablettoolbutton(struct wl_listener *listener, void *data)
++{
++    struct wlr_tablet_tool_button_event *event = data;
++    const TabletButton *tb;
++
++    for (tb = tabletbuttons; tb < END(tabletbuttons); tb++) {
++        if (event->button == tb->button
++                && event->state == tb->state
++                && tb->func) {
++            tb->func(&tb->arg);
++        }
++    }
++
++    wlr_tablet_v2_tablet_tool_notify_button(tablet_tool, event->button,
++        (enum zwp_tablet_pad_v2_button_state)event->state);
++}
++
++void
++tablettooltip(struct wl_listener *listener, void *data)
++{
++  struct wlr_tablet_tool_tip_event *event = data;
++
++  if (!tablet_curr_surface) {
++      struct wlr_pointer_button_event fakeptrbtnevent = {
++          .button = BTN_LEFT,
++          .state = event->state == WLR_TABLET_TOOL_TIP_UP ?
++              WL_POINTER_BUTTON_STATE_RELEASED : WL_POINTER_BUTTON_STATE_PRESSED,
++          .time_msec = event->time_msec,
++      };
++      buttonpress(NULL, (void *)&fakeptrbtnevent);
++  }
++
++  if (event->state == WLR_TABLET_TOOL_TIP_UP) {
++      wlr_tablet_v2_tablet_tool_notify_up(tablet_tool);
++      return;
++  }
++
++  wlr_tablet_v2_tablet_tool_notify_down(tablet_tool);
++  wlr_tablet_tool_v2_start_implicit_grab(tablet_tool);
++}
++
+ void
+ tile(Monitor *m)
+ {
+-- 
+2.53.0
+
diff --git a/dwl/patches/tablet-input/tablet-input-wlroots-next-f4249db.patch b/dwl/patches/tablet-input/tablet-input-wlroots-next-f4249db.patch
new file mode 100644
index 0000000..8fb44ab
--- /dev/null
+++ b/dwl/patches/tablet-input/tablet-input-wlroots-next-f4249db.patch
@@ -0,0 +1,378 @@
+From 55f35863fa9c5a379c9315192c6bc072c3b2ebb6 Mon Sep 17 00:00:00 2001
+From: A Frederick Christensen <dwl@ivories.org>
+Date: Thu, 26 Feb 2026 21:58:37 -0600
+Subject: [PATCH] Apply tablet-input patch
+
+---
+ Makefile     |   6 +-
+ config.def.h |   1 +
+ dwl.c        | 240 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 246 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 578194f..e0d1835 100644
+--- a/Makefile
++++ b/Makefile
+@@ -21,7 +21,8 @@ dwl: dwl.o util.o
+   <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>C</mi><mi>C</mi><mo stretchy="false">&#x00029;</mo><mi>d</mi><mi>w</mi><mi>l</mi><mo>&#x0002E;</mo><mi>o</mi><mi>u</mi><mi>t</mi><mi>i</mi><mi>l</mi><mo>&#x0002E;</mo><mi>o</mi></mrow></math>(DWLCFLAGS) <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>L</mi><mi>D</mi><mi>F</mi><mi>L</mi><mi>A</mi><mi>G</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo></mrow></math>(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
++  wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h \
++  tablet-v2-protocol.h
+ util.o: util.c util.h
+ 
+ # wayland-scanner is a tool which generates C headers and rigging for Wayland
+@@ -45,6 +46,9 @@ wlr-output-power-management-unstable-v1-protocol.h:
+ xdg-shell-protocol.h:
+   $(WAYLAND_SCANNER) server-header \
+       <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>W</mi><mi>A</mi><mi>Y</mi><mi>L</mi><mi>A</mi><mi>N</mi><msub><mi>D</mi><mi>P</mi></msub><mi>R</mi><mi>O</mi><mi>T</mi><mi>O</mi><mi>C</mi><mi>O</mi><mi>L</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo><mo>&#x0002F;</mo><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x0002F;</mo><mi>x</mi><mi>d</mi><mi>g</mi><mo>&#x02212;</mo><mi>s</mi><mi>h</mi><mi>e</mi><mi>l</mi><mi>l</mi><mo>&#x0002F;</mo><mi>x</mi><mi>d</mi><mi>g</mi><mo>&#x02212;</mo><mi>s</mi><mi>h</mi><mi>e</mi><mi>l</mi><mi>l</mi><mo>&#x0002E;</mo><mi>x</mi><mi>m</mi><mi>l</mi></mrow></math>@
++tablet-v2-protocol.h:
++  $(WAYLAND_SCANNER) server-header \
++      <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>W</mi><mi>A</mi><mi>Y</mi><mi>L</mi><mi>A</mi><mi>N</mi><msub><mi>D</mi><mi>P</mi></msub><mi>R</mi><mi>O</mi><mi>T</mi><mi>O</mi><mi>C</mi><mi>O</mi><mi>L</mi><mi>S</mi><mo stretchy="false">&#x00029;</mo><mo>&#x0002F;</mo><mi>u</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x0002F;</mo><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mi>t</mi><mo>&#x0002F;</mo><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mi>t</mi><mo>&#x02212;</mo><mi>u</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mo>&#x02212;</mo><mi>v</mi><mn>2</mn><mo>&#x0002E;</mo><mi>x</mi><mi>m</mi><mi>l</mi></mrow></math>@
+ 
+ config.h:
+   cp config.def.h $@
+diff --git a/config.def.h b/config.def.h
+index 8a6eda0..1f20dfd 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -4,6 +4,7 @@
+                         ((hex >> 8) & 0xFF) / 255.0f, \
+                         (hex & 0xFF) / 255.0f }
+ /* appearance */
++static const int tabletmaptosurface        = 0;  /* map tablet input to surface(1) or monitor(0) */
+ 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 */
+diff --git a/dwl.c b/dwl.c
+index 8a9715d..e7d796b 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -52,6 +52,9 @@
+ #include <wlr/types/wlr_session_lock_v1.h>
+ #include <wlr/types/wlr_single_pixel_buffer_v1.h>
+ #include <wlr/types/wlr_subcompositor.h>
++#include <wlr/types/wlr_tablet_pad.h>
++#include <wlr/types/wlr_tablet_tool.h>
++#include <wlr/types/wlr_tablet_v2.h>
+ #include <wlr/types/wlr_viewporter.h>
+ #include <wlr/types/wlr_virtual_keyboard_v1.h>
+ #include <wlr/types/wlr_virtual_pointer_v1.h>
+@@ -270,6 +273,7 @@ static void createnotify(struct wl_listener *listener, void *data);
+ static void createpointer(struct wlr_pointer *pointer);
+ static void createpointerconstraint(struct wl_listener *listener, void *data);
+ static void createpopup(struct wl_listener *listener, void *data);
++static void createtablet(struct wlr_input_device *device);
+ static void cursorconstrain(struct wlr_pointer_constraint_v1 *constraint);
+ static void cursorframe(struct wl_listener *listener, void *data);
+ static void cursorwarptohint(void);
+@@ -283,6 +287,9 @@ static void destroynotify(struct wl_listener *listener, void *data);
+ static void destroypointerconstraint(struct wl_listener *listener, void *data);
+ static void destroysessionlock(struct wl_listener *listener, void *data);
+ static void destroykeyboardgroup(struct wl_listener *listener, void *data);
++static void destroytablet(struct wl_listener *listener, void *data);
++static void destroytabletsurfacenotify(struct wl_listener *listener, void *data);
++static void destroytablettool(struct wl_listener *listener, void *data);
+ static Monitor *dirtomon(enum wlr_direction dir);
+ static void focusclient(Client *c, int lift);
+ static void focusmon(const Arg *arg);
+@@ -335,6 +342,11 @@ static void spawn(const Arg *arg);
+ static void startdrag(struct wl_listener *listener, void *data);
+ static void tag(const Arg *arg);
+ static void tagmon(const Arg *arg);
++static void tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x, bool change_y, double x, double y, double dx, double dy);
++static void tablettoolproximity(struct wl_listener *listener, void *data);
++static void tablettoolaxis(struct wl_listener *listener, void *data);
++static void tablettoolbutton(struct wl_listener *listener, void *data);
++static void tablettooltip(struct wl_listener *listener, void *data);
+ static void tile(Monitor *m);
+ static void togglefloating(const Arg *arg);
+ static void togglefullscreen(const Arg *arg);
+@@ -392,6 +404,13 @@ static struct wlr_pointer_constraint_v1 *active_constraint;
+ static struct wlr_cursor *cursor;
+ static struct wlr_xcursor_manager *cursor_mgr;
+ 
++static struct wlr_tablet_manager_v2 *tablet_mgr;
++static struct wlr_tablet_v2_tablet *tablet = NULL;
++static struct wlr_tablet_v2_tablet_tool *tablet_tool = NULL;
++static struct wlr_tablet_v2_tablet_pad *tablet_pad = NULL;
++static struct wlr_surface *tablet_curr_surface = NULL;
++static struct wl_listener destroy_tablet_surface_listener = {.notify = destroytabletsurfacenotify};
++
+ static struct wlr_scene_rect *root_bg;
+ static struct wlr_session_lock_manager_v1 *session_lock_mgr;
+ static struct wlr_scene_rect *locked_bg;
+@@ -414,6 +433,12 @@ static struct wl_listener cursor_button = {.notify = buttonpress};
+ static struct wl_listener cursor_frame = {.notify = cursorframe};
+ static struct wl_listener cursor_motion = {.notify = motionrelative};
+ static struct wl_listener cursor_motion_absolute = {.notify = motionabsolute};
++static struct wl_listener tablet_device_destroy = {.notify = destroytablet};
++static struct wl_listener tablet_tool_axis = {.notify = tablettoolaxis};
++static struct wl_listener tablet_tool_button = {.notify = tablettoolbutton};
++static struct wl_listener tablet_tool_destroy = {.notify = destroytablettool};
++static struct wl_listener tablet_tool_proximity = {.notify = tablettoolproximity};
++static struct wl_listener tablet_tool_tip = {.notify = tablettooltip};
+ static struct wl_listener gpu_reset = {.notify = gpureset};
+ static struct wl_listener layout_change = {.notify = updatemons};
+ static struct wl_listener new_idle_inhibitor = {.notify = createidleinhibitor};
+@@ -1201,6 +1226,28 @@ createpopup(struct wl_listener *listener, void *data)
+   LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup);
+ }
+ 
++void
++createtablet(struct wlr_input_device *device)
++{
++  if (!tablet) {
++      struct libinput_device *device_handle = NULL;
++      if (!wlr_input_device_is_libinput(device) ||
++              !(device_handle = wlr_libinput_get_device_handle(device)))
++          return;
++
++      tablet = wlr_tablet_create(tablet_mgr, seat, device);
++      wl_signal_add(&tablet->wlr_device->events.destroy, &tablet_device_destroy);
++      if (libinput_device_config_send_events_get_modes(device_handle)) {
++          libinput_device_config_send_events_set_mode(device_handle, send_events_mode);
++          wlr_cursor_attach_input_device(cursor, device);
++      }
++  } else if (device == tablet->wlr_device) {
++      wlr_log(WLR_ERROR, "createtablet: duplicate device");
++  } else {
++      wlr_log(WLR_ERROR, "createtablet: already have one tablet");
++  }
++}
++
+ void
+ cursorconstrain(struct wlr_pointer_constraint_v1 *constraint)
+ {
+@@ -1385,6 +1432,29 @@ destroykeyboardgroup(struct wl_listener *listener, void *data)
+   free(group);
+ }
+ 
++void
++destroytablet(struct wl_listener *listener, void *data)
++{
++  wl_list_remove(&tablet_device_destroy.link);
++  wlr_cursor_detach_input_device(cursor, tablet->wlr_device);
++  tablet = NULL;
++}
++
++void
++destroytabletsurfacenotify(struct wl_listener *listener, void *data)
++{
++  if (tablet_curr_surface)
++      wl_list_remove(&destroy_tablet_surface_listener.link);
++  tablet_curr_surface = NULL;
++}
++
++void
++destroytablettool(struct wl_listener *listener, void *data)
++{
++  destroytabletsurfacenotify(NULL, NULL);
++  tablet_tool = NULL;
++}
++
+ Monitor *
+ dirtomon(enum wlr_direction dir)
+ {
+@@ -1592,6 +1662,12 @@ inputdevice(struct wl_listener *listener, void *data)
+   case WLR_INPUT_DEVICE_POINTER:
+       createpointer(wlr_pointer_from_input_device(device));
+       break;
++        case WLR_INPUT_DEVICE_TABLET:
++      createtablet(device);
++      break;
++  case WLR_INPUT_DEVICE_TABLET_PAD:
++          tablet_pad = wlr_tablet_pad_create(tablet_mgr, seat, device);
++      break;
+   default:
+       /* TODO handle other input device types */
+       break;
+@@ -2588,6 +2664,8 @@ setup(void)
+ 
+   relative_pointer_mgr = wlr_relative_pointer_manager_v1_create(dpy);
+ 
++  tablet_mgr = wlr_tablet_v2_create(dpy);
++
+   /*
+    * Creates a cursor, which is a wlroots utility for tracking the cursor
+    * image shown on screen.
+@@ -2617,6 +2695,11 @@ setup(void)
+   wl_signal_add(&cursor->events.button, &cursor_button);
+   wl_signal_add(&cursor->events.axis, &cursor_axis);
+   wl_signal_add(&cursor->events.frame, &cursor_frame);
++  wl_signal_add(&cursor->events.tablet_tool_proximity, &tablet_tool_proximity);
++  wl_signal_add(&cursor->events.tablet_tool_axis, &tablet_tool_axis);
++  wl_signal_add(&cursor->events.tablet_tool_button, &tablet_tool_button);
++  wl_signal_add(&cursor->events.tablet_tool_tip, &tablet_tool_tip);
++
+ 
+   cursor_shape_mgr = wlr_cursor_shape_manager_v1_create(dpy, 1);
+   wl_signal_add(&cursor_shape_mgr->events.request_set_shape, &request_set_cursor_shape);
+@@ -2712,6 +2795,163 @@ tagmon(const Arg *arg)
+       setmon(sel, dirtomon(arg->i), 0);
+ }
+ 
++void
++tabletapplymap(double x, double y, struct wlr_input_device *dev)
++{
++  Client *p;
++  struct wlr_box geom = {0};
++  if (tabletmaptosurface && tablet_curr_surface) {
++      toplevel_from_wlr_surface(tablet_curr_surface, &p, NULL);
++      if (p) {
++          for (; client_get_parent(p); p = client_get_parent(p));
++          geom.x = p->geom.x + p->bw;
++          geom.y = p->geom.y + p->bw;
++          geom.width = p->geom.width - 2 * p->bw;
++          geom.height = p->geom.height - 2 * p->bw;
++      }
++  }
++  wlr_cursor_map_input_to_region(cursor, dev, &geom);
++  wlr_cursor_map_input_to_output(cursor, dev, selmon->wlr_output);
++}
++
++void
++tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x, bool change_y,
++      double x, double y, double dx, double dy)
++{
++  struct wlr_surface *surface = NULL;
++  double sx, sy;
++
++  if (!change_x && !change_y)
++      return;
++
++  tabletapplymap(x, y, tablet->wlr_device);
++
++  // TODO: apply constraints
++  switch (tablet_tool->wlr_tool->type) {
++  case WLR_TABLET_TOOL_TYPE_LENS:
++  case WLR_TABLET_TOOL_TYPE_MOUSE:
++      wlr_cursor_move(cursor, tablet->wlr_device, dx, dy);
++      break;
++  default:
++      wlr_cursor_warp_absolute(cursor, tablet->wlr_device, change_x ? x : NAN, change_y ? y : NAN);
++      break;
++  }
++
++  motionnotify(0, NULL, 0, 0, 0, 0);
++
++  xytonode(cursor->x, cursor->y, &surface, NULL, NULL, &sx, &sy);
++  if (surface && !wlr_surface_accepts_tablet_v2(surface, tablet))
++      surface = NULL;
++
++  if (surface != tablet_curr_surface) {
++      if (tablet_curr_surface) {
++          // TODO: wait until all buttons released before leaving
++          if (tablet_tool)
++              wlr_tablet_v2_tablet_tool_notify_proximity_out(tablet_tool);
++          if (tablet_pad)
++              wlr_tablet_v2_tablet_pad_notify_leave(tablet_pad, tablet_curr_surface);
++          wl_list_remove(&destroy_tablet_surface_listener.link);
++      }
++      if (surface) {
++          if (tablet_pad)
++              wlr_tablet_v2_tablet_pad_notify_enter(tablet_pad, tablet, surface);
++          if (tablet_tool)
++              wlr_tablet_v2_tablet_tool_notify_proximity_in(tablet_tool, tablet, surface);
++          wl_signal_add(&surface->events.destroy, &destroy_tablet_surface_listener);
++      }
++      tablet_curr_surface = surface;
++  }
++
++  if (surface)
++      wlr_tablet_v2_tablet_tool_notify_motion(tablet_tool, sx, sy);
++}
++
++void
++tablettoolproximity(struct wl_listener *listener, void *data)
++{
++  struct wlr_tablet_tool_proximity_event *event = data;
++  struct wlr_tablet_tool *tool = event->tool;
++
++  if (!tablet_tool) {
++      tablet_tool = wlr_tablet_tool_create(tablet_mgr, seat, tool);
++      wl_signal_add(&tablet_tool->wlr_tool->events.destroy, &tablet_tool_destroy);
++      wl_signal_add(&tablet_tool->events.set_cursor, &request_cursor);
++  }
++
++  switch (event->state) {
++  case WLR_TABLET_TOOL_PROXIMITY_OUT:
++      wlr_tablet_v2_tablet_tool_notify_proximity_out(tablet_tool);
++      destroytabletsurfacenotify(NULL, NULL);
++      break;
++  case WLR_TABLET_TOOL_PROXIMITY_IN:
++      tablettoolmotion(tablet_tool, true, true, event->x, event->y, 0, 0);
++      break;
++  }
++}
++
++double tilt_x = 0;
++double tilt_y = 0;
++
++void
++tablettoolaxis(struct wl_listener *listener, void *data)
++{
++  struct wlr_tablet_tool_axis_event *event = data;
++
++  tablettoolmotion(tablet_tool,
++      event->updated_axes & WLR_TABLET_TOOL_AXIS_X,
++      event->updated_axes & WLR_TABLET_TOOL_AXIS_Y,
++      event->x, event->y, event->dx, event->dy);
++
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_PRESSURE)
++      wlr_tablet_v2_tablet_tool_notify_pressure(tablet_tool, event->pressure);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_DISTANCE)
++      wlr_tablet_v2_tablet_tool_notify_distance(tablet_tool, event->distance);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_X)
++      tilt_x = event->tilt_x;
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_Y)
++      tilt_y = event->tilt_y;
++  if (event->updated_axes & (WLR_TABLET_TOOL_AXIS_TILT_X | WLR_TABLET_TOOL_AXIS_TILT_Y))
++      wlr_tablet_v2_tablet_tool_notify_tilt(tablet_tool, tilt_x, tilt_y);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_ROTATION)
++      wlr_tablet_v2_tablet_tool_notify_rotation(tablet_tool, event->rotation);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_SLIDER)
++      wlr_tablet_v2_tablet_tool_notify_slider(tablet_tool, event->slider);
++  if (event->updated_axes & WLR_TABLET_TOOL_AXIS_WHEEL)
++      wlr_tablet_v2_tablet_tool_notify_wheel(tablet_tool, event->wheel_delta, 0);
++}
++
++void
++tablettoolbutton(struct wl_listener *listener, void *data)
++{
++  struct wlr_tablet_tool_button_event *event = data;
++  wlr_tablet_v2_tablet_tool_notify_button(tablet_tool, event->button,
++      (enum zwp_tablet_pad_v2_button_state)event->state);
++}
++
++void
++tablettooltip(struct wl_listener *listener, void *data)
++{
++  struct wlr_tablet_tool_tip_event *event = data;
++
++  if (!tablet_curr_surface) {
++      struct wlr_pointer_button_event fakeptrbtnevent = {
++          .button = BTN_LEFT,
++          .state = event->state == WLR_TABLET_TOOL_TIP_UP ?
++              WL_POINTER_BUTTON_STATE_RELEASED : WL_POINTER_BUTTON_STATE_PRESSED,
++          .time_msec = event->time_msec,
++      };
++      buttonpress(NULL, (void *)&fakeptrbtnevent);
++  }
++
++  if (event->state == WLR_TABLET_TOOL_TIP_UP) {
++      wlr_tablet_v2_tablet_tool_notify_up(tablet_tool);
++      return;
++  }
++
++  wlr_tablet_v2_tablet_tool_notify_down(tablet_tool);
++  wlr_tablet_tool_v2_start_implicit_grab(tablet_tool);
++}
++
+ void
+ tile(Monitor *m)
+ {
+-- 
+2.52.0
+
diff --git a/dwl/patches/warpcursor/README.md b/dwl/patches/warpcursor/README.md
new file mode 100644
index 0000000..34dadb9
--- /dev/null
+++ b/dwl/patches/warpcursor/README.md
@@ -0,0 +1,15 @@
+### Description
+Warp cursor to the centre of newly focused clients.
+
+Only moves the cursor if the cursor is currently not on the new client.
+
+This is my version of the orphaned cursorwarp patch except I left out the
+config flag as I think it is unnecessary.
+
+### Download
+- [git branch](https://codeberg.org/bencc/dwl/src/branch/warpcursor)
+- [v0.6](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/warpcursor/warpcursor.patch)
+
+### Authors
+- [Ben Collerson](https://codeberg.org/bencc)
+- [Faerryn](https://github.com/faerryn)
diff --git a/dwl/patches/warpcursor/warpcursor.patch b/dwl/patches/warpcursor/warpcursor.patch
new file mode 100644
index 0000000..6ac0329
--- /dev/null
+++ b/dwl/patches/warpcursor/warpcursor.patch
@@ -0,0 +1,71 @@
+From 4951ccc89dac2b557994b2f6c3aacb2398e2d1b1 Mon Sep 17 00:00:00 2001
+From: Ben Collerson <benc@benc.cc>
+Date: Thu, 4 Jan 2024 20:30:01 +1000
+Subject: [PATCH] warpcursor
+
+---
+ dwl.c | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
+
+diff --git a/dwl.c b/dwl.c
+index 145fd018..f7ad6c13 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -347,6 +347,7 @@ static void urgent(struct wl_listener *listener, void *data);
+ static void view(const Arg *arg);
+ static void virtualkeyboard(struct wl_listener *listener, void *data);
+ static void virtualpointer(struct wl_listener *listener, void *data);
++static void warpcursor(const Client *c);
+ static Monitor *xytomon(double x, double y);
+ static void xytonode(double x, double y, struct wlr_surface **psurface,
+       Client **pc, LayerSurface **pl, double *nx, double *ny);
+@@ -514,6 +515,7 @@ arrange(Monitor *m)
+       m->lt[m->sellt]->arrange(m);
+   motionnotify(0, NULL, 0, 0, 0, 0);
+   checkidleinhibitor(NULL);
++  warpcursor(focustop(selmon));
+ }
+ 
+ void
+@@ -1323,6 +1325,10 @@ focusclient(Client *c, int lift)
+   if (locked)
+       return;
+ 
++  /* Warp cursor to center of client if it is outside */
++  if (lift)
++      warpcursor(c);
++
+   /* Raise client in stacking order if requested */
+   if (c && lift)
+       wlr_scene_node_raise_to_top(&c->scene->node);
+@@ -2927,6 +2933,27 @@ virtualpointer(struct wl_listener *listener, void *data)
+       wlr_cursor_map_input_to_output(cursor, &pointer.base, event->suggested_output);
+ }
+ 
++void
++warpcursor(const Client *c) {
++  if (cursor_mode != CurNormal) {
++      return;
++  }
++  if (!c && selmon) {
++      wlr_cursor_warp_closest(cursor,
++            NULL,
++            selmon->w.x + selmon->w.width / 2.0 ,
++            selmon->w.y + selmon->w.height / 2.0);
++  }
++  else if ( c && (cursor->x < c->geom.x ||
++      cursor->x > c->geom.x + c->geom.width ||
++      cursor->y < c->geom.y ||
++      cursor->y > c->geom.y + c->geom.height))
++      wlr_cursor_warp_closest(cursor,
++            NULL,
++            c->geom.x + c->geom.width / 2.0,
++            c->geom.y + c->geom.height / 2.0);
++}
++
+ Monitor *
+ xytomon(double x, double y)
+ {
+-- 
+2.45.2
+
diff --git a/protocols/wlr-layer-shell-unstable-v1.xml b/dwl/protocols/wlr-layer-shell-unstable-v1.xml
similarity index 100%
rename from protocols/wlr-layer-shell-unstable-v1.xml
rename to dwl/protocols/wlr-layer-shell-unstable-v1.xml
diff --git a/protocols/wlr-output-power-management-unstable-v1.xml b/dwl/protocols/wlr-output-power-management-unstable-v1.xml
similarity index 100%
rename from protocols/wlr-output-power-management-unstable-v1.xml
rename to dwl/protocols/wlr-output-power-management-unstable-v1.xml
diff --git a/util.c b/dwl/util.c
similarity index 100%
rename from util.c
rename to dwl/util.c
diff --git a/util.h b/dwl/util.h
similarity index 100%
rename from util.h
rename to dwl/util.h
diff --git a/nvim/colors/wired.vim b/nvim/colors/wired.vim
new file mode 100644
index 0000000..ee0fe90
--- /dev/null
+++ b/nvim/colors/wired.vim
@@ -0,0 +1,286 @@
+" Name:         wired
+" Description:  Pure black background. Lain soul, readable contrast.
+" Author:       generated for you
+" Palette:      wired (black · rose · sage · amber · slate · teal)
+" Background:   dark
+
+set background=dark
+
+source $VIMRUNTIME/colors/vim.lua
+let g:colors_name = 'wired'
+
+let s:t_Co = &t_Co
+
+if (has('termguicolors') && &termguicolors) || has('gui_running')
+  let g:terminal_ansi_colors = [
+    \ '#000000',
+    \ '#8f404b',
+    \ '#4a6a50',
+    \ '#7a5830',
+    \ '#3d5a72',
+    \ '#943f52',
+    \ '#4e7070',
+    \ '#b89090',
+    \ '#1a0a10',
+    \ '#c05060',
+    \ '#6a9870',
+    \ '#b07840',
+    \ '#5a80a0',
+    \ '#e76485',
+    \ '#70a0a0',
+    \ '#e7d0cd'
+    \ ']
+  for i in range(g:terminal_ansi_colors->len())
+    let g:terminal_color_{i} = g:terminal_ansi_colors[i]
+  endfor
+endif
+
+hi! link Terminal         Normal
+hi! link LineNrAbove      LineNr
+hi! link LineNrBelow      LineNr
+hi! link CurSearch        Search
+hi! link CursorLineFold   CursorLine
+hi! link CursorLineSign   CursorLine
+hi! link EndOfBuffer      NonText
+hi! link MessageWindow    Pmenu
+hi! link PopupNotification Todo
+hi! link PopupSelected    PmenuSel
+
+" ── Core UI ───────────────────────────────────────────────────────────────────
+hi Normal          guifg=#e7d0cd  guibg=NONE     gui=NONE      cterm=NONE
+hi NormalFloat     guifg=#e7d0cd  guibg=NONE     gui=NONE      cterm=NONE
+hi NormalNC        guifg=#b89090  guibg=NONE     gui=NONE      cterm=NONE
+
+hi StatusLine      guifg=#e7d0cd  guibg=NONE     gui=NONE      cterm=NONE
+hi StatusLineNC    guifg=#4e7070  guibg=NONE     gui=NONE      cterm=NONE
+hi StatusLineTerm  guifg=#e7d0cd  guibg=NONE     gui=NONE      cterm=NONE
+hi StatusLineTermNC guifg=#4e7070 guibg=NONE     gui=NONE      cterm=NONE
+
+hi WinSeparator    guifg=#2a0f18  guibg=NONE     gui=NONE      cterm=NONE
+hi VertSplit       guifg=#2a0f18  guibg=#1a0a10  gui=NONE      cterm=NONE
+
+hi TabLine         guifg=#b89090  guibg=#1a0a10  gui=NONE      cterm=NONE
+hi TabLineFill     guifg=NONE     guibg=#1a0a10  gui=NONE      cterm=NONE
+hi TabLineSel      guifg=#e7d0cd  guibg=#943f52  gui=NONE      cterm=NONE
+
+" ── Popup / Completion ────────────────────────────────────────────────────────
+hi Pmenu           guifg=#e7d0cd  guibg=#1a0a10  gui=NONE      cterm=NONE
+hi PmenuSel        guifg=#000000  guibg=#e76485  gui=NONE      cterm=NONE
+hi PmenuSbar       guifg=NONE     guibg=#2a0f18  gui=NONE      cterm=NONE
+hi PmenuThumb      guifg=NONE     guibg=#943f52  gui=NONE      cterm=NONE
+hi PmenuMatch      guifg=#e76485  guibg=#1a0a10  gui=bold      cterm=bold
+hi PmenuMatchSel   guifg=#000000  guibg=#e76485  gui=bold      cterm=bold
+
+" ── Cursor / Line ─────────────────────────────────────────────────────────────
+hi Cursor          guifg=#000000  guibg=#e76485  gui=NONE      cterm=NONE
+hi lCursor         guifg=#000000  guibg=#c05060  gui=NONE      cterm=NONE
+hi CursorLine      guifg=NONE     guibg=#1a0a10  gui=NONE      cterm=NONE
+hi CursorColumn    guifg=NONE     guibg=#1a0a10  gui=NONE      cterm=NONE
+hi CursorLineNr    guifg=#e76485  guibg=NONE     gui=bold      cterm=bold
+hi ColorColumn     guifg=NONE     guibg=#1a0a10  gui=NONE      cterm=NONE
+
+" ── Line numbers / Signs ──────────────────────────────────────────────────────
+hi LineNr          guifg=#2a0f18  guibg=NONE     gui=NONE      cterm=NONE
+hi SignColumn      guifg=NONE     guibg=NONE     gui=NONE      cterm=NONE
+hi FoldColumn      guifg=#4e7070  guibg=NONE     gui=NONE      cterm=NONE
+hi Folded          guifg=#4e7070  guibg=#1a0a10  gui=italic    cterm=NONE
+
+" ── Search / Selection ────────────────────────────────────────────────────────
+hi Search          guifg=#000000  guibg=#b07840  gui=NONE      cterm=NONE
+hi IncSearch       guifg=#000000  guibg=#e76485  gui=NONE      cterm=NONE
+hi Visual          guifg=#e7d0cd  guibg=#3d5a72  gui=NONE      cterm=NONE
+hi VisualNOS       guifg=#e7d0cd  guibg=#3d5a72  gui=NONE      cterm=NONE
+hi WildMenu        guifg=#000000  guibg=#e76485  gui=NONE      cterm=NONE
+hi QuickFixLine    guifg=#000000  guibg=#b07840  gui=NONE      cterm=NONE
+hi MatchParen      guifg=#e76485  guibg=#1a0a10  gui=bold      cterm=bold
+
+" ── Messages ──────────────────────────────────────────────────────────────────
+hi ErrorMsg        guifg=#c05060  guibg=NONE     gui=bold      cterm=bold
+hi WarningMsg      guifg=#b07840  guibg=NONE     gui=bold      cterm=bold
+hi ModeMsg         guifg=#e76485  guibg=NONE     gui=bold      cterm=bold
+hi MoreMsg         guifg=#6a9870  guibg=NONE     gui=bold      cterm=bold
+hi Question        guifg=#70a0a0  guibg=NONE     gui=bold      cterm=bold
+hi Error           guifg=#c05060  guibg=NONE     gui=bold      cterm=bold
+
+" ── Spelling ──────────────────────────────────────────────────────────────────
+hi SpellBad        guifg=#c05060  guibg=NONE     guisp=#c05060 gui=undercurl cterm=underline
+hi SpellCap        guifg=#5a80a0  guibg=NONE     guisp=#5a80a0 gui=undercurl cterm=underline
+hi SpellLocal      guifg=#b07840  guibg=NONE     guisp=#b07840 gui=undercurl cterm=underline
+hi SpellRare       guifg=#70a0a0  guibg=NONE     guisp=#70a0a0 gui=undercurl cterm=underline
+
+" ── Misc UI ───────────────────────────────────────────────────────────────────
+hi NonText         guifg=#2a0f18  guibg=NONE     gui=NONE      cterm=NONE
+hi SpecialKey      guifg=#4e7070  guibg=NONE     gui=NONE      cterm=NONE
+hi Conceal         guifg=#4e7070  guibg=NONE     gui=NONE      cterm=NONE
+hi Underlined      guifg=#5a80a0  guibg=NONE     gui=underline cterm=underline
+hi Directory       guifg=#70a0a0  guibg=NONE     gui=NONE      cterm=NONE
+hi Title           guifg=#e76485  guibg=NONE     gui=bold      cterm=bold
+hi Todo            guifg=#000000  guibg=#e76485  gui=bold      cterm=bold
+hi Ignore          guifg=NONE     guibg=NONE     gui=NONE      cterm=NONE
+
+hi debugPC         guifg=#5a80a0  guibg=NONE     gui=reverse   cterm=reverse
+hi debugBreakpoint guifg=#c05060  guibg=NONE     gui=reverse   cterm=reverse
+
+hi ToolbarLine     guifg=NONE     guibg=#1a0a10  gui=NONE      cterm=NONE
+hi ToolbarButton   guifg=#000000  guibg=#b07840  gui=bold      cterm=bold
+
+" ── Diff ──────────────────────────────────────────────────────────────────────
+hi DiffAdd         guifg=#6a9870  guibg=#0a1a0d  gui=NONE      cterm=NONE
+hi DiffChange      guifg=#5a80a0  guibg=#0a1020  gui=NONE      cterm=NONE
+hi DiffText        guifg=#b07840  guibg=#1a1000  gui=NONE      cterm=NONE
+hi DiffDelete      guifg=#8f404b  guibg=#1a0a10  gui=NONE      cterm=NONE
+
+" ── Syntax ────────────────────────────────────────────────────────────────────
+"   Comment    → muted teal       (quiet, out of the way)
+"   String     → sage green       (content)
+"   Number     → amber            (literals)
+"   Keyword    → bright pink      (lain signature)
+"   Function   → bright teal      (calls)
+"   Type       → slate blue       (types, structs)
+"   Macro/Pre  → dark rose        (preprocessor)
+"   Special    → warm foreground  (escape seqs, special chars)
+"   Identifier → light teal       (variables)
+"   Constant   → muted amber      (constants)
+
+hi Comment         guifg=#4e7070  guibg=NONE     gui=italic    cterm=NONE
+hi String          guifg=#6a9870  guibg=NONE     gui=NONE      cterm=NONE
+hi Character       guifg=#6a9870  guibg=NONE     gui=NONE      cterm=NONE
+hi Number          guifg=#b07840  guibg=NONE     gui=NONE      cterm=NONE
+hi Float           guifg=#b07840  guibg=NONE     gui=NONE      cterm=NONE
+hi Boolean         guifg=#b07840  guibg=NONE     gui=italic    cterm=NONE
+hi Constant        guifg=#b07840  guibg=NONE     gui=NONE      cterm=NONE
+
+hi Statement       guifg=#e76485  guibg=NONE     gui=bold      cterm=bold
+hi Keyword         guifg=#e76485  guibg=NONE     gui=bold      cterm=bold
+hi Conditional     guifg=#e76485  guibg=NONE     gui=bold      cterm=bold
+hi Repeat          guifg=#e76485  guibg=NONE     gui=bold      cterm=bold
+hi Label           guifg=#e76485  guibg=NONE     gui=NONE      cterm=NONE
+hi Operator        guifg=#b89090  guibg=NONE     gui=NONE      cterm=NONE
+hi Exception       guifg=#c05060  guibg=NONE     gui=bold      cterm=bold
+
+hi Identifier      guifg=#70a0a0  guibg=NONE     gui=NONE      cterm=NONE
+hi Function        guifg=#70a0a0  guibg=NONE     gui=NONE      cterm=NONE
+
+hi Type            guifg=#5a80a0  guibg=NONE     gui=bold      cterm=bold
+hi StorageClass    guifg=#5a80a0  guibg=NONE     gui=NONE      cterm=NONE
+hi Structure       guifg=#5a80a0  guibg=NONE     gui=NONE      cterm=NONE
+hi Typedef         guifg=#5a80a0  guibg=NONE     gui=italic    cterm=NONE
+
+hi PreProc         guifg=#943f52  guibg=NONE     gui=NONE      cterm=NONE
+hi Include         guifg=#943f52  guibg=NONE     gui=NONE      cterm=NONE
+hi Define          guifg=#943f52  guibg=NONE     gui=NONE      cterm=NONE
+hi Macro           guifg=#943f52  guibg=NONE     gui=NONE      cterm=NONE
+hi PreCondit       guifg=#943f52  guibg=NONE     gui=NONE      cterm=NONE
+
+hi Special         guifg=#b89090  guibg=NONE     gui=NONE      cterm=NONE
+hi SpecialChar     guifg=#b07840  guibg=NONE     gui=NONE      cterm=NONE
+hi Tag             guifg=#e76485  guibg=NONE     gui=NONE      cterm=NONE
+hi Delimiter       guifg=#b89090  guibg=NONE     gui=NONE      cterm=NONE
+hi SpecialComment  guifg=#70a0a0  guibg=NONE     gui=italic    cterm=NONE
+hi Debug           guifg=#c05060  guibg=NONE     gui=NONE      cterm=NONE
+
+" ── Treesitter (nvim-treesitter) ──────────────────────────────────────────────
+hi! link @comment              Comment
+hi! link @comment.documentation SpecialComment
+hi! link @string               String
+hi! link @string.escape        SpecialChar
+hi! link @string.special       SpecialChar
+hi! link @character            Character
+hi! link @number               Number
+hi! link @float                Float
+hi! link @boolean              Boolean
+hi! link @constant             Constant
+hi! link @constant.builtin     Constant
+hi! link @constant.macro       Macro
+
+hi! link @keyword              Keyword
+hi! link @keyword.return       Keyword
+hi! link @keyword.function     Keyword
+hi! link @keyword.operator     Operator
+hi! link @conditional          Conditional
+hi! link @repeat               Repeat
+hi! link @label                Label
+hi! link @operator             Operator
+hi! link @exception            Exception
+hi! link @include              Include
+
+hi! link @function             Function
+hi! link @function.builtin     Function
+hi! link @function.call        Function
+hi! link @function.macro       Macro
+hi! link @method               Function
+hi! link @method.call          Function
+hi! link @constructor          Type
+
+hi! link @variable             Identifier
+hi! link @variable.builtin     Special
+hi! link @parameter            Identifier
+hi! link @field                Identifier
+hi! link @property             Identifier
+
+hi! link @type                 Type
+hi! link @type.builtin         Type
+hi! link @type.qualifier       StorageClass
+hi! link @namespace            Type
+hi! link @module               Type
+
+hi! link @tag                  Tag
+hi! link @tag.attribute        Identifier
+hi! link @tag.delimiter        Delimiter
+hi! link @punctuation          Delimiter
+hi! link @punctuation.bracket  Delimiter
+hi! link @punctuation.special  SpecialChar
+
+hi! link @text.title           Title
+hi! link @text.uri             Underlined
+hi @text.emphasis              guifg=NONE guibg=NONE gui=italic  cterm=NONE
+hi @text.strong                guifg=NONE guibg=NONE gui=bold    cterm=NONE
+hi! link @text.danger          ErrorMsg
+hi! link @text.warning         WarningMsg
+hi! link @text.note            MoreMsg
+
+" ── LSP Diagnostics ───────────────────────────────────────────────────────────
+hi DiagnosticError             guifg=#c05060  guibg=NONE     gui=NONE      cterm=NONE
+hi DiagnosticWarn              guifg=#b07840  guibg=NONE     gui=NONE      cterm=NONE
+hi DiagnosticInfo              guifg=#5a80a0  guibg=NONE     gui=NONE      cterm=NONE
+hi DiagnosticHint              guifg=#4e7070  guibg=NONE     gui=NONE      cterm=NONE
+
+hi DiagnosticUnderlineError    guifg=NONE     guibg=NONE     guisp=#c05060 gui=undercurl cterm=underline
+hi DiagnosticUnderlineWarn     guifg=NONE     guibg=NONE     guisp=#b07840 gui=undercurl cterm=underline
+hi DiagnosticUnderlineInfo     guifg=NONE     guibg=NONE     guisp=#5a80a0 gui=undercurl cterm=underline
+hi DiagnosticUnderlineHint     guifg=NONE     guibg=NONE     guisp=#4e7070 gui=undercurl cterm=underline
+
+hi DiagnosticVirtualTextError  guifg=#8f404b  guibg=NONE     gui=italic    cterm=NONE
+hi DiagnosticVirtualTextWarn   guifg=#7a5830  guibg=NONE     gui=italic    cterm=NONE
+hi DiagnosticVirtualTextInfo   guifg=#3d5a72  guibg=NONE     gui=italic    cterm=NONE
+hi DiagnosticVirtualTextHint   guifg=#4e7070  guibg=NONE     gui=italic    cterm=NONE
+
+hi! link LspReferenceText      CursorLine
+hi! link LspReferenceRead      CursorLine
+hi! link LspReferenceWrite     CursorLine
+
+" ── Git signs (gitsigns.nvim) ─────────────────────────────────────────────────
+hi GitSignsAdd                 guifg=#4a6a50  guibg=NONE     gui=NONE      cterm=NONE
+hi GitSignsChange              guifg=#3d5a72  guibg=NONE     gui=NONE      cterm=NONE
+hi GitSignsDelete              guifg=#8f404b  guibg=NONE     gui=NONE      cterm=NONE
+
+" ── Color reference ───────────────────────────────────────────────────────────
+" Color: background  #000000   pure black
+" Color: bg_dim      #1a0a10   dark rose-tinted surface
+" Color: bg_alt      #2a0f18   borders, inactive elements
+" Color: color00     #000000   black
+" Color: color01     #8f404b   dark rose (errors, git del)
+" Color: color02     #4a6a50   dark sage (strings, git add)
+" Color: color03     #7a5830   dark amber (numbers)
+" Color: color04     #3d5a72   dark slate (types, git change)
+" Color: color05     #943f52   dark magenta (macros, preproc)
+" Color: color06     #4e7070   dark teal (comments)
+" Color: color07     #b89090   warm muted fg (operators, delimiters)
+" Color: color08     #1a0a10   bright black (surface)
+" Color: color09     #c05060   bright rose (errors)
+" Color: color10     #6a9870   bright sage (strings bright)
+" Color: color11     #b07840   bright amber (numbers, search)
+" Color: color12     #5a80a0   bright slate (types, info)
+" Color: color13     #e76485   bright pink — lain signature (keywords, accent)
+" Color: color14     #70a0a0   bright teal (functions, identifiers)
+" Color: color15     #e7d0cd   warm white (foreground)
diff --git a/nvim/init.lua b/nvim/init.lua
new file mode 100644
index 0000000..a26c5ed
--- /dev/null
+++ b/nvim/init.lua
@@ -0,0 +1,21 @@
+for k, v in pairs(require("options")) do
+    vim.opt[k] = v
+end
+
+for k, v in pairs(require("globals")) do
+    vim.g[k] = v
+end
+
+for _, v in pairs(require("commands")) do
+    vim.cmd(v)
+end
+
+vim.pack.add(require("packages"))
+
+require("functions")
+require("setup")
+require("lsp")
+
+for _, v in pairs(require("binds")) do
+    vim.keymap.set(v[1], v[2], v[3])
+end
diff --git a/nvim/lua/binds.lua b/nvim/lua/binds.lua
new file mode 100644
index 0000000..abbce94
--- /dev/null
+++ b/nvim/lua/binds.lua
@@ -0,0 +1,32 @@
+return {
+   --  mode              key          cmd                            --
+   --------------------------------------------------------------------
+   { { "n", "v" },       "<C-a>",     "ggVG"                          },
+   {   "n",              "<leader>f", function() fzy_finder(true) end },
+   {   "n",              "<C-j>",     "<C-w>w"                        },
+   {   "n",              "<C-k>",     "<C-w>W"                        },
+   {   "n",              "<C-h>",     "<C-w><"                        },
+   {   "n",              "<C-l>",     "<C-w>>"                        },
+   {   "n",              "<C-f>",     "<C-w>x"                        },
+   {   "n",              "<A-k>",     ":m .-2<CR>=="                  },
+   {   "n",              "<A-j>",     ":m .+1<CR>=="                  },
+   {   "v",              "<A-k>",     ":silent m '<-2<CR>gv=gv"       },
+   {   "v",              "<A-j>",     ":silent m '>+1<CR>gv=gv"       },
+   {   "n",              "<leader>j", ":%s//g<Left><Left>"            },
+   {   "v",              "<leader>j", ":s//g<Left><Left>"             },
+   { { "n", "v" },       "te",        ":tabedit "                     },
+   { { "n", "v" },       "<S-l>",     ":tabnext<CR>"                  },
+   { { "n", "v" },       "<",         "<gv"                           },
+   { { "n", "v" },       ">",         ">gv"                           },
+   { { "n", "v" },       "<S-h>",     ":tabprev<CR>"                  },
+   { { "n", "v" },       "E",         ":e "                           },
+   { { "n", "v" },       "sv",        ":vsplit "                      },
+   { { "n", "v" },       "ss",        ":split "                       },
+   { { "n", "v" },       "<CR>",      ":!make -B<CR>"                 },
+   {   "n",              "<leader>k", ":tabedit <cfile><CR>"          },
+    { { "n", "v" },       "<C-e>",     ":source ~/.config/nvim/init.lua <CR>" },
+   {   "n",              "gd",        ":tab split | lua vim.lsp.buf.definition()<CR>" },
+   {   "n",              "<leader>g", function() gdb() end           },
+   {   "n",              "<A-/>",     require("Comment.api").toggle.linewise.current },
+   {   "v",              "<A-/>",     function() vim.api.nvim_feedkeys("gc", "x", false ) end },
+}
diff --git a/nvim/lua/commands.lua b/nvim/lua/commands.lua
new file mode 100644
index 0000000..b304593
--- /dev/null
+++ b/nvim/lua/commands.lua
@@ -0,0 +1,12 @@
+-- commands
+return {
+   "colorscheme wired",
+   "syntax on",
+   "filetype plugin indent on",
+   "cnoreabbrev q q!",
+   "cnoreabbrev Q qall!",
+   "cnoreabbrev w w!",
+   "cnoreabbrev W w!",
+   "cnoreabbrev wq wq!",
+   "colorscheme wired"
+}
diff --git a/nvim/lua/functions.lua b/nvim/lua/functions.lua
new file mode 100644
index 0000000..3cf9820
--- /dev/null
+++ b/nvim/lua/functions.lua
@@ -0,0 +1,51 @@
+_G.lsp_diagnostics = function()
+  local e = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })
+  local w = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN })
+  local err = (e > 0) and (" " .. e .. "   ") or ""
+  local warn = (w > 0) and (" " .. w .. " ") or ""
+  return err .. warn
+end
+
+function fzy_finder(new_tab)
+   local s, r = "/tmp/s.sh", "/tmp/r"
+   local f = io.open(s, "w")
+   f:write(
+       "find . -type f -not -path '*/.*' -not -path '*/node_modules/*' -not -path '*/target/*' -not -path '*/__pycache__/*' -not -path '*/.venv/*' -not -path '*/.cache/*' | fzy -l 6 > " ..
+       r)
+   f:close()
+   os.execute("chmod +x " .. s)
+
+   require('toggleterm.terminal').Terminal:new({
+       cmd = s,
+       direction = "horizontal",
+       size = 6,
+       close_on_exit = true,
+       on_exit = function()
+           vim.schedule(function()
+               local rf = io.open(r, "r")
+               if rf then
+                   local file = rf:read("*line")
+                   rf:close()
+                   os.remove(r)
+                   if file and file ~= "" then
+                       vim.cmd(new_tab == true and ("tabnew " .. file) or new_tab == "vsplit" and ("vsplit " .. file) or ("edit " .. file))
+                   end
+               end
+               os.remove(s)
+           end)
+       end,
+   }):toggle()
+end
+
+
+
+function gdb()
+   require('toggleterm.terminal').Terminal:new({
+       cmd = "gdb -q --args <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>b</mi><mi>a</mi><mi>s</mi><mi>h</mi><mo>&#x02212;</mo><mi>i</mi><mo>&#x02212;</mo><msup><mi>c</mi><mi>&#x02032;</mi></msup><mi>p</mi><mi>r</mi><mi>i</mi><mi>n</mi><mi>t</mi><mi>f</mi><mi>\</mi><mi>"</mi><mspace linebreak="newline" /><mn>033</mn><mo stretchy="false">[</mo><mn>1</mn><mi>;</mi><mn>36</mn><mi>m</mi><mi>E</mi><mi>x</mi><mi>e</mi><mi>c</mi><mi>u</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi><mi>:</mi><mspace linebreak="newline" /><mn>033</mn><mo stretchy="false">[</mo><mn>0</mn><mi>m</mi><mi>\</mi><mi>"</mi><mo>&#x0003E;</mo><mi>&</mi><mn>2</mn><mi>;</mi><mi>r</mi><mi>e</mi><mi>a</mi><mi>d</mi><mo>&#x02212;</mo><mi>e</mi><mi>g</mi><mi>d</mi><msub><mi>b</mi><mi>e</mi></msub><mi>x</mi><mi>e</mi><mi>;</mi><mi>p</mi><mi>r</mi><mi>i</mi><mi>n</mi><mi>t</mi><mi>f</mi><mi>\</mi><mi>"</mi></mrow></math>gdb_exe\"')" ,
+       direction = "float",
+       size = 3,
+       close_on_exit = true,
+   }):toggle()
+end
+
+vim.deprecate = function() end
diff --git a/nvim/lua/globals.lua b/nvim/lua/globals.lua
new file mode 100644
index 0000000..d861670
--- /dev/null
+++ b/nvim/lua/globals.lua
@@ -0,0 +1,6 @@
+-- Global variables
+return {
+   mapleader          = " ",
+   loaded_netrw       = 1,
+   loaded_netrwPlugin = 1,
+}
diff --git a/nvim/lua/lsp.lua b/nvim/lua/lsp.lua
new file mode 100644
index 0000000..23a9392
--- /dev/null
+++ b/nvim/lua/lsp.lua
@@ -0,0 +1,49 @@
+local servers = { "ada_ls","ts_ls", "pyright", "tailwindcss", "zls", "html", "cssls", "rust_analyzer", "lua_ls","texlab" }
+local caps = require('cmp_nvim_lsp').default_capabilities()
+local lsp = require('lspconfig')
+
+for _, s in ipairs(servers) do
+   lsp[s].setup({
+       capabilities = caps,
+   })
+end
+
+require('lspconfig').clangd.setup{
+    cmd = { "clangd", "--enable-config" }
+}
+
+lsp.nim_langserver.setup({
+    capabilities = caps,
+    on_init = function(client, _)
+        client.handlers["window/showMessage"] = function() end
+        client.handlers["window/logMessage"]  = function() end
+    end,
+})
+
+lsp.ada_ls.setup({
+   cmd = { "ada_language_server" }
+})
+
+lsp.lua_ls.setup({
+   capabilities = caps,
+})
+
+vim.diagnostic.config({
+    virtual_text = false,
+    signs = false,
+    underline = true,
+    update_in_insert = true,
+    severity_sort = false,
+})
+
+vim.lsp.handlers["textDocument/hover"] = function(_, result, ctx, config)
+    config = config or {}
+    config.border = border
+    return vim.lsp.handlers.hover(_, result, ctx, config)
+end
+
+vim.lsp.handlers["textDocument/signatureHelp"] = function(_, result, ctx, config)
+    config = config or {}
+    config.border = border
+    return vim.lsp.handlers.signature_help(_, result, ctx, config)
+end
diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua
new file mode 100644
index 0000000..5ff75e6
--- /dev/null
+++ b/nvim/lua/options.lua
@@ -0,0 +1,33 @@
+-- Options
+return {
+   clipboard          = "unnamedplus",
+   shiftwidth         = 2,
+   smartindent        = true,
+   number             = true,
+   relativenumber     = true,
+   tabstop            = 4,
+   swapfile           = false,
+   hlsearch           = true,
+   startofline        = false,
+   mouse              = "a",
+   wrap               = false,
+   scrolloff          = 1,
+   ignorecase         = true,
+   smartcase          = true,
+   showcmd            = true,
+   showmatch          = true,
+   history            = 1000,
+   wildmenu           = true,
+   undofile           = true,
+   undodir            = vim.fn.expand("~/.local/state/nvim/undo"),
+   cursorline         = true,
+   wildmode           = "longest:full,full",
+   wildignore         = "*.docx,*.we*,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.svg,*.flv,*.img,*.xlsx",
+   clipboard          = "unnamedplus",
+   termguicolors      = true,
+   backup             = false,
+   writebackup        = false,
+   cmdheight          = 0,
+   laststatus         = 2,
+   statusline         = "%#Normal#%{mode() ==# 'n' ? 'NORMAL' : mode() ==# 'i' ? 'INSERT' : mode() ==# 'v' ? 'VISUAL' : 'OTHER'} %{&modified?'+':''} %= %{luaeval('_G.lsp_diagnostics()')} %f",
+}
diff --git a/nvim/lua/packages.lua b/nvim/lua/packages.lua
new file mode 100644
index 0000000..0d83363
--- /dev/null
+++ b/nvim/lua/packages.lua
@@ -0,0 +1,15 @@
+return {
+    "https://github.com/hrsh7th/cmp-nvim-lsp",
+    "https://github.com/hrsh7th/cmp-path",
+    "https://github.com/numToStr/Comment.nvim",
+    "https://github.com/vyfor/cord.nvim",
+    "https://github.com/lewis6991/gitsigns.nvim",
+    "https://github.com/Skardyy/neo-img",
+    "https://github.com/hrsh7th/nvim-cmp",
+   "https://github.com/Pixel2175/nvim-colorizer.lua",
+    "https://github.com/neovim/nvim-lspconfig",
+    "https://github.com/nvim-treesitter/nvim-treesitter",
+    "https://github.com/akinsho/toggleterm.nvim",
+    "https://github.com/alvan/vim-closetag",
+    "https://github.com/vimpostor/vim-tpipeline",
+}
diff --git a/nvim/lua/setup.lua b/nvim/lua/setup.lua
new file mode 100644
index 0000000..fb85b86
--- /dev/null
+++ b/nvim/lua/setup.lua
@@ -0,0 +1,75 @@
+local border = { "╭","─","╮","│","╯","─","╰","│" }
+
+require('neo-img').setup({})
+require('Comment').setup()
+require('gitsigns').setup()
+require('colorizer').setup({ "*" }, {
+    RGB      = true,
+    RRGGBB   = true,
+    names    = true,
+    RRGGBBAA = true,
+    rgb_fn   = true,
+    hsl_fn   = true,
+    css      = true,
+    css_fn   = true,
+    mode     = 'background',
+})
+
+require("toggleterm").setup({
+    size             = 6,
+    open_mapping     = [[<C-_>]],
+    hide_numbers     = true,
+    shade_filetypes  = {},
+    shade_terminals  = false,
+    shading_factor   = 2,
+    start_in_insert  = true,
+    insert_mappings  = true,
+    terminal_mappings = true,
+    persist_size     = true,
+    persist_mode     = true,
+    direction        = "float",
+    close_on_exit    = true,
+    shell            = vim.o.shell,
+    auto_scroll      = true,
+})
+
+local cmp = require("cmp")
+
+cmp.setup({
+    window = {
+        completion = cmp.config.window.bordered({
+            border      = border,
+            winhighlight = "Normal:NormalFloat,FloatBorder:White,CursorLine:PmenuSel,Search:None",
+        }),
+        documentation = cmp.config.window.bordered({
+            border      = border,
+            winhighlight = "Normal:NormalFloat,FloatBorder:White,CursorLine:PmenuSel,Search:None",
+        }),
+    },
+    formatting = {
+        fields = { "abbr", "kind" },
+        format = function(_, vim_item)
+            vim_item.menu   = nil
+            vim_item.detail = nil
+            return vim_item
+        end,
+    },
+    mapping = cmp.mapping.preset.insert({
+        ["<C-n>"] = cmp.mapping.select_next_item(),
+        ["<C-p>"] = cmp.mapping.select_prev_item(),
+        ["<CR>"]  = cmp.mapping.confirm({ select = true }),
+    }),
+    sources = {
+        { name = "nvim_lsp" },
+        { name = "buffer"   },
+        { name = "path"     },
+    },
+})
+
+require("nvim-treesitter").install({
+    "rust",
+    "c",
+    "javascript",
+    "zig",
+    "python",
+})
diff --git a/patches/bar-center.patch b/patches/bar-center.patch
deleted file mode 100644
index 36a0ce3..0000000
--- a/patches/bar-center.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 17501c9f28226b1f332d6842be0d7f50ba618a29 Mon Sep 17 00:00:00 2001
-From: moonsabre <moonsabre@tuta.io>
-Date: Fri, 14 Mar 2025 16:04:25 -0700
-Subject: [PATCH] Bar title centering parameter.
-
----
- config.def.h | 1 +
- dwl.c        | 9 +++++++--
- 2 files changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/config.def.h b/config.def.h
-index 5d1dc2b..8ac3a8b 100644
---- a/config.def.h
-+++ b/config.def.h
-@@ -9,6 +9,7 @@ static const int bypass_surface_visibility = 0;  /* 1 means idle inhibitors will
- static const unsigned int borderpx         = 1;  /* border pixel of windows */
- static const int showbar                   = 1; /* 0 means no bar */
- static const int topbar                    = 1; /* 0 means bottom bar */
-+static const int centeredtitle             = 1; /* 1 means centered title */
- 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 */
-diff --git a/dwl.c b/dwl.c
-index ece537a..9eb816b 100644
---- a/dwl.c
-+++ b/dwl.c
-@@ -1551,9 +1551,14 @@ drawbar(Monitor *m)
-   if ((w = m->b.width - tw - x) > m->b.height) {
-       if (c) {
-           drwl_setscheme(m->drw, colors[m == selmon ? SchemeSel : SchemeNorm]);
--          drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
-+          tw = TEXTW(selmon, client_get_title(c));
-+          drwl_text(m->drw, x, 0, w, m->b.height,
-+                  !centeredtitle || tw > w ? m->lrpad / 2 : (w - tw) / 2,
-+                  client_get_title(c), 0);
-           if (c && c->isfloating)
--              drwl_rect(m->drw, x + boxs, boxs, boxw, boxw, 0, 0);
-+              drwl_rect(m->drw,
-+                  !centeredtitle || tw > w ? x + boxs : x + ((w - tw) / 2 - boxs * 8),
-+                  boxs, boxw, boxw, 0, 0);
-       } else {
-           drwl_setscheme(m->drw, colors[SchemeNorm]);
-           drwl_rect(m->drw, x, 0, w, m->b.height, 1, 1);
--- 
-2.48.1
-
-
diff --git a/patches/clrreload.patch b/patches/clrreload.patch
deleted file mode 100644
index 80c1f49..0000000
--- a/patches/clrreload.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 95c2afa..73422ee 100644
---- a/config.def.h
-+++ b/config.def.h
-@@ -4,9 +4,12 @@
-                         ((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 */
-+// Replace colors_dir with your own path, e.g /home/yourname/.cache/dwl-colors
-+static const char *colors_dir                  = "/home/pixel/.cache/wal/dwl-colors"; 
- static const float rootcolor[]             = COLOR(0x222222ff);
- static const float bordercolor[]           = COLOR(0x444444ff);
- static const float focuscolor[]            = COLOR(0x005577ff);
-@@ -128,6 +131,7 @@ static const Key keys[] = {
-   { MODKEY,                    XKB_KEY_p,          spawn,          {.v = menucmd} },
-   { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return,     spawn,          {.v = termcmd} },
-   { MODKEY,                    XKB_KEY_j,          focusstack,     {.i = +1} },
-+  { MODKEY,                    XKB_KEY_n,          reload_colors,  {0} },
-   { MODKEY,                    XKB_KEY_k,          focusstack,     {.i = -1} },
-   { MODKEY,                    XKB_KEY_i,          incnmaster,     {.i = +1} },
-   { MODKEY,                    XKB_KEY_d,          incnmaster,     {.i = -1} },
-diff --git a/dwl.c b/dwl.c
-index 12f441e..0801673 100644
---- a/dwl.c
-+++ b/dwl.c
-@@ -313,6 +313,7 @@ static void pointerfocus(Client *c, struct wlr_surface *surface,
- static void printstatus(void);
- static void powermgrsetmode(struct wl_listener *listener, void *data);
- static void quit(const Arg *arg);
-+static void reload_colors(const Arg *arg);
- static void rendermon(struct wl_listener *listener, void *data);
- static void requestdecorationmode(struct wl_listener *listener, void *data);
- static void requeststartdrag(struct wl_listener *listener, void *data);
-@@ -2146,6 +2147,28 @@ quit(const Arg *arg)
-   wl_display_terminate(dpy);
- }
- 
-+void
-+reload_colors(const Arg *arg)
-+{
-+    FILE *f = fopen(colors_dir, "r");
-+    if (!f) {
-+        return;
-+    }
-+
-+    for (int i = 0; i < (int)LENGTH(colors); i++) {
-+        unsigned int fg, bg, border;
-+        if (fscanf(f, "%x %x %x", &fg, &bg, &border) != 3) {
-+            break;
-+        }
-+        colors[i][ColFg] = fg;
-+        colors[i][ColBg] = bg;
-+        colors[i][ColBorder] = border;
-+    }
-+
-+    fclose(f);
-+    drawbars();
-+}
-+
- void
- rendermon(struct wl_listener *listener, void *data)
- {
diff --git a/screenshots/dwl-00.png b/screenshots/dwl-00.png
new file mode 100644
index 0000000..3296221
Binary files /dev/null and b/screenshots/dwl-00.png differ
diff --git a/screenshots/dwl-01.png b/screenshots/dwl-01.png
new file mode 100644
index 0000000..6006e8c
Binary files /dev/null and b/screenshots/dwl-01.png differ
diff --git a/screenshots/nvim-00.png b/screenshots/nvim-00.png
new file mode 100644
index 0000000..0cd6764
Binary files /dev/null and b/screenshots/nvim-00.png differ
diff --git a/screenshots/nvim-01.png b/screenshots/nvim-01.png
new file mode 100644
index 0000000..a6d84ea
Binary files /dev/null and b/screenshots/nvim-01.png differ
diff --git a/sta/LICENSE b/sta/LICENSE
new file mode 100644
index 0000000..10d1091
--- /dev/null
+++ b/sta/LICENSE
@@ -0,0 +1,47 @@
+ISC License
+
+Copyright 2026 Pi66 <pixel2176@proton.me>
+
+Copyright 2016 Roy Freytag <rfreytag@hs-mittweida.de>
+Copyright 2016 Vincent Loupmon <vincentloupmon@gmail.com>
+Copyright 2016 Daniel Walter <d.walter@0x90.at>
+Copyright 2016-2018 Ali H. Fardan <raiz@firemail.cc>
+Copyright 2016 Jody Leonard <me@jodyleonard.com>
+Copyright 2016-2018 Quentin Rameau <quinq@fifth.space>
+Copyright 2016 Mike Coddington <mike@coddington.us>
+Copyright 2016-2018 Ivan J. <parazyd@dyne.org>
+Copyright 2017 Tobias Stoeckmann <tobias@stoeckmann.org>
+Copyright 2017-2018 Laslo Hunhold <dev@frign.de>
+Copyright 2018 Darron Anderson <darronanderson@protonmail.com>
+Copyright 2018 Josuah Demangeon <mail@josuah.net>
+Copyright 2018 Tobias Tschinkowitz <tobias@he4d.net>
+Copyright 2018 David Demelier <markand@malikania.fr>
+Copyright 2018-2012 Michael Buch <michaelbuch12@gmail.com>
+Copyright 2018 Ian Remmler <ian@remmler.org>
+Copyright 2016-2019 Joerg Jung <jung@openbsd.org>
+Copyright 2019 Ryan Kes <alrayyes@gmail.com>
+Copyright 2019 Cem Keylan <cem@ckyln.com>
+Copyright 2019 Spiros Thanasoulas <dsp@2f30.org>
+Copyright 2019-2022 Ingo Feinerer <feinerer@logic.at>
+Copyright 2020 Alexandre Ratchov <alex@caoua.org>
+Copyright 2020 Mart Lubbers <mart@martlubbers.net>
+Copyright 2020 Daniel Moch <daniel@danielmoch.com>
+Copyright 2022 Nickolas Raymond Kaczynski <nrk@disroot.org>
+Copyright 2022 Patrick Iacob <iacobp@oregonstate.edu>
+Copyright 2021-2022 Steven Ward <planet36@gmail.com>
+Copyright 2025 Joakim Sindholt <opensource@zhasha.com>
+Copyright 2025 Al <eirann@disroot.org>
+Copyright 2025 sewn <sewn@disroot.org>
+Copyright 2016-2026 Aaron Marcher <me@drkhsh.at>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/sta/Makefile b/sta/Makefile
new file mode 100644
index 0000000..feddd90
--- /dev/null
+++ b/sta/Makefile
@@ -0,0 +1,13 @@
+build: config.h
+   cc -w -o sta sta.c ./components/* -pthread
+
+config.h:
+   cp config.def.h config.h
+
+install: build
+   cp sta /usr/local/bin
+
+uninstall:
+   rm -f /usr/local/bin/sta
+clean:
+   rm -f ./sta  
diff --git a/sta/README.md b/sta/README.md
new file mode 100644
index 0000000..987da02
--- /dev/null
+++ b/sta/README.md
@@ -0,0 +1,29 @@
+# STA
+**STA** is a minimal status monitor written in C.
+
+## About
+STA is inspired by slstatus. The core code is fully rewritten; only the config structure (with some edits) and the status-fetching functions are from slstatus.
+
+## How it works
+STA runs as a server (daemon) using a UNIX socket and waits for updates from clients.
+You can update any status by specifying its ID from the config file, then run:
+```
+sta -id <ID>
+```
+
+This sends a signal to the socket and refreshs the status.
+You can configure the displayed status in `config.def.h`.
+
+### Example
+```bash
+# Start the server
+sta -s
+
+# Send a status update
+sta -id 1
+```
+
+This sends the current time (or other info) to the server with a unique ID.
+Rerun the command whenever you want to update the status.
+
+> **Note:** STA was created for learning purposes.
diff --git a/sta/components/battery.c b/sta/components/battery.c
new file mode 100644
index 0000000..734bc1d
--- /dev/null
+++ b/sta/components/battery.c
@@ -0,0 +1,257 @@
+/* See LICENSE file for copyright and license details. */
+#include <stdio.h>
+#include <string.h>
+
+#include "../util.h"
+
+#if defined(__linux__)
+/*
+ * https://www.kernel.org/doc/html/latest/power/power_supply_class.html
+ */
+   #include <limits.h>
+   #include <stdint.h>
+   #include <unistd.h>
+
+   #define POWER_SUPPLY_CAPACITY "/sys/class/power_supply/%s/capacity"
+   #define POWER_SUPPLY_STATUS   "/sys/class/power_supply/%s/status"
+   #define POWER_SUPPLY_CHARGE   "/sys/class/power_supply/%s/charge_now"
+   #define POWER_SUPPLY_ENERGY   "/sys/class/power_supply/%s/energy_now"
+   #define POWER_SUPPLY_CURRENT  "/sys/class/power_supply/%s/current_now"
+   #define POWER_SUPPLY_POWER    "/sys/class/power_supply/%s/power_now"
+
+   static const char *
+   pick(const char *bat, const char *f1, const char *f2, char *path,
+        size_t length)
+   {
+   static _Thread_local char buf[1024];
+       if (esnprintf(buf, path, length, f1, bat) > 0 &&
+           access(path, R_OK) == 0)
+           return f1;
+
+       if (esnprintf(buf, path, length, f2, bat) > 0 &&
+           access(path, R_OK) == 0)
+           return f2;
+
+       return NULL;
+   }
+
+   const char *
+   battery_perc(const char *bat)
+   {
+   static _Thread_local char buf[1024];
+       int cap_perc;
+       char path[PATH_MAX];
+
+       if (esnprintf(buf, path, sizeof(path), POWER_SUPPLY_CAPACITY, bat) < 0)
+           return NULL;
+       if (pscanf(buf, path, "%d", &cap_perc) != 1)
+           return NULL;
+
+       return bprintf(buf, "%d", cap_perc);
+   }
+
+   const char *
+   battery_state(const char *bat)
+   {
+   static _Thread_local char buf[1024];
+       static struct {
+           char *state;
+           char *symbol;
+       } map[] = {
+           { "Charging",    "󰚥" },
+           { "Discharging", "󰚦" },
+           { "Full",        "󰚥" },
+           { "Not charging", "󰚥"},
+       };
+       size_t i;
+       char path[PATH_MAX], state[12];
+
+       if (esnprintf(buf, path, sizeof(path), POWER_SUPPLY_STATUS, bat) < 0)
+           return NULL;
+       if (pscanf(buf, path, "%12[a-zA-Z ]", state) != 1)
+           return NULL;
+
+       for (i = 0; i < LEN(map); i++)
+           if (!strcmp(map[i].state, state))
+               break;
+
+       return (i == LEN(map)) ? "?" : map[i].symbol;
+   }
+
+   const char *
+   battery_remaining(const char *bat)
+   {
+   static _Thread_local char buf[1024];
+       uintmax_t charge_now, current_now, m, h;
+       double timeleft;
+       char path[PATH_MAX], state[12];
+
+       if (esnprintf(buf, path, sizeof(path), POWER_SUPPLY_STATUS, bat) < 0)
+           return NULL;
+       if (pscanf(buf, path, "%12[a-zA-Z ]", state) != 1)
+           return NULL;
+
+       if (!pick(bat, POWER_SUPPLY_CHARGE, POWER_SUPPLY_ENERGY, path,
+                 sizeof(path)) ||
+           pscanf(buf, path, "%ju", &charge_now) < 0)
+           return NULL;
+
+       if (!strcmp(state, "Discharging")) {
+           if (!pick(bat, POWER_SUPPLY_CURRENT, POWER_SUPPLY_POWER, path,
+                     sizeof(path)) ||
+               pscanf(buf, path, "%ju", &current_now) < 0)
+               return NULL;
+
+           if (current_now == 0)
+               return NULL;
+
+           timeleft = (double)charge_now / (double)current_now;
+           h = timeleft;
+           m = (timeleft - (double)h) * 60;
+
+           return bprintf(buf, "%juh %jum", h, m);
+       }
+
+       return "";
+   }
+#elif defined(__OpenBSD__)
+   #include <fcntl.h>
+   #include <machine/apmvar.h>
+   #include <sys/ioctl.h>
+   #include <unistd.h>
+
+   static int
+   load_apm_power_info(struct apm_power_info *apm_info)
+   {
+   static _Thread_local char buf[1024];
+       int fd;
+
+       fd = open("/dev/apm", O_RDONLY);
+       if (fd < 0) {
+           warn("open '/dev/apm':");
+           return 0;
+       }
+
+       memset(apm_info, 0, sizeof(struct apm_power_info));
+       if (ioctl(fd, APM_IOC_GETPOWER, apm_info) < 0) {
+           warn("ioctl 'APM_IOC_GETPOWER':");
+           close(fd);
+           return 0;
+       }
+       return close(fd), 1;
+   }
+
+   const char *
+   battery_perc(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       struct apm_power_info apm_info;
+
+       if (load_apm_power_info(&apm_info))
+           return bprintf(buf, "%d", apm_info.battery_life);
+
+       return NULL;
+   }
+
+   const char *
+   battery_state(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       struct {
+           unsigned int state;
+           char *symbol;
+       } map[] = {
+           { APM_AC_ON,      "+" },
+           { APM_AC_OFF,     "-" },
+       };
+       struct apm_power_info apm_info;
+       size_t i;
+
+       if (load_apm_power_info(&apm_info)) {
+           for (i = 0; i < LEN(map); i++)
+               if (map[i].state == apm_info.ac_state)
+                   break;
+
+           return (i == LEN(map)) ? "?" : map[i].symbol;
+       }
+
+       return NULL;
+   }
+
+   const char *
+   battery_remaining(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       struct apm_power_info apm_info;
+       unsigned int h, m;
+
+       if (load_apm_power_info(&apm_info)) {
+           if (apm_info.ac_state != APM_AC_ON) {
+               h = apm_info.minutes_left / 60;
+               m = apm_info.minutes_left % 60;
+               return bprintf(buf, "%uh %02um", h, m);
+           } else {
+               return "";
+           }
+       }
+
+       return NULL;
+   }
+#elif defined(__FreeBSD__)
+   #include <sys/sysctl.h>
+
+   #define BATTERY_LIFE  "hw.acpi.battery.life"
+   #define BATTERY_STATE "hw.acpi.battery.state"
+   #define BATTERY_TIME  "hw.acpi.battery.time"
+
+   const char *
+   battery_perc(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       int cap_perc;
+       size_t len;
+
+       len = sizeof(cap_perc);
+       if (sysctlbyname(BATTERY_LIFE, &cap_perc, &len, NULL, 0) < 0 || !len)
+           return NULL;
+
+       return bprintf(buf, "%d", cap_perc);
+   }
+
+   const char *
+   battery_state(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       int state;
+       size_t len;
+
+       len = sizeof(state);
+       if (sysctlbyname(BATTERY_STATE, &state, &len, NULL, 0) < 0 || !len)
+           return NULL;
+
+       switch (state) {
+       case 0: /* FALLTHROUGH */
+       case 2:
+           return "+";
+       case 1:
+           return "-";
+       default:
+           return "?";
+       }
+   }
+
+   const char *
+   battery_remaining(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       int rem;
+       size_t len;
+
+       len = sizeof(rem);
+       if (sysctlbyname(BATTERY_TIME, &rem, &len, NULL, 0) < 0 || !len
+           || rem < 0)
+           return NULL;
+
+       return bprintf(buf, "%uh %02um", rem / 60, rem % 60);
+   }
+#endif
diff --git a/sta/components/cpu.c b/sta/components/cpu.c
new file mode 100644
index 0000000..f95759a
--- /dev/null
+++ b/sta/components/cpu.c
@@ -0,0 +1,162 @@
+/* See LICENSE file for copyright and license details. */
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "../util.h"
+
+#if defined(__linux__)
+   #define CPU_FREQ "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"
+
+   const char *
+   cpu_freq(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       uintmax_t freq;
+
+       /* in kHz */
+       if (pscanf(buf, CPU_FREQ, "%ju", &freq) != 1)
+           return NULL;
+
+       return fmt_human(buf, freq * 1000, 1000);
+   }
+
+   const char *
+   cpu_perc(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       static long double a[7];
+       long double b[7], sum;
+
+       memcpy(b, a, sizeof(b));
+       /* cpu user nice system idle iowait irq softirq */
+       if (pscanf(buf, "/proc/stat", "%*s %Lf %Lf %Lf %Lf %Lf %Lf %Lf",
+                  &a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6])
+           != 7)
+           return NULL;
+
+       if (b[0] == 0)
+           return NULL;
+
+       sum = (b[0] + b[1] + b[2] + b[3] + b[4] + b[5] + b[6]) -
+             (a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6]);
+
+       if (sum == 0)
+           return NULL;
+
+       return bprintf(buf, "%d", (int)(100 *
+                      ((b[0] + b[1] + b[2] + b[5] + b[6]) -
+                       (a[0] + a[1] + a[2] + a[5] + a[6])) / sum));
+   }
+#elif defined(__OpenBSD__)
+   #include <sys/param.h>
+   #include <sys/sched.h>
+   #include <sys/sysctl.h>
+
+   const char *
+   cpu_freq(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       int freq, mib[2];
+       size_t size;
+
+       mib[0] = CTL_HW;
+       mib[1] = HW_CPUSPEED;
+
+       size = sizeof(freq);
+
+       /* in MHz */
+       if (sysctl(mib, 2, &freq, &size, NULL, 0) < 0) {
+           warn("sysctl 'HW_CPUSPEED':");
+           return NULL;
+       }
+
+       return fmt_human(buf, freq * 1E6, 1000);
+   }
+
+   const char *
+   cpu_perc(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       int mib[2];
+       static uintmax_t a[CPUSTATES];
+       uintmax_t b[CPUSTATES], sum;
+       size_t size;
+
+       mib[0] = CTL_KERN;
+       mib[1] = KERN_CPTIME;
+
+       size = sizeof(a);
+
+       memcpy(b, a, sizeof(b));
+       if (sysctl(mib, 2, &a, &size, NULL, 0) < 0) {
+           warn("sysctl 'KERN_CPTIME':");
+           return NULL;
+       }
+       if (b[0] == 0)
+           return NULL;
+
+       sum = (a[CP_USER] + a[CP_NICE] + a[CP_SYS] + a[CP_INTR] + a[CP_IDLE]) -
+             (b[CP_USER] + b[CP_NICE] + b[CP_SYS] + b[CP_INTR] + b[CP_IDLE]);
+
+       if (sum == 0)
+           return NULL;
+
+       return bprintf(buf, "%d", 100 *
+                      ((a[CP_USER] + a[CP_NICE] + a[CP_SYS] +
+                        a[CP_INTR]) -
+                       (b[CP_USER] + b[CP_NICE] + b[CP_SYS] +
+                        b[CP_INTR])) / sum);
+   }
+#elif defined(__FreeBSD__)
+   #include <devstat.h>
+   #include <sys/param.h>
+   #include <sys/sysctl.h>
+
+   const char *
+   cpu_freq(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       int freq;
+       size_t size;
+
+       size = sizeof(freq);
+       /* in MHz */
+       if (sysctlbyname("hw.clockrate", &freq, &size, NULL, 0) < 0 || !size) {
+           warn("sysctlbyname 'hw.clockrate':");
+           return NULL;
+       }
+
+       return fmt_human(buf, freq * 1E6, 1000);
+   }
+
+   const char *
+   cpu_perc(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       size_t size;
+       static long a[CPUSTATES];
+       long b[CPUSTATES], sum;
+
+       size = sizeof(a);
+       memcpy(b, a, sizeof(b));
+       if (sysctlbyname("kern.cp_time", &a, &size, NULL, 0) < 0 || !size) {
+           warn("sysctlbyname 'kern.cp_time':");
+           return NULL;
+       }
+       if (b[0] == 0)
+           return NULL;
+
+       sum = (a[CP_USER] + a[CP_NICE] + a[CP_SYS] + a[CP_INTR] + a[CP_IDLE]) -
+             (b[CP_USER] + b[CP_NICE] + b[CP_SYS] + b[CP_INTR] + b[CP_IDLE]);
+
+       if (sum == 0)
+           return NULL;
+
+       return bprintf(buf, "%d", 100 *
+                      ((a[CP_USER] + a[CP_NICE] + a[CP_SYS] +
+                        a[CP_INTR]) -
+                       (b[CP_USER] + b[CP_NICE] + b[CP_SYS] +
+                        b[CP_INTR])) / sum);
+   }
+#endif
diff --git a/sta/components/datetime.c b/sta/components/datetime.c
new file mode 100644
index 0000000..b06ece2
--- /dev/null
+++ b/sta/components/datetime.c
@@ -0,0 +1,20 @@
+/* See LICENSE file for copyright and license details. */
+#include <stdio.h>
+#include <time.h>
+
+#include "../util.h"
+
+const char *
+datetime(const char *fmt)
+{
+   static _Thread_local char buf[1024];
+   time_t t;
+
+   t = time(NULL);
+   if (!strftime(buf, sizeof(buf), fmt, localtime(&t))) {
+       warn("strftime: Result string exceeds buffer size");
+       return NULL;
+   }
+
+   return buf;
+}
diff --git a/sta/components/disk.c b/sta/components/disk.c
new file mode 100644
index 0000000..3d2028a
--- /dev/null
+++ b/sta/components/disk.c
@@ -0,0 +1,62 @@
+/* See LICENSE file for copyright and license details. */
+#include <stdio.h>
+#include <sys/statvfs.h>
+
+#include "../util.h"
+
+const char *
+disk_free(const char *path)
+{
+   static _Thread_local char buf[1024];
+   struct statvfs fs;
+
+   if (statvfs(path, &fs) < 0) {
+       warn("statvfs '%s':", path);
+       return NULL;
+   }
+
+   return fmt_human(buf, fs.f_frsize * fs.f_bavail, 1024);
+}
+
+const char *
+disk_perc(const char *path)
+{
+   static _Thread_local char buf[1024];
+   struct statvfs fs;
+
+   if (statvfs(path, &fs) < 0) {
+       warn("statvfs '%s':", path);
+       return NULL;
+   }
+
+   return bprintf(buf, "%d", (int)(100 *
+                  (1 - ((double)fs.f_bavail / (double)fs.f_blocks))));
+}
+
+const char *
+disk_total(const char *path)
+{
+   static _Thread_local char buf[1024];
+   struct statvfs fs;
+
+   if (statvfs(path, &fs) < 0) {
+       warn("statvfs '%s':", path);
+       return NULL;
+   }
+
+   return fmt_human(buf, fs.f_frsize * fs.f_blocks, 1024);
+}
+
+const char *
+disk_used(const char *path)
+{
+   static _Thread_local char buf[1024];
+   struct statvfs fs;
+
+   if (statvfs(path, &fs) < 0) {
+       warn("statvfs '%s':", path);
+       return NULL;
+   }
+
+   return fmt_human(buf, fs.f_frsize * (fs.f_blocks - fs.f_bfree), 1024);
+}
diff --git a/sta/components/ram.c b/sta/components/ram.c
new file mode 100644
index 0000000..4fe2752
--- /dev/null
+++ b/sta/components/ram.c
@@ -0,0 +1,220 @@
+/* See LICENSE file for copyright and license details. */
+#include <stdio.h>
+
+#include "../util.h"
+
+#if defined(__linux__)
+   #include <stdint.h>
+
+   const char *
+   ram_free(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       uintmax_t free;
+
+       if (pscanf(buf, "/proc/meminfo",
+                  "MemTotal: %ju kB\n"
+                  "MemFree: %ju kB\n"
+                  "MemAvailable: %ju kB\n",
+                  &free, &free, &free) != 3)
+           return NULL;
+
+       return fmt_human(buf, free * 1024, 1024);
+   }
+
+   const char *
+   ram_perc(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       uintmax_t total, free, buffers, cached;
+       int percent;
+
+       if (pscanf(buf, "/proc/meminfo",
+                  "MemTotal: %ju kB\n"
+                  "MemFree: %ju kB\n"
+                  "MemAvailable: %ju kB\n"
+                  "Buffers: %ju kB\n"
+                  "Cached: %ju kB\n",
+                  &total, &free, &buffers, &buffers, &cached) != 5)
+           return NULL;
+
+       if (total == 0)
+           return NULL;
+
+       percent = 100 * ((total - free) - (buffers + cached)) / total;
+       return bprintf(buf, "%d", percent);
+   }
+
+   const char *
+   ram_total(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       uintmax_t total;
+
+       if (pscanf(buf, "/proc/meminfo", "MemTotal: %ju kB\n", &total)
+           != 1)
+           return NULL;
+
+       return fmt_human(buf, total * 1024, 1024);
+   }
+
+   const char *
+   ram_used(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       uintmax_t total, free, buffers, cached, used;
+
+       if (pscanf(buf, "/proc/meminfo",
+                  "MemTotal: %ju kB\n"
+                  "MemFree: %ju kB\n"
+                  "MemAvailable: %ju kB\n"
+                  "Buffers: %ju kB\n"
+                  "Cached: %ju kB\n",
+                  &total, &free, &buffers, &buffers, &cached) != 5)
+           return NULL;
+
+       used = (total - free - buffers - cached);
+       return fmt_human(buf, used * 1024, 1024);
+   }
+#elif defined(__OpenBSD__)
+   #include <stdlib.h>
+   #include <sys/sysctl.h>
+   #include <sys/types.h>
+   #include <unistd.h>
+
+   #define LOG1024 10
+   #define pagetok(size, pageshift) (size_t)(size << (pageshift - LOG1024))
+
+   inline int
+   load_uvmexp(struct uvmexp *uvmexp)
+   {
+   static _Thread_local char buf[1024];
+       int uvmexp_mib[] = {CTL_VM, VM_UVMEXP};
+       size_t size;
+
+       size = sizeof(*uvmexp);
+
+       if (sysctl(uvmexp_mib, 2, uvmexp, &size, NULL, 0) >= 0)
+           return 1;
+
+       return 0;
+   }
+
+   const char *
+   ram_free(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       struct uvmexp uvmexp;
+       int free_pages;
+
+       if (!load_uvmexp(&uvmexp))
+           return NULL;
+
+       free_pages = uvmexp.npages - uvmexp.active;
+       return fmt_human(buf, pagetok(free_pages, uvmexp.pageshift) *
+                1024, 1024);
+   }
+
+   const char *
+   ram_perc(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       struct uvmexp uvmexp;
+       int percent;
+
+       if (!load_uvmexp(&uvmexp))
+           return NULL;
+
+       percent = uvmexp.active * 100 / uvmexp.npages;
+       return bprintf(buf, "%d", percent);
+   }
+
+   const char *
+   ram_total(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       struct uvmexp uvmexp;
+
+       if (!load_uvmexp(&uvmexp))
+           return NULL;
+
+       return fmt_human(buf, pagetok(uvmexp.npages,
+                    uvmexp.pageshift) * 1024, 1024);
+   }
+
+   const char *
+   ram_used(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       struct uvmexp uvmexp;
+
+       if (!load_uvmexp(&uvmexp))
+           return NULL;
+
+       return fmt_human(buf, pagetok(uvmexp.active,
+                    uvmexp.pageshift) * 1024, 1024);
+   }
+#elif defined(__FreeBSD__)
+   #include <sys/sysctl.h>
+   #include <sys/vmmeter.h>
+   #include <unistd.h>
+   #include <vm/vm_param.h>
+
+   const char *
+   ram_free(const char *unused) {
+       struct vmtotal vm_stats;
+       int mib[] = {CTL_VM, VM_TOTAL};
+       size_t len;
+
+       len = sizeof(struct vmtotal);
+       if (sysctl(mib, 2, &vm_stats, &len, NULL, 0) < 0
+           || !len)
+           return NULL;
+
+       return fmt_human(buf, vm_stats.t_free * getpagesize(), 1024);
+   }
+
+   const char *
+   ram_total(const char *unused) {
+       unsigned int npages;
+       size_t len;
+
+       len = sizeof(npages);
+       if (sysctlbyname("vm.stats.vm.v_page_count",
+                        &npages, &len, NULL, 0) < 0 || !len)
+           return NULL;
+
+       return fmt_human(buf, npages * getpagesize(), 1024);
+   }
+
+   const char *
+   ram_perc(const char *unused) {
+       unsigned int npages;
+       unsigned int active;
+       size_t len;
+
+       len = sizeof(npages);
+       if (sysctlbyname("vm.stats.vm.v_page_count",
+                        &npages, &len, NULL, 0) < 0 || !len)
+           return NULL;
+
+       if (sysctlbyname("vm.stats.vm.v_active_count",
+                        &active, &len, NULL, 0) < 0 || !len)
+           return NULL;
+
+       return bprintf(buf, "%d", active * 100 / npages);
+   }
+
+   const char *
+   ram_used(const char *unused) {
+       unsigned int active;
+       size_t len;
+
+       len = sizeof(active);
+       if (sysctlbyname("vm.stats.vm.v_active_count",
+                        &active, &len, NULL, 0) < 0 || !len)
+           return NULL;
+
+       return fmt_human(buf, active * getpagesize(), 1024);
+   }
+#endif
diff --git a/sta/components/run_command.c b/sta/components/run_command.c
new file mode 100644
index 0000000..b9fc3a2
--- /dev/null
+++ b/sta/components/run_command.c
@@ -0,0 +1,29 @@
+/* See LICENSE file for copyright and license details. */
+#include <stdio.h>
+#include <string.h>
+
+const char *
+run_command(const char *cmd)
+{
+   static _Thread_local char buf[1024];
+   char *p;
+   FILE *fp;
+
+   if (!(fp = popen(cmd, "r"))) {
+       fprintf(stderr,"error '%s':", cmd);
+       return "";
+   }
+
+   p = fgets(buf, sizeof(buf) - 1, fp);
+   if (pclose(fp) < 0) {
+       fprintf(stderr,"pclose '%s':", cmd);
+       return "";
+   }
+   if (!p)
+       return "";
+
+   if ((p = strrchr(buf, '\n')))
+       p[0] = '\0';
+
+   return buf[0] ? buf : "";
+}
diff --git a/sta/components/temperature.c b/sta/components/temperature.c
new file mode 100644
index 0000000..9d9e45d
--- /dev/null
+++ b/sta/components/temperature.c
@@ -0,0 +1,75 @@
+/* See LICENSE file for copyright and license details. */
+#include <stddef.h>
+
+#include "../util.h"
+
+
+#if defined(__linux__)
+   #include <stdint.h>
+
+   const char *
+   temp(const char *file)
+   {
+   static _Thread_local char buf[1024];
+       uintmax_t temp;
+
+       if (pscanf(buf, file, "%ju", &temp) != 1)
+           return NULL;
+
+       return bprintf(buf, "%ju", temp / 1000);
+   }
+#elif defined(__OpenBSD__)
+   #include <stdio.h>
+   #include <sys/time.h> /* before <sys/sensors.h> for struct timeval */
+   #include <sys/sensors.h>
+   #include <sys/sysctl.h>
+
+   const char *
+   temp(const char *unused)
+   {
+   static _Thread_local char buf[1024];
+       int mib[5];
+       size_t size;
+       struct sensor temp;
+
+       mib[0] = CTL_HW;
+       mib[1] = HW_SENSORS;
+       mib[2] = 0; /* cpu0 */
+       mib[3] = SENSOR_TEMP;
+       mib[4] = 0; /* temp0 */
+
+       size = sizeof(temp);
+
+       if (sysctl(mib, 5, &temp, &size, NULL, 0) < 0) {
+           warn("sysctl 'SENSOR_TEMP':");
+           return NULL;
+       }
+
+       /* kelvin to celsius */
+       return bprintf(buf, "%d", (int)((float)(temp.value-273150000) / 1E6));
+   }
+#elif defined(__FreeBSD__)
+   #include <stdio.h>
+   #include <stdlib.h>
+   #include <sys/sysctl.h>
+
+   #define ACPI_TEMP "hw.acpi.thermal.%s.temperature"
+
+   const char *
+   temp(const char *zone)
+   {
+   static _Thread_local char buf[1024];
+       char buf[256];
+       int temp;
+       size_t len;
+
+       len = sizeof(temp);
+       snprintf(buf, sizeof(buf), ACPI_TEMP, zone);
+       if (sysctlbyname(buf, &temp, &len, NULL, 0) < 0
+               || !len)
+           return NULL;
+
+       /* kelvin to decimal celcius */
+       return bprintf(buf, "%d.%d", (temp - 2731) / 10, abs((temp - 2731) % 10));
+   }
+#endif
diff --git a/sta/components/util.c b/sta/components/util.c
new file mode 100644
index 0000000..9524d85
--- /dev/null
+++ b/sta/components/util.c
@@ -0,0 +1,146 @@
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "../util.h"
+
+char *argv0;
+
+static void
+verr(const char *fmt, va_list ap)
+{
+   vfprintf(stderr, fmt, ap);
+
+   if (fmt[0] && fmt[strlen(fmt) - 1] == ':') {
+       fputc(' ', stderr);
+       perror(NULL);
+   } else {
+       fputc('\n', stderr);
+   }
+}
+
+void
+warn(const char *fmt, ...)
+{
+   
+   va_list ap;
+
+   va_start(ap, fmt);
+   verr(fmt, ap);
+   va_end(ap);
+}
+
+void
+die(const char *fmt, ...)
+{
+   
+   va_list ap;
+
+   va_start(ap, fmt);
+   verr(fmt, ap);
+   va_end(ap);
+
+   exit(1);
+}
+
+static int
+evsnprintf(char *str, size_t size, const char *fmt, va_list ap)
+{
+   
+   int ret;
+
+   ret = vsnprintf(str, size, fmt, ap);
+
+   if (ret < 0) {
+       warn("vsnprintf:");
+       return -1;
+   } else if ((size_t)ret >= size) {
+       warn("vsnprintf: Output truncated");
+       return -1;
+   }
+
+   return ret;
+}
+
+int 
+esnprintf(const char *buf, char *str, size_t size, const char *fmt, ...)
+{
+   
+   va_list ap;
+   int ret;
+
+   va_start(ap, fmt);
+   ret = evsnprintf(str, size, fmt, ap);
+   va_end(ap);
+
+   return ret;
+}
+
+char *
+bprintf(const char *buf, const char *fmt, ...)
+{
+    va_list ap;
+    int ret;
+
+    va_start(ap, fmt);
+    ret = evsnprintf(buf, sizeof(buf), fmt, ap);
+    va_end(ap);
+
+    return (ret < 0) ? NULL : buf;
+}
+
+const char *
+fmt_human(const char *buf, uintmax_t num, int base)
+{
+   
+   double scaled;
+   size_t i, prefixlen;
+   const char **prefix;
+   const char *prefix_1000[] = { "", "k", "M", "G", "T", "P", "E", "Z",
+                                 "Y" };
+   const char *prefix_1024[] = { "", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei",
+                                 "Zi", "Yi" };
+
+   switch (base) {
+   case 1000:
+       prefix = prefix_1000;
+       prefixlen = LEN(prefix_1000);
+       break;
+   case 1024:
+       prefix = prefix_1024;
+       prefixlen = LEN(prefix_1024);
+       break;
+   default:
+       warn("fmt_human: Invalid base");
+       return NULL;
+   }
+
+   scaled = num;
+   for (i = 0; i < prefixlen && scaled >= base; i++)
+       scaled /= base;
+
+   return bprintf(buf, "%.1f %s", scaled, prefix[i]);
+}
+
+int
+pscanf(const char *buf, const char *path, const char *fmt, ...)
+{
+   
+   FILE *fp;
+   va_list ap;
+   int n;
+
+   if (!(fp = fopen(path, "r"))) {
+       warn("fopen '%s':", path);
+       return -1;
+   }
+   va_start(ap, fmt);
+   n = vfscanf(fp, fmt, ap);
+   va_end(ap);
+   fclose(fp);
+
+   return (n == EOF) ? -1 : n;
+}
+
diff --git a/sta/components/wifi.c b/sta/components/wifi.c
new file mode 100644
index 0000000..5808175
--- /dev/null
+++ b/sta/components/wifi.c
@@ -0,0 +1,275 @@
+/* See LICENSE file for copyright and license details. */
+#include <ifaddrs.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include "../util.h"
+
+#define RSSI_TO_PERC(rssi) \
+           rssi >= -50 ? 100 : \
+           (rssi <= -100 ? 0 : \
+           (2 * (rssi + 100)))
+
+#if defined(__linux__)
+   #include <limits.h>
+   #include <linux/wireless.h>
+
+   #define NET_OPERSTATE "/sys/class/net/%s/operstate"
+
+   const char *
+   wifi_perc(const char *interface)
+   {
+   static _Thread_local char buf[1024];
+       int cur;
+       size_t i;
+       char *p, *datastart;
+       char path[PATH_MAX];
+       char status[5];
+       FILE *fp;
+
+       if (esnprintf(buf, path, sizeof(path), NET_OPERSTATE, interface) < 0)
+           return NULL;
+       if (!(fp = fopen(path, "r"))) {
+           warn("fopen '%s':", path);
+           return NULL;
+       }
+       p = fgets(status, 5, fp);
+       fclose(fp);
+       if (!p || strcmp(status, "up\n") != 0)
+           return NULL;
+
+       if (!(fp = fopen("/proc/net/wireless", "r"))) {
+           warn("fopen '/proc/net/wireless':");
+           return NULL;
+       }
+
+       for (i = 0; i < 3; i++)
+           if (!(p = fgets(buf, sizeof(buf) - 1, fp)))
+               break;
+
+       fclose(fp);
+       if (i < 2 || !p)
+           return NULL;
+
+       if (!(datastart = strstr(buf, interface)))
+           return NULL;
+
+       datastart = (datastart+(strlen(interface)+1));
+       sscanf(datastart + 1, " %*d   %d  %*d  %*d\t\t  %*d\t   "
+              "%*d\t\t%*d\t\t %*d\t  %*d\t\t %*d", &cur);
+
+       /* 70 is the max of /proc/net/wireless */
+       return bprintf(buf, "%d", (int)((float)cur / 70 * 100));
+   }
+
+   const char *
+   wifi_essid(const char *interface)
+   {
+   static _Thread_local char buf[1024];
+       static char id[IW_ESSID_MAX_SIZE+1];
+       int sockfd;
+       struct iwreq wreq;
+
+       memset(&wreq, 0, sizeof(struct iwreq));
+       wreq.u.essid.length = IW_ESSID_MAX_SIZE+1;
+       if (esnprintf(buf, wreq.ifr_name, sizeof(wreq.ifr_name), "%s",
+                     interface) < 0)
+           return NULL;
+
+       if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+           warn("socket 'AF_INET':");
+           return NULL;
+       }
+       wreq.u.essid.pointer = id;
+       if (ioctl(sockfd,SIOCGIWESSID, &wreq) < 0) {
+           warn("ioctl 'SIOCGIWESSID':");
+           close(sockfd);
+           return NULL;
+       }
+
+       close(sockfd);
+
+       if (!strcmp(id, ""))
+           return NULL;
+
+       return id;
+   }
+#elif defined(__OpenBSD__)
+   #include <net/if.h>
+   #include <net/if_media.h>
+   #include <net80211/ieee80211.h>
+   #include <sys/select.h> /* before <sys/ieee80211_ioctl.h> for NBBY */
+   #include <net80211/ieee80211_ioctl.h>
+   #include <stdlib.h>
+   #include <sys/types.h>
+
+   static int
+   load_ieee80211_nodereq(const char *interface, struct ieee80211_nodereq *nr)
+   {
+   static _Thread_local char buf[1024];
+       struct ieee80211_bssid bssid;
+       int sockfd;
+       uint8_t zero_bssid[IEEE80211_ADDR_LEN];
+
+       memset(&bssid, 0, sizeof(bssid));
+       memset(nr, 0, sizeof(struct ieee80211_nodereq));
+       if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+           warn("socket 'AF_INET':");
+           return 0;
+       }
+       strlcpy(bssid.i_name, interface, sizeof(bssid.i_name));
+       if ((ioctl(sockfd, SIOCG80211BSSID, &bssid)) < 0) {
+           warn("ioctl 'SIOCG80211BSSID':");
+           close(sockfd);
+           return 0;
+       }
+       memset(&zero_bssid, 0, sizeof(zero_bssid));
+       if (memcmp(bssid.i_bssid, zero_bssid,
+           IEEE80211_ADDR_LEN) == 0) {
+           close(sockfd);
+           return 0;
+       }
+       strlcpy(nr->nr_ifname, interface, sizeof(nr->nr_ifname));
+       memcpy(&nr->nr_macaddr, bssid.i_bssid, sizeof(nr->nr_macaddr));
+       if ((ioctl(sockfd, SIOCG80211NODE, nr)) < 0 && nr->nr_rssi) {
+           warn("ioctl 'SIOCG80211NODE':");
+           close(sockfd);
+           return 0;
+       }
+
+       return close(sockfd), 1;
+   }
+
+   const char *
+   wifi_perc(const char *interface)
+   {
+   static _Thread_local char buf[1024];
+       struct ieee80211_nodereq nr;
+       int q;
+
+       if (load_ieee80211_nodereq(interface, &nr)) {
+           if (nr.nr_max_rssi)
+               q = IEEE80211_NODEREQ_RSSI(&nr);
+           else
+               q = RSSI_TO_PERC(nr.nr_rssi);
+
+           return bprintf(buf, "%d", q);
+       }
+
+       return NULL;
+   }
+
+   const char *
+   wifi_essid(const char *interface)
+   {
+   static _Thread_local char buf[1024];
+       struct ieee80211_nodereq nr;
+
+       if (load_ieee80211_nodereq(interface, &nr))
+           return bprintf(buf, "%s", nr.nr_nwid);
+
+       return NULL;
+   }
+#elif defined(__FreeBSD__)
+   #include <net/if.h>
+   #include <net80211/ieee80211_ioctl.h>
+
+   int
+   load_ieee80211req(int sock, const char *interface, void *data, int type, size_t *len)
+   {
+   static _Thread_local char buf[1024];
+       char warn_buf[256];
+       struct ieee80211req ireq;
+       memset(&ireq, 0, sizeof(ireq));
+       ireq.i_type = type;
+       ireq.i_data = (caddr_t) data;
+       ireq.i_len = *len;
+
+       strlcpy(ireq.i_name, interface, sizeof(ireq.i_name));
+       if (ioctl(sock, SIOCG80211, &ireq) < 0) {
+           snprintf(warn_buf,  sizeof(warn_buf),
+                   "ioctl: 'SIOCG80211': %d", type);
+           warn(warn_buf);
+           return 0;
+       }
+
+       *len = ireq.i_len;
+       return 1;
+   }
+
+   const char *
+   wifi_perc(const char *interface)
+   {
+   static _Thread_local char buf[1024];
+       union {
+           struct ieee80211req_sta_req sta;
+           uint8_t buf[24 * 1024];
+       } info;
+       uint8_t bssid[IEEE80211_ADDR_LEN];
+       int rssi_dbm;
+       int sockfd;
+       size_t len;
+       const char *fmt;
+
+       if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+           warn("socket 'AF_INET':");
+           return NULL;
+       }
+
+       /* Retreive MAC address of interface */
+       len = IEEE80211_ADDR_LEN;
+       fmt = NULL;
+       if (load_ieee80211req(sockfd, interface, &bssid, IEEE80211_IOC_BSSID, &len))
+       {
+   static _Thread_local char buf[1024];
+           /* Retrieve info on station with above BSSID */
+           memset(&info, 0, sizeof(info));
+           memcpy(info.sta.is_u.macaddr, bssid, sizeof(bssid));
+
+           len = sizeof(info);
+           if (load_ieee80211req(sockfd, interface, &info, IEEE80211_IOC_STA_INFO, &len)) {
+               rssi_dbm = info.sta.info[0].isi_noise +
+                            info.sta.info[0].isi_rssi / 2;
+
+               fmt = bprintf(buf, "%d", RSSI_TO_PERC(rssi_dbm));
+           }
+       }
+
+       close(sockfd);
+       return fmt;
+   }
+
+   const char *
+   wifi_essid(const char *interface)
+   {
+   static _Thread_local char buf[1024];
+       char ssid[IEEE80211_NWID_LEN + 1];
+       size_t len;
+       int sockfd;
+       const char *fmt;
+
+       if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+           warn("socket 'AF_INET':");
+           return NULL;
+       }
+
+       fmt = NULL;
+       len = sizeof(ssid);
+       memset(&ssid, 0, len);
+       if (load_ieee80211req(sockfd, interface, &ssid, IEEE80211_IOC_SSID, &len)) {
+           if (len < sizeof(ssid))
+               len += 1;
+           else
+               len = sizeof(ssid);
+
+           ssid[len - 1] = '\0';
+           fmt = bprintf(buf, "%s", ssid);
+       }
+
+       close(sockfd);
+       return fmt;
+   }
+#endif
diff --git a/sta/config.def.h b/sta/config.def.h
new file mode 100644
index 0000000..7fe84e6
--- /dev/null
+++ b/sta/config.def.h
@@ -0,0 +1,21 @@
+/*
+ * if delay = 0: it will run ones and stop, so you need to  send signle to update it 
+ * id is a unique number that lets u edit the specifice command
+ *
+ *
+ */
+
+static const Args commands[] = {
+   // format     command      id             delay
+   {run_command  , " %s "     , "date +%H:%M", 1, 60*1000},
+   {run_command  , " %s                              ", "date +'%b %d'", 2, 60*1000},
+   {battery_state, " %s "     , "BAT1", 3, 1000},
+   {battery_perc , "   %s% │", "BAT1", 4, 60*2000},
+   {run_command  , "   %s │", "brightnessctl | grep Current | awk '{print $4}' | tr -d '()'", 5, 0},
+   {run_command  , "   %s │" , "pactl get-sink-volume @DEFAULT_SINK@ | awk '{print $5}' | head -n1", 6, 0},
+   {cpu_perc     , "  %s% /" , NULL, 7, 1000},
+   {temp         , "  %s󰔄 │" , "/sys/class/thermal/thermal_zone3/temp", 8, 1000},
+   {ram_used     , "   %s │" , NULL, 9, 1000},
+   {disk_perc    , "   %s% │", "/home/", 10, 60*1000},
+   {wifi_essid   , "   %s │" , "wlan0", 11, 60*1000},
+};
diff --git a/sta/sta.c b/sta/sta.c
new file mode 100644
index 0000000..a69c75d
--- /dev/null
+++ b/sta/sta.c
@@ -0,0 +1,256 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <string.h>
+#include <signal.h>
+#include <errno.h>
+
+#define SOCKET_PATH "/tmp/sta.sock"
+
+typedef struct{
+   const char *(*func)(const char *);
+   char *fmt;
+   char *parm;
+   int id;
+   int delay;
+}Args;
+
+#include "util.h"
+#include "config.h"
+
+pthread_mutex_t list_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+typedef struct {
+   int id;
+   char *name;
+} Pro;
+
+typedef struct {
+   Pro *process;
+   int count;
+} Pros;
+
+typedef struct {
+   int id2;
+   Pros *list;
+} Potato;
+
+Pros *init()
+{
+   Pros *list = malloc(sizeof(Pros));
+   list->process = malloc(sizeof(Pro));
+   list->count = 0;
+   return list;
+}
+
+void add_pro(Pros *list, int id, char *name)
+{
+   for (int i = 0; i < list->count; ++i) {
+       if (id == list->process[i].id) {
+           free(list->process[i].name);
+           list->process[i].name = strdup(name);
+           return;
+       }
+   }
+   list->count++;
+   list->process = realloc(list->process, sizeof(Pro) * list->count);
+   if (!list->process) {
+       warn("Memory", "memory allocation failed.");
+       exit(1);
+   }
+   list->process[list->count - 1].name = strdup(name);
+   list->process[list->count - 1].id = id;
+}
+
+void show_pros(Pros *list)
+{
+   for (int i = 0; i < list->count - 1; i++) {
+       for (int j = i + 1; j < list->count; j++) {
+           if (list->process[i].id > list->process[j].id) {
+               Pro temp = list->process[i];
+               list->process[i] = list->process[j];
+               list->process[j] = temp;
+           }
+       }
+   }
+   for (int a = 0; a < list->count; ++a)
+       printf("%s", list->process[a].name);
+   printf("\n");
+   fflush(stdout);
+}
+
+void usage()
+{
+   printf("Usage:\n");
+   printf("\t-id        <number>       => process id (id >= 1)\n");
+   printf("\t-name      <string>       => process name\n");
+   printf("\t-h -help                  => print this help menu\n");
+   exit(1);
+}
+
+static char *fmt_cmd(const char *cmd, char *fmt)
+{
+   char *buf = malloc(512);
+   snprintf(buf, 512, fmt, cmd);
+   return buf;
+}
+
+void append(Args *command, Pros *list)
+{
+   const char *cmd = command->func(command->parm);
+   if (!cmd) cmd = "N/A";
+   char *tmp = fmt_cmd(cmd, command->fmt);
+   add_pro(list, command->id, tmp);
+   free(tmp);
+   show_pros(list);
+}
+
+void clean_up(int s)
+{
+   (void)s;
+   unlink(SOCKET_PATH);
+   exit(0);
+}
+
+void *worker(void *arg)
+{
+   Potato *data = arg;
+   Args command = commands[data->id2];
+   while (1) {
+       pthread_mutex_lock(&list_mutex);
+       append(&command, data->list);
+       pthread_mutex_unlock(&list_mutex);
+       usleep(command.delay * 1000);
+   }
+   return NULL;
+}
+
+void run_server(struct sockaddr_un *addr, int sock, Pros *list)
+{
+   signal(SIGTERM, clean_up);
+   signal(SIGINT, clean_up);
+   unlink(SOCKET_PATH);
+
+   int cmds = sizeof(commands) / sizeof(commands[0]);
+   pthread_t tids[cmds];
+   for (int i = 0; i < cmds; ++i) {
+       if (commands[i].delay) {
+           Potato *info = malloc(sizeof(Potato));
+           info->list = list;
+           info->id2 = i;
+           pthread_create(&tids[i], NULL, worker, info);
+       } else {
+           append(&commands[i], list);
+       }
+   }
+
+   if (bind(sock, (struct sockaddr *)addr, sizeof(*addr)) < 0)
+       warn("Bind", "failed: %s", strerror(errno));
+
+   if (listen(sock, 5) < 0)
+       warn("Listen", "failed: %s", strerror(errno));
+
+   while (1) {
+       int client = accept(sock, NULL, NULL);
+       if (client < 0) continue;
+
+       char buf[256], name[256];
+       int n, id;
+
+       while ((n = recv(client, buf, sizeof(buf) - 1, 0)) > 0) {
+           buf[n] = '\0';
+           char *s = strstr(buf, "|+|");
+           if (s) {
+               *s = '\0';
+               id = atoi(buf);
+               strncpy(name, s + 3, sizeof(name) - 1);
+               name[sizeof(name) - 1] = '\0';
+               add_pro(list, id, name);
+               show_pros(list);
+           }
+       }
+       close(client);
+   }
+}
+
+void run_client(int argc, char const *argv[], struct sockaddr_un *addr, int sock)
+{
+   int id = -1;
+   char *name = NULL;
+   char buf[256];
+
+   for (int i = 1; i < argc; i++) {
+       if (!strcmp("-h", argv[i]) || !strcmp("-help", argv[i]))
+           usage();
+       if (!strcmp("-id", argv[i]) && i + 1 < argc)
+           id = atoi(argv[++i]);
+       else if (!strcmp("-name", argv[i]) && i + 1 < argc)
+           name = (char *)argv[++i];
+   }
+
+   if (id <= 0)
+       usage();
+
+   if (name) {
+       snprintf(buf, sizeof(buf), "%d|+|%s", id, name);
+   } else {
+       buf[0] = '\0';
+       for (int i = 0; i < (int)(sizeof(commands) / sizeof(commands[0])); ++i) {
+           if (id == commands[i].id) {
+               const char *cmd = commands[i].func(commands[i].parm);
+               if (!cmd) cmd = "N/A";
+               char *tmp = fmt_cmd(cmd, commands[i].fmt);
+               snprintf(buf, sizeof(buf), "%d|+|%s", id, tmp);
+               free(tmp);
+               break;
+           }
+       }
+       if (buf[0] == '\0') {
+           warn("client", "no command found for id %d", id);
+           return;
+       }
+   }
+
+   if (connect(sock, (struct sockaddr *)addr, sizeof(*addr)) < 0) {
+       warn("Connect", "failed: %s", strerror(errno));
+       return;
+   }
+   write(sock, buf, strlen(buf));
+}
+
+int main(int argc, char const *argv[])
+{
+   struct sockaddr_un addr = {0};
+   addr.sun_family = AF_UNIX;
+   strcpy(addr.sun_path, SOCKET_PATH);
+
+   int sock = socket(AF_UNIX, SOCK_STREAM, 0);
+   if (sock < 0)
+       warn("Socket", "failed to create socket: %s", strerror(errno));
+
+   Pros *list = init();
+
+   for (int i = 1; i < argc; ++i) {
+       if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--server")) {
+           if (access(SOCKET_PATH, F_OK) == 0){
+               if ( connect(sock, (struct sockaddr *)&addr, sizeof(addr) ) == 0 )
+                   unlink(SOCKET_PATH);
+               else
+                   die("ERROR: socket exists in " SOCKET_PATH);
+           }
+           run_server(&addr, sock, list);
+       }
+   }
+
+   if (access(SOCKET_PATH, F_OK) == 0) {
+       run_client(argc, argv, &addr, sock);
+   } else {
+       die("ERROR: server not running (no socket at " SOCKET_PATH ")");
+   }
+
+   close(sock);
+   return 0;
+}
diff --git a/sta/util.h b/sta/util.h
new file mode 100644
index 0000000..b26f07d
--- /dev/null
+++ b/sta/util.h
@@ -0,0 +1,99 @@
+#include <stdint.h>
+
+
+/* battery */
+const char *battery_perc(const char *);
+const char *battery_remaining(const char *);
+const char *battery_state(const char *);
+
+/* cat */
+const char *cat(const char *path);
+
+/* cpu */
+const char *cpu_freq(const char *unused);
+const char *cpu_perc(const char *unused);
+
+/* datetime */
+const char *datetime(const char *fmt);
+
+/* disk */
+const char *disk_free(const char *path);
+const char *disk_perc(const char *path);
+const char *disk_total(const char *path);
+const char *disk_used(const char *path);
+
+/* entropy */
+const char *entropy(const char *unused);
+
+/* hostname */
+const char *hostname(const char *unused);
+
+/* ip */
+const char *ipv4(const char *interface);
+const char *ipv6(const char *interface);
+
+/* kernel_release */
+const char *kernel_release(const char *unused);
+
+/* keyboard_indicators */
+const char *keyboard_indicators(const char *fmt);
+
+/* keymap */
+const char *keymap(const char *unused);
+
+/* load_avg */
+const char *load_avg(const char *unused);
+
+/* netspeeds */
+const char *netspeed_rx(const char *interface);
+const char *netspeed_tx(const char *interface);
+
+/* num_files */
+const char *num_files(const char *path);
+
+/* ram */
+const char *ram_free(const char *unused);
+const char *ram_perc(const char *unused);
+const char *ram_total(const char *unused);
+const char *ram_used(const char *unused);
+
+/* run_command */
+const char *run_command(const char *cmd);
+
+/* swap */
+const char *swap_free(const char *unused);
+const char *swap_perc(const char *unused);
+const char *swap_total(const char *unused);
+const char *swap_used(const char *unused);
+
+/* temperature */
+const char *temp(const char *);
+
+/* uptime */
+const char *uptime(const char *unused);
+
+/* user */
+const char *gid(const char *unused);
+const char *uid(const char *unused);
+const char *username(const char *unused);
+
+/* volume */
+const char *vol_perc(const char *card);
+
+/* wifi */
+const char *wifi_essid(const char *interface);
+const char *wifi_perc(const char *interface);
+
+/* settings */
+#define LEN(x) (sizeof(x) / sizeof((x)[0]))
+
+extern char *argv0;
+
+void warn(const char *, ...);
+void die(const char *, ...);
+
+int esnprintf(const char *buf, char *str, size_t size, const char *fmt, ...);
+char *bprintf(const char *buf, const char *fmt, ...);
+const char *fmt_human(const char *buf, uintmax_t num, int base);
+int pscanf(const char *buf, const char *path, const char *fmt, ...);
+