aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-29 18:55:39 +0100
committerDanilo M. <danix@danix.xyz>2026-10-29 18:55:39 +0100
commit9b9271c304cc7654de0320760f875b666294f591 (patch)
treebaf85a64cb7d9d4052db4d4d480d821e73a2f52b
parentc5ce8451d0aa634fc7bcece4a4132f9508e54bf1 (diff)
downloadquickshell-9b9271c304cc7654de0320760f875b666294f591.tar.gz
quickshell-9b9271c304cc7654de0320760f875b666294f591.zip
window-switcher: show the previews over the wallpaper, faded in
The full-screen dim over the live windows is replaced by DP-1's own wallpaper, read from ~/.config/wallp/wall_h on each open and drawn opaque, so the previews sit on what looks like an empty desktop the way Mission Control does it. A light 40% Theme.base layer stays on top of it, because a bright wallpaper at full strength glared behind the previews. The overlay fades in over 220ms instead of appearing at once. The fade waits for the image to decode (or to fail, or for there to be no wallp file), otherwise Theme.base would flash first. Opacity is derived from the image status rather than starting at 1, so the initial Null status cannot play a 1-to-0 animation. Closing is still instant: fading out would keep the layer surface alive past the 60ms focus timer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
-rw-r--r--window-switcher/README.md4
-rw-r--r--window-switcher/Switcher.qml32
2 files changed, 33 insertions, 3 deletions
diff --git a/window-switcher/README.md b/window-switcher/README.md
index 3a32bc5..faefeb1 100644
--- a/window-switcher/README.md
+++ b/window-switcher/README.md
@@ -1,6 +1,6 @@
# window-switcher
-Every open window as a live preview, scattered over a dimmed DP-1 the way
+Every open window as a live preview, scattered over DP-1's wallpaper, lightly dimmed, the way
macOS Mission Control does it. ALT+TAB or the top-right corner of DP-1 opens
it, a click picks a window, Escape drops it. It replaced a uniform grid, which
replaced a rofi list.
@@ -33,7 +33,7 @@ theme with `Quickshell.iconPath`. Hot reload does not follow the symlink, so
after editing `Workspaces.qml` reload both. A named workspace, or one past eight, has no
icon and falls back to `[name]`.
-With nothing to switch to it says so, because a full-screen dim with nothing in
+With nothing to switch to it says so, because an empty desktop with nothing in
it reads as a hang.
## Running it
diff --git a/window-switcher/Switcher.qml b/window-switcher/Switcher.qml
index 3bc6a86..88924d8 100644
--- a/window-switcher/Switcher.qml
+++ b/window-switcher/Switcher.qml
@@ -10,6 +10,7 @@
// GNU General Public License for more details.
import Quickshell
+import Quickshell.Io
import Quickshell.Wayland
import QtQuick
import "Expose.js" as Expose
@@ -94,9 +95,38 @@ Scope {
Keys.onUpPressed: scatter.move(0, -1)
Keys.onDownPressed: scatter.move(0, 1)
+ // The bare desktop: DP-1's wallpaper, lightly dimmed, drawn opaque over the
+ // real windows, so the previews sit on an empty screen rather
+ // than a dim. Theme.base stands in without wallp. The whole
+ // overlay fades in once the picture is decoded, so the real
+ // windows dissolve into it instead of being swapped out.
Rectangle {
anchors.fill: parent
- color: Qt.rgba(Theme.base.r, Theme.base.g, Theme.base.b, 0.82)
+ color: Theme.base
+ opacity: wallImage.status === Image.Ready || wallImage.status === Image.Error || wallImage.source == "" ? 1 : 0
+ Behavior on opacity { NumberAnimation { duration: 220; easing.type: Easing.OutCubic } }
+
+ Image {
+ id: wallImage
+ anchors.fill: parent
+ source: wallFile.text().trim() !== "" ? "file://" + wallFile.text().trim() : ""
+ fillMode: Image.PreserveAspectCrop
+ asynchronous: true
+ cache: false
+ }
+
+ // A light dim over the wallpaper: a bright picture at full
+ // strength glares behind the previews.
+ Rectangle {
+ anchors.fill: parent
+ color: Qt.rgba(Theme.base.r, Theme.base.g, Theme.base.b, 0.4)
+ }
+
+ FileView {
+ id: wallFile
+ path: Quickshell.env("HOME") + "/.config/wallp/wall_h"
+ blockLoading: true
+ }
MouseArea {
anchors.fill: parent