From 0a4c4b5941fe982ccb3d3175e26d9d83f0025ffd Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Sat, 15 Feb 2025 14:56:00 +0200 Subject: Checkpoint: preserve all uncommitted rust-rewrite worktree work Safety commit before reconciling this worktree with main, which has diverged with its own separate fixes today. Nothing here is reviewed or curated yet - this exists purely so none of this work can be lost to a git operation, disk issue, or worktree cleanup while that reconciliation happens. --- config/srd/init.lua | 4 +- config/srd/themes.lua | 167 +++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 149 insertions(+), 22 deletions(-) (limited to 'config') diff --git a/config/srd/init.lua b/config/srd/init.lua index 5ac8a6b..2a79109 100644 --- a/config/srd/init.lua +++ b/config/srd/init.lua @@ -15,7 +15,9 @@ srd.load("startup") srd.set("general.default_layout", "dynamic") srd.set("general.smart_placement", true) srd.set("general.window_gap", 8) -srd.set("general.border_width", 2) +- Border width lives under theme.decorations.border.width (see themes.lua), +- not here - see docs/DEFAULTS.md for why general.border_width never +- existed as a real setting. srd.set("general.animations", true) srd.set("general.animation_duration", 200) diff --git a/config/srd/themes.lua b/config/srd/themes.lua index 4233b46..cf35b47 100644 --- a/config/srd/themes.lua +++ b/config/srd/themes.lua @@ -1,27 +1,152 @@ -- Nord-inspired theme (matches the built-in defaults; edit freely). +- Theme presets for srdwm. Pick one by leaving its `apply(...)` call +- uncommented at the bottom and commenting out the others - exactly one +- should be active. Copying a whole preset table, editing values, and +- pointing the bottom call at the copy works too; nothing here is special +- beyond being a plain Lua table passed to srd.theme.set_colors/ +- set_decorations. +-- +- `border.inactive_dim` is a factor applied to `active_color` for the +- unfocused-window border, not a second explicit colour - 0.0 fades it to +- black, 1.0 makes it identical to focused. See docs/DEFAULTS.md. +-- +- `border.width = 4`, not a thinner value: srdwm rounds the border's own +- corner via a CPU-rasterised bitmap, not a real-resolution GPU shader, so +- a 2px-thick strip only has 2 rows to draw a curve into - not enough to +- read as curved at all, just a slightly-softened square. 4px is the +-- minimum found actually visible as a real curve; go lower and the corner +- starts looking square again regardless of `radius`. +-- +- `title_bar.height` below is *not* the real titlebar band - that's +- `srdwm_core::TITLEBAR_HEIGHT` (currently `32`), a compile-time constant +- shared between hit-testing and rendering so the two can never disagree. +- Kept here at the same value purely so this file doesn't read as +- disagreeing with the real height; changing it has no effect. +-- +- `title_bar.button_style` - "traffic_lights" (default: filled, coloured +- macOS-style dots, zoom-arrow maximize) or "traditional" (plain glyphs +- straight on the titlebar background, no fill except a neutral hover +- backdrop, square maximize) - see `ThemeConfig::traffic_light_buttons`'s +- own doc comment. Independent of `button_side`: either style can sit on +- either side, though `traffic_lights` + left and `traditional` + right +- are this file's own two ready-made combinations below, matching macOS +- and Windows/GNOME convention respectively. + local srd = require("srd") -srd.theme.set_colors({ - background = "#2e3440", - foreground = "#eceff4", - primary = "#88c0d0", - secondary = "#81a1c1", - accent = "#5e81ac", - error = "#bf616a", - warning = "#ebcb8b", - success = "#a3be8c", -}) +local function apply(preset) + srd.theme.set_colors(preset.colors) + srd.theme.set_decorations(preset.decorations) +end -srd.theme.set_decorations({ - border = { - width = 2, - active_color = "#88c0d0", - inactive_color = "#4c566a", - }, - title_bar = { - height = 30, - show = true, +- --------------------------------------------------------------------- +- Nord (dark) - srdwm's own compiled-in defaults (`ThemeConfig:: +- default`), written out explicitly so the preset is visible and +- editable rather than left implicit. +- --------------------------------------------------------------------- +local nord = { + colors = { background = "#2e3440", foreground = "#eceff4", + primary = "#88c0d0", + secondary = "#81a1c1", + accent = "#5e81ac", + error = "#bf616a", + warning = "#ebcb8b", + success = "#a3be8c", + }, + decorations = { + border = { + width = 4, + radius = 12, + active_color = "#88c0d0", + inactive_dim = 0.35, + }, + title_bar = { + height = 32, + show = true, + background = "#2e3440", + foreground_focused = "#88c0d0", + foreground_unfocused = "#4c566a", + text_align = "left", + button_side = "right", + button_glyph = "hover", + }, + }, +} + +- --------------------------------------------------------------------- +- macOS - centered title, left-aligned traffic-light buttons (real +- macOS convention, not this system's own GTK button-layout convention -- +- see `title_bar.button_side`'s own doc comment in `crates/core/src/ +- theme.rs` if picking a different button order/side). Grey titlebar +- background matches a real GTK dark theme's own CSD row (measured live +- off a real WhiteSur-Dark screenshot, (44,44,44)) rather than fighting +- it with an accent colour, so srdwm's own decorated windows read as the +- same family of chrome as Firefox/Nemo/every other GTK app's CSD, not a +- visibly different one sitting right next to them. +-- +- For the *system* half of a full macOS look (which side Firefox/GTK +- apps' own CSD buttons draw on, real traffic-light gradients on GTK +- apps' own dots) see docs/DEFAULTS.md's "macOS look" section - that +- part is outside srdwm entirely (a `gsettings` value plus a userChrome. +- css/gtk.css of your own), so it isn't and can't be shipped from here. +- --------------------------------------------------------------------- +local macos = { + colors = { + background = "#1e1e1e", + foreground = "#f5f5f5", + primary = "#0a84ff", + secondary = "#5e5ce6", + accent = "#64d2ff", + error = "#ff453a", + warning = "#ffd60a", + success = "#32d74b", }, -}) + decorations = { + border = { + width = 4, + radius = 12, + active_color = "#0a84ff", + inactive_dim = 0.35, + }, + title_bar = { + height = 32, + show = true, + background = "#2c2c2c", + foreground_focused = "#f5f5f5", + foreground_unfocused = "#9a9a9a", + text_align = "center", + button_side = "left", + button_glyph = "hover", + }, + }, +} + +- --------------------------------------------------------------------- +- Traditional - plain glyphs, right-aligned, no traffic lights: this +- project's own original look and the real Windows/GNOME convention, as +- distinct from `macos` above. Otherwise identical to `nord`; only +- `button_style` differs. +- --------------------------------------------------------------------- +local traditional = { + colors = nord.colors, + decorations = { + border = nord.decorations.border, + title_bar = { + height = 32, + show = true, + background = "#2e3440", + foreground_focused = "#88c0d0", + foreground_unfocused = "#4c566a", + text_align = "left", + button_side = "right", + button_glyph = "hover", + button_style = "traditional", + }, + }, +} + +- Pick exactly one. Comment out the other two. +apply(nord) +- apply(macos) +- apply(traditional) -- cgit v1.2.3