diff options
| author | user <user@clank> | 2026-09-22 12:57:26 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-09-22 12:57:26 +0200 |
| commit | 68ff62e9492accd4c1c9a83edbcbd225afb1a11a (patch) | |
| tree | b744ad33cdbaa25fca333f28f13b5e7df28838dd /docs/slosh.5 | |
| parent | themes: a picker that wears them as you browse (C-a t) (diff) | |
| download | slosh-68ff62e9492accd4c1c9a83edbcbd225afb1a11a.tar.gz slosh-68ff62e9492accd4c1c9a83edbcbd225afb1a11a.tar.xz slosh-68ff62e9492accd4c1c9a83edbcbd225afb1a11a.zip | |
themes: ask the binary where it is, not the prefix it was built for
`theme_name "sl0p"` with all seven themes sitting in /usr/share/slosh/themes:
"no theme named sl0p". The lookup knew two places -- your own themes directory
and the PREFIX this build was compiled with -- and on that machine the first
did not exist and the second was /usr/local, because that is the Makefile's
default and the package was built with PREFIX=/usr. Neither was where the
themes actually were, and nothing in the search could ever have found them.
A compiled-in prefix is a guess about where the binary will end up, and the
binary is the one thing that knows where it really is. So the search now asks
it: path_self() (/proc/self/exe, _NSGetExecutablePath, GetModuleFileName --
lifted out of server.c, which was already doing this for SLOSH_BIN) gives
<bin>/../share/slosh/themes for an installed slosh wherever it was installed
to, and <repo>/contrib/themes for one being run out of a build tree, which
makes a checkout able to name a theme without installing anything first. The
compiled-in prefix stays as the last candidate, for a binary sitting somewhere
that says nothing about its data, and duplicates collapse so the usual install
does not report the same directory twice.
Your own directory is still first and still shadows everything, which is the
property that matters; the rest is about the shipped set being findable at all.
The tests that assumed a closed world of two temp themes now narrow to their
own names by typing, since the shipped ones are (correctly) always in the list
-- and the "no themes anywhere" toast lost its test, because with the shipped
set reachable that state takes a binary with nothing beside it. The case that
started this is a test of its own.
Diffstat (limited to '')
| -rw-r--r-- | docs/slosh.5 | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/slosh.5 b/docs/slosh.5 index 21315e7..ed7c0ad 100644 --- a/docs/slosh.5 +++ b/docs/slosh.5 @@ -324,10 +324,17 @@ Unset, the compiled\-in palette stands. Where those files live. Unset, it is .I themes/ -beside the configuration file, and then -.IR PREFIX/share/slosh/themes/ , -so a shipped theme is nameable without being copied and one of yours -with the same name shadows it. +beside the configuration file, and then the shipped themes, found +relative to the running binary +.RI ( <bin>/../share/slosh/themes , +or +.I <repo>/contrib/themes +out of a build tree) and finally under the prefix this build was +compiled with. +A shipped theme is therefore nameable without being copied, and one of +yours with the same name shadows it. +.B \(aq{"cmd":"theme"}\(aq +reports the directories in the order they are searched. .PP .B theme { } names every colour the compositor draws (frames, titles, tabs, |
