diff --git a/Omarchy_resolve_v2.sh b/Omarchy_resolve_v2.sh index 11de4d2..05416d9 100755 --- a/Omarchy_resolve_v2.sh +++ b/Omarchy_resolve_v2.sh @@ -77,25 +77,36 @@ fi # desktop-file-utils: Provides update-desktop-database for app menu integration # file: Identifies file types (used to find ELF binaries for patching) # gtk-update-icon-cache: Refreshes the icon cache so Resolve's icon appears +# Packages are installed one at a time: pacman aborts the ENTIRE transaction +# if any single target is missing from the repos, which would silently leave +# every other dependency uninstalled (this is exactly what happened when Arch +# dropped gtk2 from the official repos). log "Installing required tools..." -if ! sudo pacman -S --needed --noconfirm unzip patchelf libarchive xdg-user-dirs desktop-file-utils file gtk-update-icon-cache; then - warn "Some optional tools failed to install, continuing anyway..." -fi +for pkg in unzip patchelf libarchive xdg-user-dirs desktop-file-utils file gtk-update-icon-cache; do + if ! sudo pacman -S --needed --noconfirm "${pkg}"; then + warn "Failed to install ${pkg}, continuing anyway..." + fi +done # Runtime dependencies that Resolve needs but doesn't bundle: # libxcrypt-compat: Provides legacy libcrypt.so.1 (Arch moved to libxcrypt v2) # ffmpeg4.4: Older FFmpeg version that Resolve links against # glu: OpenGL Utility Library (3D rendering support) -# gtk2: GTK2 toolkit (Resolve's UI uses some GTK2 components) # fuse2: Filesystem in Userspace v2 (for AppImage compatibility) # +# gtk2 used to be on this list but is gone: Arch removed it from the official +# repos (AUR-only now) and Resolve no longer needs it — the AUR davinci-resolve +# package (21.x) dropped the dependency as well. +# # IMPORTANT: We deliberately do NOT replace Resolve's bundled libc++/libc++abi # with system versions. Resolve was compiled against specific C++ ABI versions # and swapping them causes crashes. Only glib/gio/gmodule get replaced (later). log "Installing runtime dependencies..." -if ! sudo pacman -S --needed --noconfirm libxcrypt-compat ffmpeg4.4 glu gtk2 fuse2; then - warn "Some runtime dependencies failed to install (may affect functionality)" -fi +for pkg in libxcrypt-compat ffmpeg4.4 glu fuse2; do + if ! sudo pacman -S --needed --noconfirm "${pkg}"; then + warn "Failed to install ${pkg} (may affect functionality)" + fi +done # Resolve's built-in extras downloader expects TLS certificates at the # Red Hat/CentOS path (/etc/pki/tls) rather than the Arch path (/etc/ssl). @@ -378,6 +389,10 @@ fi # Force XWayland under Hyprland/Wayland export QT_QPA_PLATFORM=xcb export QT_AUTO_SCREEN_SCALE_FACTOR=1 +# Omarchy sets QT_STYLE_OVERRIDE=kvantum and QT_QPA_PLATFORMTHEME=gtk3 +# globally (Omarchy 4 envs.lua). Resolve's bundled Qt has neither plugin — +# harmless, but unset them so startup stays free of Qt style warnings. +unset QT_STYLE_OVERRIDE QT_QPA_PLATFORMTHEME # For hybrid laptops, optionally force dGPU: # export __NV_PRIME_RENDER_OFFLOAD=1 # export __GLX_VENDOR_LIBRARY_NAME=nvidia @@ -432,6 +447,42 @@ EOF update-desktop-database "${HOME}/.local/share/applications" >/dev/null 2>&1 || true sudo gtk-update-icon-cache -f /usr/share/icons/hicolor >/dev/null 2>&1 || true +# ==================== Omarchy 4 full-opacity window rule ==================== +# +# Omarchy 4 applies a default translucency to EVERY window (0.985 focused / +# 0.96 unfocused, via a "default-opacity" tag in its Hyprland Lua config). +# Its built-in Resolve rule (default/hypr/apps/davinci-resolve.lua) handles +# dialog focus but does NOT opt out of the translucency — and a translucent +# window is simply wrong for colour-critical grading work. +# +# Fix: append an opacity override to the user's ~/.config/hypr/hyprland.lua. +# That file loads AFTER Omarchy's defaults, and Hyprland applies matching +# window rules in order (last write to a property wins), so this forces +# Resolve back to full opacity without touching Omarchy's own files. +# +# Only runs when an Omarchy 4 Lua config is detected; pre-4 installs never +# applied global translucency, so they need nothing. Idempotent via the +# "resolve-full-opacity" marker. +HYPR_LUA="${HOME}/.config/hypr/hyprland.lua" +if [[ -f "${HYPR_LUA}" ]] && grep -q 'default\.hypr\.omarchy' "${HYPR_LUA}"; then + if grep -q 'resolve-full-opacity' "${HYPR_LUA}"; then + log "Omarchy 4 opacity rule already present in ${HYPR_LUA}" + else + log "Adding full-opacity window rule for Resolve to ${HYPR_LUA}..." + cat >> "${HYPR_LUA}" <<'EOF' + +-- resolve-full-opacity (added by Omarchy_resolve_v2.sh): Omarchy's default +-- window translucency is wrong for colour-critical work; keep DaVinci +-- Resolve fully opaque. Loaded after Omarchy defaults, so this rule wins. +o.window(".*[Rr]esolve.*", { opacity = "1 1" }) +EOF + # Reload Hyprland so the rule takes effect now (no-op outside a session) + command -v hyprctl >/dev/null 2>&1 && hyprctl reload >/dev/null 2>&1 || true + fi +else + log "No Omarchy 4 Lua config detected, skipping opacity rule (not needed pre-4)" +fi + # ==================== Audio backend fix (DeckLink → ALSA) ==================== # # Resolve ships with `Local.Audio.Type = DeckLink` as the default in its @@ -592,6 +643,7 @@ fi echo echo "✅ DaVinci Resolve installed to /opt/resolve" echo " (vendor libc++ kept; libcrypt.so.1 ensured; audio backend → ALSA + snd-aloop)" +echo " (Omarchy 4: full-opacity window rule added — grading needs opaque windows)" echo " Launch from your app menu, or run: resolve-nvidia-open" echo " Skip snd-aloop module setup: RESOLVE_NO_ALOOP=1 ./Omarchy_resolve_v2.sh" echo " Logs: ~/.local/share/DaVinciResolve/logs/ResolveDebug.txt" diff --git a/README.md b/README.md index 42e8218..aa2399a 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,12 @@ chmod +x Omarchy_resolve_v2.sh | `libxcrypt-compat` | Provides legacy `libcrypt.so.1` (Arch dropped it) | | `ffmpeg4.4` | Older FFmpeg version that Resolve links against | | `glu` | OpenGL Utility Library for 3D rendering | -| `gtk2` | GTK2 toolkit (some Resolve UI components use it) | | `fuse2` | AppImage compatibility layer | +Packages are installed individually so one unavailable package can't abort +the rest. (`gtk2` used to be on this list — Arch moved it to the AUR and +Resolve 19+ no longer needs it, so it was dropped.) + ### 2. Extracts Resolve The download is a ZIP containing a `.run` file (self-extracting AppImage). The script unpacks it in stages: @@ -92,7 +95,7 @@ Every ELF binary in Resolve gets its RPATH patched to point to `/opt/resolve/lib ### 5. Creates XWayland Wrapper -Resolve doesn't support native Wayland. The wrapper script (`resolve-nvidia-open`) forces XWayland mode by setting `QT_QPA_PLATFORM=xcb`, and also clears stale Qt lockfiles that can prevent Resolve from starting after a crash. +Resolve doesn't support native Wayland. The wrapper script (`resolve-nvidia-open`) forces XWayland mode by setting `QT_QPA_PLATFORM=xcb`, and also clears stale Qt lockfiles that can prevent Resolve from starting after a crash. It additionally unsets Omarchy's global `QT_STYLE_OVERRIDE=kvantum` / `QT_QPA_PLATFORMTHEME=gtk3` — Resolve's bundled Qt has neither plugin, so this just silences Qt style warnings. ### 6. Desktop Integration @@ -146,6 +149,18 @@ proceeds normally. The script: Set `RESOLVE_NO_ALOOP=1` to skip this entirely (useful if you have a dedicated audio interface Resolve already uses cleanly). +### 8. Full Opacity for Grading (Omarchy 4) + +Omarchy 4 applies a default translucency (0.985 focused / 0.96 unfocused) to +every window via its Hyprland Lua config, and its built-in Resolve rule +doesn't opt out — a translucent window is wrong for colour-critical work. +When an Omarchy 4 Lua config is detected, the installer appends a +`resolve-full-opacity` rule to `~/.config/hypr/hyprland.lua` (loaded after +Omarchy's defaults, so it wins) forcing Resolve back to `opacity 1 1`. +Idempotent; skipped entirely on pre-4 installs, which never applied global +translucency. To remove it, delete the `resolve-full-opacity` block from +`~/.config/hypr/hyprland.lua`. + ## Files Installed ### Application @@ -353,6 +368,9 @@ sudo rm -f /usr/lib/udev/rules.d/99-BlackmagicDevices.rules sudo rm -f /usr/lib/udev/rules.d/99-ResolveKeyboardHID.rules sudo rm -f /usr/lib/udev/rules.d/99-DavinciPanel.rules +# Remove the Omarchy 4 opacity rule: delete the "resolve-full-opacity" block +# from ~/.config/hypr/hyprland.lua, then: hyprctl reload + # Remove the snd-aloop autoload entry + PipeWire bridge + wireplumber rule sudo rm -f /etc/modules-load.d/snd-aloop.conf rm -f ~/.config/pipewire/pipewire.conf.d/50-resolve-aloop-bridge.conf