diff options
Diffstat (limited to 'window-switcher')
| -rw-r--r-- | window-switcher/README.md | 4 | ||||
| -rw-r--r-- | window-switcher/Switcher.qml | 32 |
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 |
