1diff --git a/config/aerc.conf b/config/aerc.conf
2index fbc1f3ba..9eea2b81 100644
3--- a/config/aerc.conf
4+++ b/config/aerc.conf
5@@ -301,8 +301,7 @@
6 #
7 # ${XDG_CONFIG_HOME:-~/.config}/aerc/stylesets
8 # ${XDG_DATA_HOME:-~/.local/share}/aerc/stylesets
9-# /usr/local/share/aerc/stylesets
10-# /usr/share/aerc/stylesets
11+# @out@/share/aerc/stylesets
12 #
13 #stylesets-dirs=
14
15@@ -741,8 +740,8 @@
16 # ${XDG_DATA_HOME:-~/.local/share}/aerc/filters
17 # $PREFIX/libexec/aerc/filters
18 # $PREFIX/share/aerc/filters
19-# /usr/libexec/aerc/filters
20-# /usr/share/aerc/filters
21+# @out@/libexec/aerc/filters
22+# @out@/share/aerc/filters
23 #
24 # If you want to run a program in your default $PATH which has the same name
25 # as a builtin filter (e.g. /usr/bin/colorize), use its absolute path.
26@@ -845,8 +844,7 @@ text/html=! html
27 #
28 # ${XDG_CONFIG_HOME:-~/.config}/aerc/templates
29 # ${XDG_DATA_HOME:-~/.local/share}/aerc/templates
30-# /usr/local/share/aerc/templates
31-# /usr/share/aerc/templates
32+# @out@/share/aerc/templates
33 #
34 #template-dirs=
35
36diff --git a/config/config.go b/config/config.go
37index 14c4b233..9f305ffd 100644
38--- a/config/config.go
39+++ b/config/config.go
40@@ -46,10 +46,8 @@ func buildDefaultDirs() []string {
41 }
42
43 // Add fixed fallback locations
44- defaultDirs = append(defaultDirs, "/usr/local/libexec/aerc")
45- defaultDirs = append(defaultDirs, "/usr/local/share/aerc")
46- defaultDirs = append(defaultDirs, "/usr/libexec/aerc")
47- defaultDirs = append(defaultDirs, "/usr/share/aerc")
48+ defaultDirs = append(defaultDirs, "@out@/libexec/aerc")
49+ defaultDirs = append(defaultDirs, "@out@/share/aerc")
50
51 return defaultDirs
52 }
53diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
54index 1e3daaa9..cd118be0 100644
55--- a/doc/aerc-config.5.scd
56+++ b/doc/aerc-config.5.scd
57@@ -13,7 +13,7 @@ _aerc_, which defaults to _~/.config/aerc_. Alternate files can be specified via
58 command line arguments, see *aerc*(1).
59
60 Examples of these config files are typically included with your installation of
61-aerc and are usually installed in _/usr/share/aerc_.
62+aerc and are usually installed in _@out@/share/aerc_.
63
64 Each file uses the ini format, and consists of sections with keys and values.
65 A line beginning with _#_ is considered a comment and ignored, as are empty
66@@ -386,8 +386,7 @@ These options are configured in the *[ui]* section of _aerc.conf_.
67 ```
68 ${XDG_CONFIG_HOME:-~/.config}/aerc/stylesets
69 ${XDG_DATA_HOME:-~/.local/share}/aerc/stylesets
70- /usr/local/share/aerc/stylesets
71- /usr/share/aerc/stylesets
72+ @out@/share/aerc/stylesets
73 ```
74
75 *styleset-name* = _<string>_
76@@ -1019,7 +1018,7 @@ will be set to the terminal TTY. The filter is expected to implement its own
77 paging.
78
79 aerc ships with some default filters installed in the libexec directory (usually
80-_/usr/libexec/aerc/filters_). Note that these may have additional dependencies
81+_@out@/libexec/aerc/filters_). Note that these may have additional dependencies
82 that aerc does not have alone.
83
84 The filter commands are invoked with _sh -c command_. The following folders are
85@@ -1031,8 +1030,8 @@ ${XDG_CONFIG_HOME:-~/.config}/aerc/filters
86 ${XDG_DATA_HOME:-~/.local/share}/aerc/filters
87 $PREFIX/libexec/aerc/filters
88 $PREFIX/share/aerc/filters
89-/usr/libexec/aerc/filters
90-/usr/share/aerc/filters
91+@out@/libexec/aerc/filters
92+@out@/share/aerc/filters
93 ```
94
95 If you want to run a program in your default *$PATH* which has the same
96@@ -1370,7 +1369,7 @@ of the template name. The available symbols and functions are described in
97 *aerc-templates*(7).
98
99 aerc ships with some default templates installed in the share directory (usually
100-_/usr/share/aerc/templates_).
101+_@out@/share/aerc/templates_).
102
103 These options are configured in the *[templates]* section of _aerc.conf_.
104
105@@ -1382,8 +1381,7 @@ These options are configured in the *[templates]* section of _aerc.conf_.
106 ```
107 ${XDG_CONFIG_HOME:-~/.config}/aerc/templates
108 ${XDG_DATA_HOME:-~/.local/share}/aerc/templates
109- /usr/local/share/aerc/templates
110- /usr/share/aerc/templates
111+ @out@/share/aerc/templates
112 ```
113
114 *new-message* = _<template_name>_
115diff --git a/doc/aerc-templates.7.scd b/doc/aerc-templates.7.scd
116index a6deb584..4f91869c 100644
117--- a/doc/aerc-templates.7.scd
118+++ b/doc/aerc-templates.7.scd
119@@ -398,7 +398,7 @@ aerc provides the following additional functions:
120 Attaches a file to the message being composed.
121
122 ```
123- {{.Attach '/usr/libexec/aerc/filters/html'}}
124+ {{.Attach '@out@/libexec/aerc/filters/html'}}
125 ```
126
127 *exec*
128@@ -581,7 +581,7 @@ aerc provides the following additional functions:
129
130 ```
131 {{if eq .OriginalMIMEType "text/html"}}
132- {{exec `/usr/libexec/aerc/filters/html` .OriginalText | wrap 72 | quote}}
133+ {{exec `@out@/libexec/aerc/filters/html` .OriginalText | wrap 72 | quote}}
134 {{else}}
135 {{wrap 72 .OriginalText | trimSignature | quote}}
136 {{end}}