From 77f70e318cad644e1f2897011a8baff4e2ad9506 Mon Sep 17 00:00:00 2001 From: Mathias Scheider Date: Fri, 25 Sep 2026 14:26:30 +0200 Subject: [PATCH] hypr fix setup issues --- README.md | 22 ++++- .../caelestia/monitors/DP-2/shell.json | 2 + .../caelestia/monitors/DP-3/shell.json | 2 + hypr/.config/caelestia/shell.json | 53 +++++++----- hypr/.config/hypr/env.example.lua | 2 +- hypr/.config/hypr/hyprland-gui.lua | 34 ++++++++ hypr/.config/hypr/hyprland.lua | 17 ++-- hypr/.config/hypr/modules/keybinds.lua | 11 ++- setup/hypr/packages.txt | 16 ++-- setup/hypr/setup.sh | 59 ++++++++++++++ setup/lib/common.sh | 4 +- test/lint.sh | 81 ++++++++++++++++++- 12 files changed, 258 insertions(+), 45 deletions(-) create mode 100644 hypr/.config/caelestia/monitors/DP-2/shell.json create mode 100644 hypr/.config/caelestia/monitors/DP-3/shell.json diff --git a/README.md b/README.md index 1b44415..9134cde 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Personal configuration files for an Arch Linux workstation (Hyprland + Neovim + |-----------|----------| | `basic/` | Base system packages + the **central theme** (`basic/.config/themes` → `~/.config/themes`: Catppuccin Mocha palette, `current` symlink, `switch-theme.sh`/`sync-theme.sh`). All other packages reference it instead of copying colors. | | `term/` | Fish + kitty + starship + nvim + tmux + yazi + fastfetch + opencode terminal environment | -| `hypr/` | Hyprland compositor config + Noctalia shell config (Catppuccin Mocha) | +| `hypr/` | Hyprland compositor config + selectable Noctalia/Caelestia shell configs | | `kreation/`| VST plugin (`MT-PowerDrumKit.vst3`) | | `local_ai/`| Local AI / MCP tooling config | | `setup/` | Install/setup scripts + package lists (one subdir per target, shared helpers in `setup/lib/`; not stowed) | @@ -31,7 +31,7 @@ cd ~/.dotfiles # 2. Install a target and symlink its files make term # terminal + fish + kitty + nvim -make hypr # Hyprland (also pulls in basic + term) +make hypr # Hyprland + selectable Noctalia/Caelestia shells make kreation # VST plugin (also pulls in basic) ``` @@ -45,10 +45,24 @@ Run `make ` from the repository root. Each target first runs the relevan |--------|--------------| | `make term` | Runs `setup/term/setup.sh` (installs terminal packages, sets fish as default shell, clones tmuxifier), then `stow term`. Pulls in `basic`. | | `make basic` | Runs `setup/basic/setup.sh`: enables multilib, updates the system, installs `yay` if missing, installs the `setup/basic/packages.txt` packages, and sets up Docker (enables/starts the service, adds your user to the `docker` group, verifies the service) | -| `make hypr` | `make basic`, installs Hyprland packages, stows `hypr`, runs the Hyprland setup scripts (`ensure-env.sh`, `portal-host-override.sh`, `fix_dolphin_file_associations.sh`) | +| `make hypr` | Runs `make basic`, installs Hyprland plus the Noctalia and Caelestia frontends, creates a local shell selection when needed, stows `hypr`, and runs the portal/file-association integration scripts | | `make kreation` | `make basic`, installs VST runtime, stows `kreation` | | `make buntes-monster` | Everything (`basic` + `hypr` + `kreation`), then wires up symlinks | +### Choosing between Noctalia and Caelestia + +`make hypr` installs both desktop-shell frontends. Hyprland starts the one selected in `~/.config/hypr/env.lua`: + +```lua +return { + shell = "noctalia", -- or "caelestia" +} +``` + +The local `env.lua` is created from `env.example.lua` on the first setup and is preserved on later runs. After changing the value, log out of and back into Hyprland; the running shell is not replaced live. + +Caelestia requires the upstream AUR package `quickshell-git`; the release package `quickshell` must not be installed instead. Do not substitute CachyOS's `noctalia-qs`, even though it provides the virtual `quickshell-git` dependency: its Quickshell parser is not compatible with Caelestia. The package list uses the explicit `aur/quickshell-git` target because `yay --aur` alone may still select a repository provider. `make hypr` then replaces an existing `noctalia-qs` installation transactionally and verifies that `/usr/bin/qs` belongs to `quickshell-git`. + ### Managing terminal packages The terminal package list lives in a single editable file: @@ -61,7 +75,7 @@ Add/remove packages on separate lines. Lines starting with `#` are ignored, and ``` @pacman # install via pacman (default) -@aur # install via yay (AUR) +@aur # use yay's AUR mode; use aur/ for an explicit source @npm # install via npm -g ``` diff --git a/hypr/.config/caelestia/monitors/DP-2/shell.json b/hypr/.config/caelestia/monitors/DP-2/shell.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/hypr/.config/caelestia/monitors/DP-2/shell.json @@ -0,0 +1,2 @@ +{ +} diff --git a/hypr/.config/caelestia/monitors/DP-3/shell.json b/hypr/.config/caelestia/monitors/DP-3/shell.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/hypr/.config/caelestia/monitors/DP-3/shell.json @@ -0,0 +1,2 @@ +{ +} diff --git a/hypr/.config/caelestia/shell.json b/hypr/.config/caelestia/shell.json index 94bbb02..da5ef4a 100644 --- a/hypr/.config/caelestia/shell.json +++ b/hypr/.config/caelestia/shell.json @@ -1,23 +1,36 @@ { - "appearance": { - "transparency": { - "enabled": true - } - }, - "general": { - "apps": { - "explorer": ["dolphin"], - "terminal": ["kitty"] - } - }, - "launcher": { - "showOnHover": true, - "useFuzzy": { - "apps": true + "appearance": { + "transparency": { + "enabled": true + } }, - "vimKeybinds": true - }, - "paths": { - "wallpaperDir": "~/nextcloud/Photos/Wallpapers" - } + "background": { + "wallpaperEnabled": true + }, + "general": { + "apps": { + "audio": [ + "supersonic-desktop" + ], + "explorer": [ + "dolphin" + ], + "playback": [ + "celluloid" + ], + "terminal": [ + "kitty" + ] + } + }, + "launcher": { + "showOnHover": true, + "useFuzzy": { + "apps": true + }, + "vimKeybinds": true + }, + "paths": { + "wallpaperDir": "~/nextcloud/Photos/Wallpapers" + } } diff --git a/hypr/.config/hypr/env.example.lua b/hypr/.config/hypr/env.example.lua index 8526955..4fe41fb 100644 --- a/hypr/.config/hypr/env.example.lua +++ b/hypr/.config/hypr/env.example.lua @@ -1,4 +1,4 @@ return { + -- Supported values: "noctalia" or "caelestia". shell = "noctalia", - -- shell = "cealestia" } diff --git a/hypr/.config/hypr/hyprland-gui.lua b/hypr/.config/hypr/hyprland-gui.lua index e69de29..c0b4cdd 100644 --- a/hypr/.config/hypr/hyprland-gui.lua +++ b/hypr/.config/hypr/hyprland-gui.lua @@ -0,0 +1,34 @@ +-- Generated by HyprMod + +-- Monitors +hl.monitor({ + output = "desc:AOC U27G4R XZ1R7HA004323", + disabled = false, + mode = "3840x2160@160.00Hz", + position = "-2560x0", + scale = 1.5, + bitdepth = 10, + cm = "hdredid", + sdrbrightness = 0.29, + sdrsaturation = 1.19, + sdr_min_luminance = 0, + sdr_max_luminance = 773, + min_luminance = 0, + max_luminance = 773, + max_avg_luminance = 456, +}) +hl.monitor({ + output = "desc:Acer Technologies XB253Q TH5EE0058521", + disabled = false, + mode = "1920x1080@60.00Hz", + position = "0x0", + scale = 1, + bitdepth = 10, + cm = "hdredid", + sdrbrightness = 0.5, + sdr_min_luminance = 0, + sdr_max_luminance = 763, + min_luminance = 0.02, + max_luminance = 763, + max_avg_luminance = 400, +}) diff --git a/hypr/.config/hypr/hyprland.lua b/hypr/.config/hypr/hyprland.lua index 7d75538..34f6c96 100644 --- a/hypr/.config/hypr/hyprland.lua +++ b/hypr/.config/hypr/hyprland.lua @@ -1,5 +1,9 @@ -require("env") +local env = require("env") +if env.shell ~= "noctalia" and env.shell ~= "caelestia" then + error("Unsupported shell '" .. tostring(env.shell) .. "' in ~/.config/hypr/env.lua; choose 'noctalia' or 'caelestia'") +end + hl.exec_cmd("bash ~/.config/hypr/env.sh") -- ############### @@ -28,13 +32,11 @@ hl.config({ -- ## MY PROGRAMS ### -- ################## -local env = require("env") - hl.on("hyprland.start", function() - if env.shell == "noctalia" then - hl.exec_cmd("noctalia &") - elseif env.shell == "caelestia" then + if env.shell == "caelestia" then hl.exec_cmd("caelestia shell -d") + else -- env.shell == "noctalia" + hl.exec_cmd("noctalia &") end hl.exec_cmd("hypridle &") hl.exec_cmd("sh ~/.config/hypr/scripts/portal-host-override.sh") @@ -49,3 +51,6 @@ require("modules.windows_and_workspaces") -- HyprMod managed settings require("hyprland-gui") + +-- For Noctalia Color templates +require("noctalia").apply_theme() diff --git a/hypr/.config/hypr/modules/keybinds.lua b/hypr/.config/hypr/modules/keybinds.lua index 475e091..e2a7ec0 100644 --- a/hypr/.config/hypr/modules/keybinds.lua +++ b/hypr/.config/hypr/modules/keybinds.lua @@ -1,5 +1,6 @@ local var = require("modules.variables") local command = require("modules.shell_commands") +local env = require("env") -- See https://wiki.hypr.land/Configuring/Keywords/ -- Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more @@ -232,7 +233,9 @@ hl.bind(var.mainMod .. " + K", hl.dsp.exec_cmd(command.keybinds_show), { descrip hl.bind(var.mainMod .. " + W", hl.dsp.exec_cmd(command.wallpaper_select), { description = "Wallpaper select" }) -- Caelestia extras -hl.bind(var.mainMod .. " + SHIFT + V", hl.dsp.exec_cmd(command.clipboard), { description = "Clipboard history" }) -hl.bind(var.mainMod .. " + period", hl.dsp.exec_cmd(command.emoji), { description = "Emoji picker" }) -hl.bind(var.mainMod .. " + SHIFT + K", hl.dsp.exec_cmd(command.show_all), { description = "Toggle utilities" }) -hl.bind("CTRL + ALT + C", hl.dsp.exec_cmd(command.clear_notifications), { description = "Clear notifications" }) +if env.shell == "caelestia" then + hl.bind(var.mainMod .. " + SHIFT + V", hl.dsp.exec_cmd(command.clipboard), { description = "Clipboard history" }) + hl.bind(var.mainMod .. " + period", hl.dsp.exec_cmd(command.emoji), { description = "Emoji picker" }) + hl.bind(var.mainMod .. " + SHIFT + K", hl.dsp.exec_cmd(command.show_all), { description = "Toggle utilities" }) + hl.bind("CTRL + ALT + C", hl.dsp.exec_cmd(command.clear_notifications), { description = "Clear notifications" }) +end diff --git a/setup/hypr/packages.txt b/setup/hypr/packages.txt index bfb5ab3..3b66362 100644 --- a/setup/hypr/packages.txt +++ b/setup/hypr/packages.txt @@ -1,10 +1,15 @@ # --------------------------------------------------------------------------- # Hyprland compositor package list for setup/hypr/setup.sh # -# Wayland compositor, screenshot tool and supporting utilities. The desktop -# shell (bar, launcher, notifications, lock screen, wallpaper, idle, session -# menu) on this branch is Caelestia (see hypr/.config/hypr/hyprland.lua: -# `caelestia shell -d`). Noctalia lives on main. +# Wayland compositor, screenshot tool and supporting utilities. Both desktop +# shell frontends are installed: Noctalia and Caelestia. Select the one started +# by Hyprland in hypr/.config/hypr/env.lua. +# +# Caelestia requires the upstream `quickshell-git` build. The explicit +# `aur/` source prefix below is intentional: yay's --aur mode alone can still +# select a repository provider. Do not substitute `noctalia-qs`; although it +# provides `quickshell-git`, that fork is incompatible with Caelestia's +# Quickshell pragmas. # # - Lines starting with '#' and blank lines are ignored. # - Use "@pacman", "@aur" or "@npm" markers to switch section. @@ -21,7 +26,6 @@ wev wl-clipboard hyprshot brightnessctl -quickshell noctalia wtype @@ -29,6 +33,6 @@ wtype hyprmod caelestia-shell caelestia-cli -quickshell-git +aur/quickshell-git hyprsaver python-terminaltexteffects diff --git a/setup/hypr/setup.sh b/setup/hypr/setup.sh index 1925ef0..eed139d 100644 --- a/setup/hypr/setup.sh +++ b/setup/hypr/setup.sh @@ -7,6 +7,62 @@ PACKAGES_FILE="$SETUP_DIR/packages.txt" # shellcheck source=../lib/common.sh source "$SETUP_DIR/../lib/common.sh" +# --------------------------------------------------------------------------- +# Create the local shell selection from the tracked example exactly once. +# env.lua is ignored by Git so each machine can keep its own choice. +# --------------------------------------------------------------------------- +ensure_shell_config() { + local config_dir example_file config_file + + config_dir="$(repo_root)/hypr/.config/hypr" + example_file="$config_dir/env.example.lua" + config_file="$config_dir/env.lua" + + if [[ -e "$config_file" || -L "$config_file" ]]; then + echo "==> Behalte lokale Shell-Auswahl: $config_file" + return + fi + + echo "==> Erstelle lokale Shell-Auswahl aus env.example.lua ..." + cp "$example_file" "$config_file" +} + +# --------------------------------------------------------------------------- +# Keep Caelestia on upstream Quickshell. +# +# noctalia-qs can satisfy pacman's virtual quickshell-git dependency, but its +# parser is not compatible with Caelestia. The explicit aur/quickshell-git +# target bypasses that provider, then setup verifies that /usr/bin/qs really +# belongs to quickshell-git. +# --------------------------------------------------------------------------- +warn_about_quickshell_provider() { + if pacman -Q noctalia-qs >/dev/null 2>&1; then + log "noctalia-qs ist installiert; die AUR-Transaktion ersetzt es durch quickshell-git." + fi +} + +verify_quickshell_runtime() { + local owner + + if pacman -Q noctalia-qs >/dev/null 2>&1; then + echo "Fehler: noctalia-qs ist weiterhin installiert; Caelestia benoetigt AUR quickshell-git." >&2 + return 1 + fi + + if ! pacman -Q quickshell-git >/dev/null 2>&1; then + echo "Fehler: AUR-Paket quickshell-git wurde nicht installiert." >&2 + return 1 + fi + + owner="$(pacman -Qoq /usr/bin/qs 2>/dev/null || true)" + if [[ "$owner" != "quickshell-git" ]]; then + echo "Fehler: /usr/bin/qs gehoert zu '$owner' statt zu quickshell-git." >&2 + return 1 + fi + + log "Quickshell-Runtime geprueft: quickshell-git" +} + # --------------------------------------------------------------------------- # Post-install: run Hyprland environment & desktop integration scripts. # --------------------------------------------------------------------------- @@ -30,8 +86,11 @@ main() { echo "==> Lese Paketliste: $PACKAGES_FILE" read_packages "$PACKAGES_FILE" pacman_pkgs aur_pkgs npm_pkgs + warn_about_quickshell_provider install_all_pkgs pacman_pkgs aur_pkgs npm_pkgs + verify_quickshell_runtime + ensure_shell_config run_hypr_scripts echo "Fertig. Hyprland und das Compositor-Okosystem sind eingerichtet." diff --git a/setup/lib/common.sh b/setup/lib/common.sh index 097234d..26d50ba 100644 --- a/setup/lib/common.sh +++ b/setup/lib/common.sh @@ -68,7 +68,9 @@ install_aur_pkgs() { local -n _pkgs="$1" if ((${#_pkgs[@]})); then log "Installiere AUR-Pakete: ${_pkgs[*]}" - yay -S --needed "${_pkgs[@]}" + # --aur selects yay's AUR mode. For names that a repository package + # can also provide, use an explicit aur/ target in the list. + yay -S --aur --needed "${_pkgs[@]}" fi } diff --git a/test/lint.sh b/test/lint.sh index 437a681..6662020 100755 --- a/test/lint.sh +++ b/test/lint.sh @@ -110,7 +110,82 @@ for pkgdir in term basic utils hypr kreation; do done # --------------------------------------------------------------------------- -# 5. Makefile <-> setup script name consistency. +# 5. Keep Caelestia on the upstream AUR Quickshell runtime. +# --------------------------------------------------------------------------- +echo "== Checking Quickshell package selection ==" +PACKAGE_FILES=() +for pkgdir in term basic utils hypr kreation; do + PACKAGE_FILES+=("setup/$pkgdir/packages.txt") +done + +has_package() { + local target="$1" file + shift + for file in "$@"; do + if awk -v target="$target" ' + { + sub(/#.*/, "") + gsub(/^[[:space:]]+|[[:space:]]+$/, "") + sub(/^[^/]+\//, "") + } + $0 == target { found = 1 } + END { exit(found ? 0 : 1) } + ' "$file"; then + return 0 + fi + done + return 1 +} + +has_aur_package() { + local target="$1" file + shift + for file in "$@"; do + if awk -v target="$target" ' + { + sub(/#.*/, "") + gsub(/^[[:space:]]+|[[:space:]]+$/, "") + } + $0 == "@aur" { in_aur = 1; next } + /^@/ { in_aur = 0; next } + in_aur && $0 == target { found = 1 } + END { exit(found ? 0 : 1) } + ' "$file"; then + return 0 + fi + done + return 1 +} + +if has_package quickshell "${PACKAGE_FILES[@]}" && has_package quickshell-git "${PACKAGE_FILES[@]}"; then + say_fail "package lists declare both quickshell and quickshell-git" +else + say_pass "no mutually exclusive quickshell packages declared" +fi + +if has_package noctalia-qs "${PACKAGE_FILES[@]}"; then + say_fail "package lists must not install noctalia-qs for Caelestia" +else + say_pass "incompatible noctalia-qs provider is not declared" +fi + +if has_aur_package aur/quickshell-git "${PACKAGE_FILES[@]}"; then + say_pass "quickshell-git is explicitly selected from the AUR" +else + say_fail "quickshell-git must use the explicit aur/quickshell-git target" +fi + +if awk ' + /^[[:space:]]*yay[[:space:]]+-S/ && /--aur/ && /--needed/ { found = 1 } + END { exit(found ? 0 : 1) } +' setup/lib/common.sh; then + say_pass "AUR package installation uses yay --aur mode" +else + say_fail "AUR package installation does not use yay --aur mode" +fi + +# --------------------------------------------------------------------------- +# 6. Makefile <-> setup script name consistency. # Catches typos such as `setup/basic/setuo.sh` # (missing '/') in Makefile targets. # --------------------------------------------------------------------------- @@ -126,7 +201,7 @@ while IFS= read -r tok; do done < <(grep -P '^\t' Makefile | grep -oE 'setup/[_A-Za-z0-9./-]+\.sh' | sort -u) # --------------------------------------------------------------------------- -# 6. Makefile <-> stow package name consistency. +# 7. Makefile <-> stow package name consistency. # Catches bugs such as `stow nvim` when the actual package dir is `term/`. # --------------------------------------------------------------------------- echo "== Checking Makefile stow targets reference real package dirs ==" @@ -156,7 +231,7 @@ while IFS= read -r pkg; do done < <(grep -P '^\t' Makefile | grep -E '\bstow\b' | awk '{print $NF}' | sort -u) # --------------------------------------------------------------------------- -# 7. Central theme drift guard: no hardcoded theme colors outside +# 8. Central theme drift guard: no hardcoded theme colors outside # basic/.config/themes (plus declared mirrors). See # basic/.config/themes/scripts/sync-theme.sh. # ---------------------------------------------------------------------------