aboutsummaryrefslogtreecommitdiff
path: root/articles/2025/Naked-DWM.html
blob: bb64c73199efc3c6d637f6fe2f11d3c1dc758397 (plain)
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
<!doctype html>
<html lang="EN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/style.css">
    <title>Naked DWM</title>
  </head>
  <body>
    <header>
      <h1>Bloggings</h1>
      <a href="/index.php">Back</a>
      
    </header>
    
<main>
<article>
<h2>Naked DWM</h2>
<h3>2025-05-01</h3>
<h4>Zero dwm patches...</h4>
<p>Inspiration from <a href="https://youtu.be/O5VVdFWJcak">Bread on Penguins</a> and <a href="https://www.youtube.com/watch?v=g8_d2rnwQdo&t=1206s">BugsWriter</a></p>
<p><img src="/images/blog/pywal16-screenshot.png"></p>
<p>I've been messing with DWM patches but I went back to naked DWM. 
The only caveat is a couple of lines of code in <b>dwm/config.h</b> to integrate Pywal16, 
that allows me to have a colour theme that matches whatever wallpaper I'm using.</p>
<p>It's possible to patch DWM with the Xresources patch but patches are version dependant and can be a pain.
I prefer simple and maintainable.</p>
<p>Install <a href="https://github.com/eylles/pywal16">pywal16</a></p>
<pre>
yay -S python-pywal16
</pre>
<h4>Modify dwm/config.h</h4>
<p>In <b>dwm/config.h</b> I removed the default colour settings:</p>
<pre>
static const char col_gray1[]       = "#222222";
static const char col_gray2[]       = "#444444";
static const char col_gray3[]       = "#bbbbbb";
static const char col_gray4[]       = "#eeeeee";
static const char col_cyan[]        = "#005577";
static const char *colors[][3]      = {
	/*               fg         bg         border   */
	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
};
</pre>
<p>and replaced them with this line:</p>
<pre>
/* Pywal16 */ 
#include "/home/philip/.cache/wal/colors-wal-dwm.h"
</pre>
<h4>xinitrc</h4>
<p>In my .xinitrc I have <b>wal -Rq</b> which recalls the last wallpaper setting.</p>
<h4>Chooser script</h4>
<p>This script chooses the wallpaper then recompiles dwm and dmenu.</p>
<pre>
#!/usr/bin/env bash
# Choose a wallpaper 
# requires nsxiv, pywal16
# ~/.local/bin is in PATH

FOLDER=~/Pictures/wallpaper
# thumbnail display of images
CHOICE=$(nsxiv -otb $FOLDER/*) 

wal -i $CHOICE

# Post process

# DWM
cd ~/.local/src/dwm
make clean ; make
rm -f ~/.local/bin/dwm
cp dwm ~/.local/bin

# DWMMENU
rm -f ~/.local/dmenu*
cd ~/.local/src/dmenu
make clean ; make
cp {dmenu,dmenu_run,dmenu_path} ~/.local/bin
</pre>
</article>
</main>
<footer>

<p>&nbsp;</p>

<p>§</p>
  </footer>
</body>
</html>