diff options
| author | Don Williams <Don.e.williams@gmail.com> | 2026-07-13 16:15:49 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:40:35 -0700 |
| commit | c8b343b98c203ac13d4b28bb269a735cf4c03475 (patch) | |
| tree | c76921ca2309c9595fdd02045f33fe9f1684176b | |
| parent | dcc2b56bd34846c5e8562bdb33ea63f3734d5ec0 (diff) | |
Cleaning up quickshell builds
Signed-off-by: Don Williams <Don.e.williams@gmail.com>
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
deleted: overview-trixie/README.md
deleted: overview-trixie/assets/Workspace_Wallpaper.png
deleted: overview-trixie/assets/image.png
deleted: overview-trixie/common/Appearance.qml
deleted: overview-trixie/common/Config.qml
deleted: overview-trixie/common/functions/ColorUtils.qml
deleted: overview-trixie/common/functions/qmldir
deleted: overview-trixie/common/qmldir
deleted: overview-trixie/common/widgets/StyledRectangularShadow.qml
deleted: overview-trixie/common/widgets/StyledText.qml
deleted: overview-trixie/common/widgets/StyledToolTip.qml
deleted: overview-trixie/common/widgets/StyledToolTipContent.qml
deleted: overview-trixie/common/widgets/qmldir
deleted: overview-trixie/config.example.json
deleted: overview-trixie/config.json
deleted: overview-trixie/modules/overview/Overview.qml
deleted: overview-trixie/modules/overview/OverviewWidget.qml
deleted: overview-trixie/modules/overview/OverviewWindow.qml
deleted: overview-trixie/modules/overview/qmldir
deleted: overview-trixie/quickshell-overview.qml
deleted: overview-trixie/services/GlobalStates.qml
deleted: overview-trixie/services/HyprlandData.qml
deleted: overview-trixie/services/qmldir
deleted: overview-trixie/shell.qml
deleted: overview-unified/README.md
deleted: overview-unified/assets/image.png
deleted: overview-unified/common/Appearance.qml
deleted: overview-unified/common/Config.qml
deleted: overview-unified/common/functions/ColorUtils.qml
deleted: overview-unified/common/functions/qmldir
deleted: overview-unified/common/qmldir
deleted: overview-unified/common/widgets/RectangularShadow.qml
deleted: overview-unified/common/widgets/StyledRectangularShadow.qml
deleted: overview-unified/common/widgets/StyledText.qml
deleted: overview-unified/common/widgets/StyledToolTip.qml
deleted: overview-unified/common/widgets/StyledToolTipContent.qml
deleted: overview-unified/common/widgets/qmldir
deleted: overview-unified/modules/overview/Overview.qml
deleted: overview-unified/modules/overview/OverviewWidget.qml
deleted: overview-unified/modules/overview/OverviewWindow.qml
deleted: overview-unified/modules/overview/qmldir
deleted: overview-unified/services/GlobalStates.qml
deleted: overview-unified/services/HyprlandData.qml
deleted: overview-unified/services/qmldir
deleted: overview-unified/shell.qml
renamed: overview-trixie/common/widgets/RectangularShadow.qml -> overview/common/widgets/RectangularShadow.qml
modified: overview/common/widgets/qmldir
deleted: qs-hyprview-unified/LICENSE
deleted: qs-hyprview-unified/README.md
deleted: qs-hyprview-unified/common/Appearance.qml
deleted: qs-hyprview-unified/layouts/BandsLayout.qml
deleted: qs-hyprview-unified/layouts/ColumnarLayout.qml
deleted: qs-hyprview-unified/layouts/HeroLayout.qml
deleted: qs-hyprview-unified/layouts/JustifiedLayout.qml
deleted: qs-hyprview-unified/layouts/LayoutsManager.qml
deleted: qs-hyprview-unified/layouts/MasonryLayout.qml
deleted: qs-hyprview-unified/layouts/SatelliteLayout.qml
deleted: qs-hyprview-unified/layouts/SmartGridLayout.qml
deleted: qs-hyprview-unified/layouts/SpiralLayout.qml
deleted: qs-hyprview-unified/layouts/StarggeredLayout.qml
deleted: qs-hyprview-unified/layouts/VortexLayout.qml
deleted: qs-hyprview-unified/layouts/qmldir
deleted: qs-hyprview-unified/modules/Hyprview.qml
deleted: qs-hyprview-unified/modules/SearchBox.qml
deleted: qs-hyprview-unified/modules/WindowThumbnail.qml
deleted: qs-hyprview-unified/modules/qmldir
deleted: qs-hyprview-unified/qs-hyprview-template.qml
deleted: qs-hyprview-unified/screenshots/bands.jpeg
deleted: qs-hyprview-unified/screenshots/hero.jpeg
deleted: qs-hyprview-unified/screenshots/masonry.jpeg
deleted: qs-hyprview-unified/screenshots/satellite.jpeg
deleted: qs-hyprview-unified/screenshots/smartgrid.jpeg
deleted: qs-hyprview-unified/screenshots/spiral.jpeg
deleted: qs-hyprview-unified/screenshots/staggered.jpeg
deleted: qs-hyprview-unified/screenshots/vortex.jpeg
deleted: qs-hyprview-unified/shell.qml
modified: qs-hyprview/modules/WindowThumbnail.qml
77 files changed, 5 insertions, 7854 deletions
diff --git a/config/quickshell/overview-trixie/README.md b/config/quickshell/overview-trixie/README.md deleted file mode 100644 index 64dd8b68..00000000 --- a/config/quickshell/overview-trixie/README.md +++ /dev/null @@ -1,702 +0,0 @@ -# Quickshell Overview for Hyprland - -<div align="center"> - -A standalone workspace overview module for Hyprland using Quickshell - shows all workspaces with live window previews, drag-and-drop support, and Super+Tab keybind. - - - - - - - -</div> - ---- - -## 📸 Preview - - - -https://github.com/user-attachments/assets/e8f392d7-d831-4dec-9cd3-fb93d1ccc21c - -> *Workspace overview showing live window previews with drag-and-drop support* - ---- - -## ✨ Features - -- 🖼️ Visual workspace overview showing all workspaces and windows -- 🖥️ Multi-monitor support with proper scaling and vertical/rotated monitors [in experimental branch] -- 📐 Smart row hiding - optionally hide empty workspace rows -- 🎯 Click windows to focus them -- 🖱️ Middle-click windows to close them -- 🔄 Drag and drop windows between workspaces -- ⌨️ Keyboard navigation (Arrow keys, vim keys, number shortcuts) -- 🖱️ Auto-close on focus loss / outside click -- 💡 Hover tooltips showing window information -- 🎨 Material Design 3 theming -- ⚡ Smooth animations and transitions - -## 📦 Installation - -### Arch Linux (AUR) - -For Arch Linux users, you can install directly from the AUR: - -```bash -# Using yay -yay -S quickshell-overview-git - -# Using paru -paru -S quickshell-overview-git -``` - -On AUR installs, module files are package-managed under: - -```text -/etc/xdg/quickshell/overview/ -``` - -Put your custom settings in: - -```text -~/.config/quickshell/overview/config.json -``` - -Then add the keybind and auto-start to your Hyprland config (see Setup steps 2-4 below). - -### Prerequisites - -- **Hyprland** compositor -- **Quickshell** ([installation guide](https://quickshell.org/docs/v0.1.0/guide/install-setup/)) -- **Qt 6** with modules: QtQuick, QtQuick.Controls - -### Setup - -1. **Install module files** (choose one): - - **Git clone (manual install):** - ```bash - git clone https://github.com/Shanu-Kumawat/quickshell-overview ~/.config/quickshell/overview - ``` - - **AUR package:** use the command above (`yay -S quickshell-overview-git` or `paru -S ...`) - -2. **Add keybind** to your Hyprland config: - - *For Hyprland 0.55+ (`~/.config/hypr/hyprland.lua`):* - ```lua - hl.bind("SUPER + TAB", hl.dsp.exec_cmd("qs ipc -c overview call overview toggle")) - ``` - *For Hyprland 0.54 and older (`~/.config/hypr/hyprland.conf`):* - ```conf - bind = Super, TAB, exec, qs ipc -c overview call overview toggle - ``` - -4. **Auto-start** the overview (add to Hyprland config): - - *For Hyprland 0.55+ (`~/.config/hypr/hyprland.lua`):* - ```lua - hl.on("hyprland.start", function () - hl.exec_cmd("qs -c overview") - end) - ``` - *For Hyprland 0.54 and older (`~/.config/hypr/hyprland.conf`):* - ```conf - exec-once = qs -c overview - ``` - -6. **Reload Hyprland**: - ```bash - hyprctl reload - ``` - -### Manual Start (if needed) - -```bash -qs -c overview & -``` - -### NixOS - -For NixOS users, ensure Quickshell has access to required Qt6 modules: - -```nix -# In your configuration.nix or home-manager config -environment.systemPackages = with pkgs; [ - quickshell - qt6.qtwayland -]; -``` - -If you're using home-manager: - -```nix -home.packages = with pkgs; [ - quickshell - qt6.qtwayland -]; -``` - -## 🎮 Usage - -| Action | Description | -|--------|-------------| -| **Super + Tab** | Toggle the overview | -| **Arrow Keys / h/l** | Navigate left/right within current row* | -| **Up/Down / j/k** | Navigate between workspace rows | -| **1-9, 0** | Jump to Nth workspace in current group (0 = 10th) | -| **Mouse wheel on grid** | Move across all normal workspaces, wrapping from last to first | -| **Escape / Enter** | Close the overview | -| **Click outside overview** | Close the overview when `overview.closeOnFocusLoss` is enabled (default) | -| **Click workspace** | Switch to that workspace | -| **Click window** | Focus that window | -| **Middle-click window** | Close that window | -| **Drag window** | Move window to different workspace | - -> *When `hideEmptyRows` is enabled, left/right navigation wraps within the current visible row for better UX - ---- - -## ⚙️ Configuration - -> **⚠️ Want to change size, position, workspace count, or toggles?** -> Create/edit `~/.config/quickshell/overview/config.json`. - -`Config.qml` inside the module is now treated as defaults. User overrides are read from: - -- `$XDG_CONFIG_HOME/quickshell/overview/config.json` -- fallback: `~/.config/quickshell/overview/config.json` - -> **Note:** After editing `config.json`, manually restart overview for changes to apply: -> `qs ipc -c overview call overview close && qs -c overview` - -### Quick Start - -```bash -mkdir -p ~/.config/quickshell/overview -cp /etc/xdg/quickshell/overview/config.example.json ~/.config/quickshell/overview/config.json -``` - -If you installed from git clone instead of AUR, copy from your repo path: - -```bash -cp ~/.config/quickshell/overview/config.example.json ~/.config/quickshell/overview/config.json -``` - -### Workspace Grid - -Edit `~/.config/quickshell/overview/config.json`: - -```json -{ - "overview": { - "rows": 2, - "columns": 5, - "scale": 0.16, - "enable": true, - "hideEmptyRows": true, - "closeOnFocusLoss": true, - "useWorkspaceMap": false, - "workspaceMap": [0, 10], - "orderRightLeft": false, - "orderBottomUp": false, - "previewsEnabled": true, - "previewMode": "live", - "includeInactiveMonitorPreviews": true, - "previewRecaptureDelayMs": 60, - "showSpecialWorkspaces": true, - "specialWorkspaces": [], - "specialWorkspaceColumns": 5, - "emptyWorkspaceWallpaper": "", - "specialEmptyWorkspaceWallpaper": "", - "effects": { - "enableBackdrop": false, - "backdropOpacity": 0.28, - "panelOpacity": 0.92, - "workspaceOpacity": 0.86, - "emptyWorkspaceWallpaperOverlayOpacity": 0.18, - "windowOverlayOpacity": 0.22, - "enableBlur": false, - "glassMode": false, - "glassTintStrength": 0.35, - "glassBorderOpacity": 0.72, - "glassShineOpacity": 0.14 - }, - "workspaceSpacing": 5, - "backgroundPadding": 10, - "workspaceNumberBaseSize": 250 - } -} -``` - -**Common adjustments:** -- **Too small?** Increase `scale` (try 0.20 or 0.25) -- **Too big?** Decrease `scale` (try 0.12 or 0.14) -- **More workspaces?** Change `rows` and `columns` (e.g., 3 rows × 4 columns = 12 workspaces) -- **Reverse order?** Set `orderRightLeft` and/or `orderBottomUp` to `true` -- **Prefer the overview to stay open after outside clicks/focus changes?** Set `closeOnFocusLoss` to `false` -- **Per-monitor workspace groups?** Enable `useWorkspaceMap` and set `workspaceMap` (e.g. `[0,10]`) -- **Show special workspaces below grid?** Keep `showSpecialWorkspaces: true` and optionally prefill `specialWorkspaces` -- **Lower memory use?** Set `previewMode` to `event` and `includeInactiveMonitorPreviews` to `false` -- **Transparency / blur?** Tune `overview.effects.*` (details below) - -**Hide empty workspace rows:** -- Set `hideEmptyRows: true` to automatically hide rows that have no windows -- Keeps your overview clean by only showing rows with active workspaces -- The current workspace row is always visible, even if empty -- Arrow key navigation (left/right) stays within the current row when enabled -- Great for 2-row setups where you rarely use workspaces 6-10 - -**Close on focus loss / outside click:** -- `closeOnFocusLoss` defaults to `true` -- When enabled, clicking outside the overview closes it, similar to menus, dropdowns, and launchers -- The overview also closes when its Hyprland focus grab is cleared -- Set `closeOnFocusLoss: false` if you want the previous behavior where the overview can remain open after focus changes - -### Position - -Edit `~/.config/quickshell/overview/config.json`: - -```json -{ - "position": { - "topMargin": 100 - } -} -``` - -Increase `topMargin` to move the overview down. Decrease it to move up. - -### Window Preview - -```json -{ - "windowPreview": { - "showIcons": true, - "iconToWindowRatio": 0.25, - "iconToWindowRatioCompact": 0.45, - "xwaylandIndicatorToIconRatio": 0.35, - "inactiveMonitorOpacity": 0.4, - "cropToFill": false - } -} -``` - -- `cropToFill`: crop full-screen windows to fill the workspace preview when `true`; keep the full window in preview with possible horizontal/vertical "padding" bars when `false` - -### Performance Tuning - -```json -{ - "overview": { - "previewsEnabled": true, - "previewMode": "live", - "includeInactiveMonitorPreviews": true, - "previewRecaptureDelayMs": 60 - }, - "hacks": { - "hyprlandEventDebounceMs": 40 - } -} -``` - -- `overview.previewsEnabled`: turn all window screencopy previews on/off -- `overview.previewMode`: `live` (best visuals, more RAM) or `event` (lower RAM, refreshes on window events) -- `overview.includeInactiveMonitorPreviews`: when `false`, only current monitor windows get preview capture -- `overview.previewRecaptureDelayMs`: delay used for event-mode snapshot refresh (lower = faster updates) -- `hacks.hyprlandEventDebounceMs`: coalesces Hyprland event refreshes to reduce command churn - -### Special Workspaces - -```json -{ - "overview": { - "showSpecialWorkspaces": true, - "specialWorkspaces": ["stash", "music", "scratch"], - "specialWorkspaceColumns": 5 - } -} -``` - -- `showSpecialWorkspaces`: renders special workspaces in a strip under the normal grid -- `specialWorkspaces`: optional preconfigured special workspace names (without the `special:` prefix) -- `specialWorkspaceColumns`: how many special tiles per row before wrapping -- `emptyWorkspaceWallpaper`: optional image path used as the background for normal workspace tiles -- `specialEmptyWorkspaceWallpaper`: optional image path used as the background for special workspace tiles - -Interaction behavior: -- Preconfigured special workspaces appear in the overview even when they are empty -- The special strip shows active special workspaces plus any names you preconfigure -- This is useful for fixed workflows like `stash`, `music`, or `scratch` -- Click a special tile to run `togglespecialworkspace <name>` -- Click the `+` tile to create and open a new special workspace -- Drag a window onto a special tile to move it with `movetoworkspacesilent special:<name>` -- Drag a window onto the `+` tile to auto-create a new special workspace (`stash`, `stash-2`, ...), even when no special workspace is currently open or preconfigured -- Special windows are visible directly in those tiles -- Restart Quickshell after changing `config.json`, otherwise the special workspace list will not refresh immediately - -Normal workspace scrolling: -- Scroll on the normal workspace grid to move the active workspace/highlighter across all normal workspaces -- Scrolling wraps from the last workspace back to `1`, and from `1` back to the last - -### Workspace Wallpaper - -```json -{ - "overview": { - "emptyWorkspaceWallpaper": "/home/your-user/Pictures/wallpaper.png", - "specialEmptyWorkspaceWallpaper": "/home/your-user/Pictures/special-wallpaper.png", - "effects": { - "emptyWorkspaceWallpaperOverlayOpacity": 0.12 - } - } -} -``` - -- Normal workspaces can use a wallpaper as their background -- Special workspaces can use a different wallpaper as their background -- The wallpaper remains visible behind floating or partially covered windows -- If no special workspaces exist yet, that special wallpaper is also used for the `+` create tile -- `emptyWorkspaceWallpaperOverlayOpacity` controls how much tint is applied over that wallpaper -- Use an absolute path for the image for the most reliable behavior -- Restart Quickshell after changing `config.json`, otherwise the wallpaper path will not refresh immediately - -Demo: - - - -### Transparency & Blur - -```json -{ - "overview": { - "effects": { - "enableBackdrop": false, - "backdropOpacity": 0.28, - "panelOpacity": 0.92, - "workspaceOpacity": 0.86, - "emptyWorkspaceWallpaperOverlayOpacity": 0.18, - "windowOverlayOpacity": 0.22, - "enableBlur": false, - "glassMode": false, - "glassTintStrength": 0.35, - "glassBorderOpacity": 0.72, - "glassShineOpacity": 0.14 - } - } -} -``` - -- `enableBackdrop`: show/hide full-screen dim backdrop behind overview -- `backdropOpacity`: opacity of backdrop dim layer (`0` to `1`) -- `panelOpacity`: opacity of overview panel container (`0` to `1`) -- `workspaceOpacity`: opacity of each workspace tile (`0` to `1`) -- `emptyWorkspaceWallpaperOverlayOpacity`: tint strength over empty-workspace wallpaper (`0` to `1`) -- `windowOverlayOpacity`: opacity of the color tint over window previews (`0` to `1`) -- `enableBlur`: switches layer namespace to `quickshell:overview-blur` -- `glassMode`: enables a glass-like tint + softer transparency preset for panel/workspaces/windows -- `glassTintStrength`: tint mixing strength for glass mode (`0` to `1`) -- `glassBorderOpacity`: border alpha used by glass mode (`0` to `1`) -- `glassShineOpacity`: top highlight strength for glass reflections (`0` to `1`) - -Stronger glass preset: - -```json -{ - "overview": { - "effects": { - "enableBackdrop": true, - "enableBlur": true, - "panelOpacity": 0.55, - "workspaceOpacity": 0.48, - "emptyWorkspaceWallpaperOverlayOpacity": 0.10, - "windowOverlayOpacity": 0.08, - "glassMode": true, - "glassTintStrength": 0.55, - "glassBorderOpacity": 0.85, - "glassShineOpacity": 0.32 - } - } -} -``` - -For Hyprland blur, add layer rules (example): - -```ini -layerrule = blur true, match:namespace quickshell:overview-blur -layerrule = ignore_alpha 0.2, match:namespace quickshell:overview-blur -``` - -If `enableBlur` is `false`, namespace remains `quickshell:overview`. - -Low-memory preset: - -```json -{ - "overview": { - "previewMode": "event", - "includeInactiveMonitorPreviews": false - }, - "hacks": { - "hyprlandEventDebounceMs": 80 - } -} -``` - -### Full Example - -```json -{ - "appearance": { - "colorSource": "default", - "caelestia": { - "autoRefresh": true, - "refreshInterval": 2000, - "accentProfile": "vibrant" - }, - "rounding": { - "unsharpen": 2, - "verysmall": 8, - "small": 12, - "normal": 17, - "large": 23, - "full": 9999, - "screenRounding": 23, - "windowRounding": 18 - }, - "font": { - "family": { - "main": "sans-serif", - "title": "sans-serif", - "expressive": "sans-serif" - }, - "pixelSize": { - "smaller": 12, - "small": 15, - "normal": 16, - "larger": 19, - "huge": 22 - } - }, - "animation": { - "duration": { - "elementMove": 500, - "elementMoveEnter": 400, - "elementMoveFast": 200 - } - }, - "sizes": { - "elevationMargin": 10 - } - }, - "overview": { - "rows": 2, - "columns": 5, - "scale": 0.16, - "enable": true, - "hideEmptyRows": true, - "closeOnFocusLoss": true, - "useWorkspaceMap": false, - "workspaceMap": [0, 10], - "orderRightLeft": false, - "orderBottomUp": false, - "previewsEnabled": true, - "previewMode": "live", - "includeInactiveMonitorPreviews": true, - "previewRecaptureDelayMs": 60, - "showSpecialWorkspaces": true, - "specialWorkspaces": [], - "specialWorkspaceColumns": 5, - "emptyWorkspaceWallpaper": "", - "specialEmptyWorkspaceWallpaper": "", - "effects": { - "enableBackdrop": false, - "backdropOpacity": 0.28, - "panelOpacity": 0.92, - "workspaceOpacity": 0.86, - "emptyWorkspaceWallpaperOverlayOpacity": 0.18, - "windowOverlayOpacity": 0.22, - "enableBlur": false, - "glassMode": false, - "glassTintStrength": 0.35, - "glassBorderOpacity": 0.72, - "glassShineOpacity": 0.14 - }, - "workspaceSpacing": 5, - "backgroundPadding": 10, - "workspaceNumberBaseSize": 250 - }, - "position": { - "topMargin": 100 - }, - "windowPreview": { - "showIcons": true, - "iconToWindowRatio": 0.25, - "iconToWindowRatioCompact": 0.45, - "xwaylandIndicatorToIconRatio": 0.35, - "inactiveMonitorOpacity": 0.4, - "cropToFill": false - }, - "hacks": { - "arbitraryRaceConditionDelay": 150, - "hyprlandEventDebounceMs": 40 - } -} -``` - -### Theme & Colors - -Most theme sizing/timing options are now configurable via `config.json`: -- `appearance.colorSource` (`default`, `matugen`, `caelestia`) -- `appearance.caelestia.*` (`autoRefresh`, `refreshInterval`, `accentProfile`) -- `appearance.rounding.*` -- `appearance.font.*` -- `appearance.animation.duration.*` -- `appearance.sizes.elevationMargin` - -For full color palette customization, edit `~/.config/quickshell/overview/common/Appearance.qml`. - -### Matugen (Dynamic Colors from Wallpaper) - -[Matugen](https://github.com/InioX/matugen) lets you generate Material You colors from your wallpaper and apply them to the overview automatically. - -**1. Install matugen** - follow [matugen's install guide](https://github.com/InioX/matugen?tab=readme-ov-file#installation) - -**2. Copy the template** from this repo to matugen's templates folder: -```bash -mkdir -p ~/.config/matugen/templates -cp ~/.config/quickshell/overview/quickshell-overview.qml ~/.config/matugen/templates/ -``` - -**3. Add this to `~/.config/matugen/config.toml`** (create the file if it doesn't exist): -```toml -[templates.quickshell_overview] -input_path = "./templates/quickshell-overview.qml" -output_path = "~/.config/quickshell/overview/common/Appearance.colors.qml" -``` - -**4. Enable it** in `~/.config/quickshell/overview/config.json`: -```json -{ - "appearance": { - "colorSource": "matugen" - } -} -``` - -**5. Run matugen** with your wallpaper to generate colors: -```bash -matugen image /path/to/your/wallpaper.jpg -``` - -This generates `Appearance.colors.qml` which the overview loads automatically. Re-run step 5 whenever you change your wallpaper. - -### Caelestia - -If you use Caelestia, set the source to `caelestia`: - -```json -{ - "appearance": { - "colorSource": "caelestia", - "caelestia": { - "autoRefresh": true, - "refreshInterval": 2000, - "accentProfile": "vibrant" - } - } -} -``` - -Overview reads the active palette from `caelestia scheme get` and refreshes it live when `autoRefresh` is enabled, so wallpaper/scheme changes can apply without restarting overview. - ---- - -## 📋 Requirements - -- **Hyprland** compositor (tested on latest versions) -- **Quickshell** (Qt6-based shell framework) -- **Qt 6** with the following modules: - - QtQuick - - QtQuick.Controls - - QtQuick.Layouts - - Quickshell.Wayland - - Quickshell.Hyprland - -## 🚫 Removed Features (from original illogical-impulse) - -The following features were removed to make it standalone: - -- App search functionality -- Emoji picker -- Clipboard history integration -- Search widget -- Integration with the full illogical-impulse shell ecosystem - -## 📁 File Structure - -``` -~/.config/quickshell/overview/ -├── shell.qml # Main entry point -├── README.md # This file -├── config.example.json # User override template -├── hyprland-config.conf # Configuration reference -├── common/ -│ ├── Appearance.qml # Theme and styling -│ ├── Config.qml # Default config + user override loader -│ ├── functions/ -│ │ └── ColorUtils.qml # Color manipulation utilities -│ └── widgets/ -│ ├── StyledText.qml # Styled text component -│ ├── StyledRectangularShadow.qml -│ ├── StyledToolTip.qml -│ └── StyledToolTipContent.qml -├── services/ -│ ├── GlobalStates.qml # Global state management -│ └── HyprlandData.qml # Hyprland data provider -└── modules/ - └── overview/ - ├── Overview.qml # Main overview component - ├── OverviewWidget.qml # Workspace grid widget - └── OverviewWindow.qml # Individual window preview -``` - -## 🎯 IPC Commands - -```bash -# Toggle overview -qs ipc -c overview call overview toggle - -# Open overview -qs ipc -c overview call overview open - -# Close overview -qs ipc -c overview call overview close -``` - -## 🐛 Known Issues - -- Window icons may fallback to generic icon if app class name doesn't match icon theme -- Potential crashes during rapid window state changes due to Wayland screencopy buffer management - -## 💖 Support - -If this project helps your setup and you want to support continued maintenance, you can sponsor here: - -https://github.com/sponsors/Shanu-Kumawat - -## Credits - -Extracted from the overview feature in [illogical-impulse](https://github.com/end-4/dots-hyprland) by [end-4](https://github.com/end-4). - -Adapted as a standalone component for Hyprland + Quickshell users who want just the overview functionality. - ---- - -<div align="center"> - -**Note:** Maintenance will be limited due to time constraints, but **PRs and code improvements are welcome!** Feel free to contribute or fork for your own needs. - -Made with ❤️ for the Hyprland community - -</div> diff --git a/config/quickshell/overview-trixie/assets/Workspace_Wallpaper.png b/config/quickshell/overview-trixie/assets/Workspace_Wallpaper.png Binary files differdeleted file mode 100644 index 8739046b..00000000 --- a/config/quickshell/overview-trixie/assets/Workspace_Wallpaper.png +++ /dev/null diff --git a/config/quickshell/overview-trixie/assets/image.png b/config/quickshell/overview-trixie/assets/image.png Binary files differdeleted file mode 100644 index 41d94892..00000000 --- a/config/quickshell/overview-trixie/assets/image.png +++ /dev/null diff --git a/config/quickshell/overview-trixie/common/Appearance.qml b/config/quickshell/overview-trixie/common/Appearance.qml deleted file mode 100644 index f97a0dfa..00000000 --- a/config/quickshell/overview-trixie/common/Appearance.qml +++ /dev/null @@ -1,356 +0,0 @@ -pragma Singleton -pragma ComponentBehavior: Bound - -import QtQuick -import Quickshell -import Quickshell.Io -import "functions" -import "." as Common - -Singleton { - id: root - property string colorSource: Common.Config.options.appearance.colorSource - property string caelestiaAccentProfile: Common.Config.options.appearance.caelestia.accentProfile - property string lastCaelestiaPayload: "" - property QtObject m3colors: { - if (colorSource === "matugen" && matugenLoader.item) - return matugenLoader.item; - if (colorSource === "caelestia" && caelestiaPaletteLoaded) - return caelestiaColors; - return defaultColors; - } - property QtObject animation - property QtObject animationCurves - property QtObject colors - property QtObject rounding - property QtObject font - property QtObject sizes - property bool caelestiaPaletteLoaded: false - - Loader { - id: matugenLoader - active: root.colorSource === "matugen" - source: "Appearance.colors.qml" - } - - property QtObject defaultColors: QtObject { - property bool darkmode: true - property color m3primary: "#E5B6F2" - property color m3onPrimary: "#452152" - property color m3primaryContainer: "#5D386A" - property color m3onPrimaryContainer: "#F9D8FF" - property color m3secondary: "#D5C0D7" - property color m3onSecondary: "#392C3D" - property color m3secondaryContainer: "#534457" - property color m3onSecondaryContainer: "#F2DCF3" - property color m3background: "#161217" - property color m3onBackground: "#EAE0E7" - property color m3surface: "#161217" - property color m3surfaceContainerLow: "#1F1A1F" - property color m3surfaceContainer: "#231E23" - property color m3surfaceContainerHigh: "#2D282E" - property color m3surfaceContainerHighest: "#383339" - property color m3onSurface: "#EAE0E7" - property color m3surfaceVariant: "#4C444D" - property color m3onSurfaceVariant: "#CFC3CD" - property color m3inverseSurface: "#EAE0E7" - property color m3inverseOnSurface: "#342F34" - property color m3outline: "#988E97" - property color m3outlineVariant: "#4C444D" - property color m3shadow: "#000000" - } - - property QtObject caelestiaColors: QtObject { - property bool darkmode: defaultColors.darkmode - property color m3primary: defaultColors.m3primary - property color m3onPrimary: defaultColors.m3onPrimary - property color m3primaryContainer: defaultColors.m3primaryContainer - property color m3onPrimaryContainer: defaultColors.m3onPrimaryContainer - property color m3secondary: defaultColors.m3secondary - property color m3onSecondary: defaultColors.m3onSecondary - property color m3secondaryContainer: defaultColors.m3secondaryContainer - property color m3onSecondaryContainer: defaultColors.m3onSecondaryContainer - property color m3background: defaultColors.m3background - property color m3onBackground: defaultColors.m3onBackground - property color m3surface: defaultColors.m3surface - property color m3surfaceContainerLow: defaultColors.m3surfaceContainerLow - property color m3surfaceContainer: defaultColors.m3surfaceContainer - property color m3surfaceContainerHigh: defaultColors.m3surfaceContainerHigh - property color m3surfaceContainerHighest: defaultColors.m3surfaceContainerHighest - property color m3onSurface: defaultColors.m3onSurface - property color m3surfaceVariant: defaultColors.m3surfaceVariant - property color m3onSurfaceVariant: defaultColors.m3onSurfaceVariant - property color m3inverseSurface: defaultColors.m3inverseSurface - property color m3inverseOnSurface: defaultColors.m3inverseOnSurface - property color m3outline: defaultColors.m3outline - property color m3outlineVariant: defaultColors.m3outlineVariant - property color m3shadow: defaultColors.m3shadow - } - - function loadCaelestiaPalette() { - getCaelestiaScheme.running = true; - } - - function relativeLuminance(color) { - const c = Qt.color(color); - function channel(v) { - return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); - } - return (0.2126 * channel(c.r)) + (0.7152 * channel(c.g)) + (0.0722 * channel(c.b)); - } - - function bestOnColor(backgroundColor) { - return relativeLuminance(backgroundColor) > 0.5 ? "#121212" : "#f5f5f5"; - } - - function firstColor(palette, keys, fallback) { - for (const key of keys) { - if (palette[key]) - return palette[key]; - } - return fallback; - } - - function applyCaelestiaPalette(palette, mode) { - if (caelestiaAccentProfile === "vibrant") { - const primary = firstColor(palette, ["blue", "klink", "term12", "primary"], defaultColors.m3primary); - const secondary = firstColor(palette, ["mauve", "lavender", "term13", "secondary"], defaultColors.m3secondary); - const tertiary = firstColor(palette, ["pink", "rosewater", "term11", "tertiary"], defaultColors.m3secondaryContainer); - const primaryContainer = firstColor(palette, ["sapphire", "klinkSelection", "primaryContainer"], defaultColors.m3primaryContainer); - const secondaryContainer = firstColor(palette, ["surface2", "secondaryContainer"], defaultColors.m3secondaryContainer); - - caelestiaColors.m3primary = primary; - caelestiaColors.m3onPrimary = bestOnColor(primary); - caelestiaColors.m3primaryContainer = primaryContainer; - caelestiaColors.m3onPrimaryContainer = bestOnColor(primaryContainer); - caelestiaColors.m3secondary = secondary; - caelestiaColors.m3onSecondary = bestOnColor(secondary); - caelestiaColors.m3secondaryContainer = secondaryContainer; - caelestiaColors.m3onSecondaryContainer = bestOnColor(secondaryContainer); - // Preserve a stronger accent presence across UI mixes. - caelestiaColors.m3surfaceVariant = firstColor(palette, ["surface1", "surfaceVariant"], defaultColors.m3surfaceVariant); - caelestiaColors.m3outline = firstColor(palette, ["overlay2", "outline"], defaultColors.m3outline); - caelestiaColors.m3outlineVariant = firstColor(palette, ["overlay0", "outlineVariant"], defaultColors.m3outlineVariant); - if (tertiary) - caelestiaColors.m3secondaryContainer = ColorUtils.mix(secondaryContainer, tertiary, 0.7); - } else { - const map = { - "primary": "m3primary", - "onPrimary": "m3onPrimary", - "primaryContainer": "m3primaryContainer", - "onPrimaryContainer": "m3onPrimaryContainer", - "secondary": "m3secondary", - "onSecondary": "m3onSecondary", - "secondaryContainer": "m3secondaryContainer", - "onSecondaryContainer": "m3onSecondaryContainer", - "surfaceVariant": "m3surfaceVariant", - "outline": "m3outline", - "outlineVariant": "m3outlineVariant" - }; - for (const key in map) { - if (palette[key]) - caelestiaColors[map[key]] = palette[key]; - } - } - - // Keep foundational tones from Material keys for readability. - const baseMap = { - "background": "m3background", - "onBackground": "m3onBackground", - "surface": "m3surface", - "surfaceContainerLow": "m3surfaceContainerLow", - "surfaceContainer": "m3surfaceContainer", - "surfaceContainerHigh": "m3surfaceContainerHigh", - "surfaceContainerHighest": "m3surfaceContainerHighest", - "onSurface": "m3onSurface", - "inverseSurface": "m3inverseSurface", - "inverseOnSurface": "m3inverseOnSurface", - "shadow": "m3shadow" - }; - for (const key in baseMap) { - if (palette[key]) - caelestiaColors[baseMap[key]] = palette[key]; - } - - if (palette["onSurfaceVariant"]) - caelestiaColors.m3onSurfaceVariant = palette["onSurfaceVariant"]; - - if (mode === "light") - caelestiaColors.darkmode = false; - else if (mode === "dark") - caelestiaColors.darkmode = true; - } - - Process { - id: getCaelestiaScheme - command: ["sh", "-lc", "caelestia scheme get 2>/dev/null || true"] - stdout: StdioCollector { - id: caelestiaCollector - onStreamFinished: { - const text = caelestiaCollector.text; - if (!text || !text.trim()) { - root.caelestiaPaletteLoaded = false; - return; - } - - const ansiPattern = /\x1b\[[0-9;]*m/g; - const lines = text.split("\n"); - let mode = ""; - const palette = ({}); - - for (const rawLine of lines) { - const line = rawLine.replace(ansiPattern, "").trim(); - - if (line.startsWith("Mode:")) { - mode = line.split(":")[1]?.trim()?.toLowerCase() ?? ""; - continue; - } - - const match = line.match(/^([A-Za-z0-9_]+):\s*.*?([0-9a-fA-F]{6})$/); - if (!match) - continue; - - palette[match[1]] = `#${match[2]}`; - } - - const normalized = JSON.stringify({ mode: mode, palette: palette, profile: caelestiaAccentProfile }); - if (normalized === root.lastCaelestiaPayload) - return; - - root.lastCaelestiaPayload = normalized; - applyCaelestiaPalette(palette, mode); - root.caelestiaPaletteLoaded = Object.keys(palette).length > 0; - } - } - } - - Timer { - id: caelestiaRefreshTimer - interval: Math.max(500, Common.Config.options.appearance.caelestia.refreshInterval) - running: root.colorSource === "caelestia" && Common.Config.options.appearance.caelestia.autoRefresh - repeat: true - triggeredOnStart: false - onTriggered: root.loadCaelestiaPalette() - } - - onColorSourceChanged: { - if (colorSource === "caelestia") - loadCaelestiaPalette(); - } - - onCaelestiaAccentProfileChanged: { - if (colorSource === "caelestia") { - root.lastCaelestiaPayload = ""; - loadCaelestiaPalette(); - } - } - - Component.onCompleted: { - if (colorSource === "caelestia") - loadCaelestiaPalette(); - } - - colors: QtObject { - property color colSubtext: m3colors.m3outline - property color colLayer0: m3colors.m3background - property color colOnLayer0: m3colors.m3onBackground - property color colLayer0Border: ColorUtils.mix(root.m3colors.m3outlineVariant, colLayer0, 0.4) - property color colLayer1: m3colors.m3surfaceContainerLow - property color colOnLayer1: m3colors.m3onSurfaceVariant - property color colOnLayer1Inactive: ColorUtils.mix(colOnLayer1, colLayer1, 0.45) - property color colLayer1Hover: ColorUtils.mix(colLayer1, colOnLayer1, 0.92) - property color colLayer1Active: ColorUtils.mix(colLayer1, colOnLayer1, 0.85) - property color colLayer2: m3colors.m3surfaceContainer - property color colOnLayer2: m3colors.m3onSurface - property color colLayer2Hover: ColorUtils.mix(colLayer2, colOnLayer2, 0.90) - property color colLayer2Active: ColorUtils.mix(colLayer2, colOnLayer2, 0.80) - property color colPrimary: m3colors.m3primary - property color colOnPrimary: m3colors.m3onPrimary - property color colSecondary: m3colors.m3secondary - property color colSecondaryContainer: m3colors.m3secondaryContainer - property color colOnSecondaryContainer: m3colors.m3onSecondaryContainer - property color colTooltip: m3colors.m3inverseSurface - property color colOnTooltip: m3colors.m3inverseOnSurface - property color colShadow: ColorUtils.transparentize(m3colors.m3shadow, 0.7) - property color colOutline: m3colors.m3outline - } - - rounding: QtObject { - property int unsharpen: Common.Config.options.appearance.rounding.unsharpen - property int verysmall: Common.Config.options.appearance.rounding.verysmall - property int small: Common.Config.options.appearance.rounding.small - property int normal: Common.Config.options.appearance.rounding.normal - property int large: Common.Config.options.appearance.rounding.large - property int full: Common.Config.options.appearance.rounding.full - property int screenRounding: Common.Config.options.appearance.rounding.screenRounding - property int windowRounding: Common.Config.options.appearance.rounding.windowRounding - } - - font: QtObject { - property QtObject family: QtObject { - property string main: Common.Config.options.appearance.font.family.main - property string title: Common.Config.options.appearance.font.family.title - property string expressive: Common.Config.options.appearance.font.family.expressive - } - property QtObject pixelSize: QtObject { - property int smaller: Common.Config.options.appearance.font.pixelSize.smaller - property int small: Common.Config.options.appearance.font.pixelSize.small - property int normal: Common.Config.options.appearance.font.pixelSize.normal - property int larger: Common.Config.options.appearance.font.pixelSize.larger - property int huge: Common.Config.options.appearance.font.pixelSize.huge - } - } - - animationCurves: QtObject { - readonly property list<real> expressiveDefaultSpatial: [0.38, 1.21, 0.22, 1.00, 1, 1] - readonly property list<real> expressiveEffects: [0.34, 0.80, 0.34, 1.00, 1, 1] - readonly property list<real> emphasizedDecel: [0.05, 0.7, 0.1, 1, 1, 1] - readonly property real expressiveDefaultSpatialDuration: Common.Config.options.appearance.animation.duration.elementMove - readonly property real expressiveEffectsDuration: Common.Config.options.appearance.animation.duration.elementMoveFast - } - - animation: QtObject { - property QtObject elementMove: QtObject { - property int duration: animationCurves.expressiveDefaultSpatialDuration - property int type: Easing.BezierSpline - property list<real> bezierCurve: animationCurves.expressiveDefaultSpatial - property Component numberAnimation: Component { - NumberAnimation { - duration: root.animation.elementMove.duration - easing.type: root.animation.elementMove.type - easing.bezierCurve: root.animation.elementMove.bezierCurve - } - } - } - - property QtObject elementMoveEnter: QtObject { - property int duration: Common.Config.options.appearance.animation.duration.elementMoveEnter - property int type: Easing.BezierSpline - property list<real> bezierCurve: animationCurves.emphasizedDecel - property Component numberAnimation: Component { - NumberAnimation { - duration: root.animation.elementMoveEnter.duration - easing.type: root.animation.elementMoveEnter.type - easing.bezierCurve: root.animation.elementMoveEnter.bezierCurve - } - } - } - - property QtObject elementMoveFast: QtObject { - property int duration: animationCurves.expressiveEffectsDuration - property int type: Easing.BezierSpline - property list<real> bezierCurve: animationCurves.expressiveEffects - property Component numberAnimation: Component { - NumberAnimation { - duration: root.animation.elementMoveFast.duration - easing.type: root.animation.elementMoveFast.type - easing.bezierCurve: root.animation.elementMoveFast.bezierCurve - } - } - } - } - - sizes: QtObject { - property real elevationMargin: Common.Config.options.appearance.sizes.elevationMargin - } -} diff --git a/config/quickshell/overview-trixie/common/Config.qml b/config/quickshell/overview-trixie/common/Config.qml deleted file mode 100644 index 2aa3bbf2..00000000 --- a/config/quickshell/overview-trixie/common/Config.qml +++ /dev/null @@ -1,195 +0,0 @@ -pragma Singleton -pragma ComponentBehavior: Bound - -import QtQuick -import Quickshell -import Quickshell.Io - -Singleton { - id: root - - property var userOptions: ({}) - - function read(path, fallback) { - const parts = path.split("."); - let current = userOptions; - - for (const part of parts) { - if (current === null || current === undefined || typeof current !== "object" || !(part in current)) { - return fallback; - } - current = current[part]; - } - - return current === undefined || current === null ? fallback : current; - } - - function readInt(path, fallback) { - const value = read(path, fallback); - const parsed = Number(value); - return Number.isInteger(parsed) ? parsed : fallback; - } - - function readReal(path, fallback) { - const value = read(path, fallback); - const parsed = Number(value); - return Number.isFinite(parsed) ? parsed : fallback; - } - - function readBool(path, fallback) { - const value = read(path, fallback); - return typeof value === "boolean" ? value : fallback; - } - - function readString(path, fallback) { - const value = read(path, fallback); - if (typeof value !== "string") - return fallback; - - const trimmed = value.trim(); - return trimmed.length > 0 ? trimmed : fallback; - } - - property QtObject options: QtObject { - property QtObject appearance: QtObject { - property string colorSource: root.readString( - "appearance.colorSource", - root.readBool("appearance.useMatugenColors", false) ? "matugen" : "default" - ) - property bool useMatugenColors: colorSource === "matugen" - property QtObject caelestia: QtObject { - property bool autoRefresh: root.readBool("appearance.caelestia.autoRefresh", true) - property int refreshInterval: root.readInt("appearance.caelestia.refreshInterval", 2000) - property string accentProfile: root.readString("appearance.caelestia.accentProfile", "vibrant") - } - - property QtObject rounding: QtObject { - property int unsharpen: root.readInt("appearance.rounding.unsharpen", 2) - property int verysmall: root.readInt("appearance.rounding.verysmall", 8) - property int small: root.readInt("appearance.rounding.small", 12) - property int normal: root.readInt("appearance.rounding.normal", 17) - property int large: root.readInt("appearance.rounding.large", 23) - property int full: root.readInt("appearance.rounding.full", 9999) - property int screenRounding: root.readInt("appearance.rounding.screenRounding", large) - property int windowRounding: root.readInt("appearance.rounding.windowRounding", 18) - } - - property QtObject font: QtObject { - property QtObject family: QtObject { - property string main: root.readString("appearance.font.family.main", "sans-serif") - property string title: root.readString("appearance.font.family.title", "sans-serif") - property string expressive: root.readString("appearance.font.family.expressive", "sans-serif") - } - - property QtObject pixelSize: QtObject { - property int smaller: root.readInt("appearance.font.pixelSize.smaller", 12) - property int small: root.readInt("appearance.font.pixelSize.small", 15) - property int normal: root.readInt("appearance.font.pixelSize.normal", 16) - property int larger: root.readInt("appearance.font.pixelSize.larger", 19) - property int huge: root.readInt("appearance.font.pixelSize.huge", 22) - } - } - - property QtObject animation: QtObject { - property QtObject duration: QtObject { - property int elementMove: root.readInt("appearance.animation.duration.elementMove", 500) - property int elementMoveEnter: root.readInt("appearance.animation.duration.elementMoveEnter", 400) - property int elementMoveFast: root.readInt("appearance.animation.duration.elementMoveFast", 200) - } - } - - property QtObject sizes: QtObject { - property real elevationMargin: root.readReal("appearance.sizes.elevationMargin", 10) - } - } - - property QtObject overview: QtObject { - property int rows: root.readInt("overview.rows", 2) - property int columns: root.readInt("overview.columns", 5) - property real scale: root.readReal("overview.scale", 0.16) - property bool enable: root.readBool("overview.enable", true) - property bool showEmptyWorkspaces: root.readBool("overview.showEmptyWorkspaces", true) - property bool hideEmptyRows: root.readBool("overview.hideEmptyRows", !showEmptyWorkspaces) - property bool closeOnFocusLoss: root.readBool("overview.closeOnFocusLoss", true) - property bool useWorkspaceMap: root.readBool("overview.useWorkspaceMap", false) - property var workspaceMap: root.read("overview.workspaceMap", []) - property bool orderRightLeft: root.readBool("overview.orderRightLeft", false) - property bool orderBottomUp: root.readBool("overview.orderBottomUp", false) - property bool previewsEnabled: root.readBool("overview.previewsEnabled", true) - property string previewMode: root.readString("overview.previewMode", "live") - property bool includeInactiveMonitorPreviews: root.readBool("overview.includeInactiveMonitorPreviews", true) - property int previewRecaptureDelayMs: root.readInt("overview.previewRecaptureDelayMs", 60) - property bool showSpecialWorkspaces: root.readBool("overview.showSpecialWorkspaces", false) - property var specialWorkspaces: root.read("overview.specialWorkspaces", []) - property int specialWorkspaceColumns: root.readInt("overview.specialWorkspaceColumns", columns) - property string emptyWorkspaceWallpaper: root.readString("overview.emptyWorkspaceWallpaper", "") - property string specialEmptyWorkspaceWallpaper: root.readString("overview.specialEmptyWorkspaceWallpaper", "") - property real workspaceSpacing: root.readReal("overview.workspaceSpacing", 5) - property real backgroundPadding: root.readReal("overview.backgroundPadding", 10) - property real workspaceNumberBaseSize: root.readReal("overview.workspaceNumberBaseSize", 250) - property QtObject effects: QtObject { - property bool enableBackdrop: root.readBool("overview.effects.enableBackdrop", false) - property real backdropOpacity: root.readReal("overview.effects.backdropOpacity", 0.28) - property real panelOpacity: root.readReal("overview.effects.panelOpacity", 0.92) - property real workspaceOpacity: root.readReal("overview.effects.workspaceOpacity", 0.86) - property real emptyWorkspaceWallpaperOverlayOpacity: root.readReal("overview.effects.emptyWorkspaceWallpaperOverlayOpacity", 0.18) - property real windowOverlayOpacity: root.readReal("overview.effects.windowOverlayOpacity", 0.22) - property bool enableBlur: root.readBool("overview.effects.enableBlur", false) - property bool glassMode: root.readBool("overview.effects.glassMode", false) - property real glassTintStrength: root.readReal("overview.effects.glassTintStrength", 0.35) - property real glassBorderOpacity: root.readReal("overview.effects.glassBorderOpacity", 0.72) - property real glassShineOpacity: root.readReal("overview.effects.glassShineOpacity", 0.14) - } - } - - property QtObject position: QtObject { - property int topMargin: root.readInt("position.topMargin", 100) - } - - property QtObject windowPreview: QtObject { - property bool showIcons: root.readBool("windowPreview.showIcons", true) - property real iconToWindowRatio: root.readReal("windowPreview.iconToWindowRatio", 0.25) - property real iconToWindowRatioCompact: root.readReal("windowPreview.iconToWindowRatioCompact", 0.45) - property real xwaylandIndicatorToIconRatio: root.readReal("windowPreview.xwaylandIndicatorToIconRatio", 0.35) - property real inactiveMonitorOpacity: root.readReal("windowPreview.inactiveMonitorOpacity", 0.4) - property bool cropToFill: root.readBool("windowPreview.cropToFill", false) - } - - property QtObject hacks: QtObject { - property int arbitraryRaceConditionDelay: root.readInt("hacks.arbitraryRaceConditionDelay", 150) - property int hyprlandEventDebounceMs: root.readInt("hacks.hyprlandEventDebounceMs", 40) - } - } - - Process { - id: loadUserConfig - command: [ - "sh", - "-lc", - "cfg=\"${XDG_CONFIG_HOME:-$HOME/.config}/quickshell/overview/config.json\"; [ -r \"$cfg\" ] && cat \"$cfg\"" - ] - stdout: StdioCollector { - id: configCollector - onStreamFinished: { - const payload = configCollector.text.trim(); - if (!payload) - return; - - try { - const parsed = JSON.parse(payload); - if (typeof parsed === "object" && parsed !== null) { - root.userOptions = parsed; - } else { - console.warn("overview: config.json must contain a JSON object; ignoring file"); - } - } catch (error) { - console.warn("overview: failed to parse user config.json; using defaults", error); - } - } - } - } - - Component.onCompleted: { - loadUserConfig.running = true; - } -} diff --git a/config/quickshell/overview-trixie/common/functions/ColorUtils.qml b/config/quickshell/overview-trixie/common/functions/ColorUtils.qml deleted file mode 100644 index 6162df18..00000000 --- a/config/quickshell/overview-trixie/common/functions/ColorUtils.qml +++ /dev/null @@ -1,68 +0,0 @@ -pragma Singleton -import Quickshell - -Singleton { - id: root - - function colorWithHueOf(color1, color2) { - var c1 = Qt.color(color1); - var c2 = Qt.color(color2); - var hue = c2.hsvHue; - var sat = c1.hsvSaturation; - var val = c1.hsvValue; - var alpha = c1.a; - return Qt.hsva(hue, sat, val, alpha); - } - - function colorWithSaturationOf(color1, color2) { - var c1 = Qt.color(color1); - var c2 = Qt.color(color2); - var hue = c1.hsvHue; - var sat = c2.hsvSaturation; - var val = c1.hsvValue; - var alpha = c1.a; - return Qt.hsva(hue, sat, val, alpha); - } - - function colorWithLightness(color, lightness) { - var c = Qt.color(color); - return Qt.hsla(c.hslHue, c.hslSaturation, lightness, c.a); - } - - function colorWithLightnessOf(color1, color2) { - var c2 = Qt.color(color2); - return colorWithLightness(color1, c2.hslLightness); - } - - function adaptToAccent(color1, color2) { - var c1 = Qt.color(color1); - var c2 = Qt.color(color2); - var hue = c2.hslHue; - var sat = c2.hslSaturation; - var light = c1.hslLightness; - var alpha = c1.a; - return Qt.hsla(hue, sat, light, alpha); - } - - function mix(color1, color2, percentage = 0.5) { - var c1 = Qt.color(color1); - var c2 = Qt.color(color2); - return Qt.rgba( - percentage * c1.r + (1 - percentage) * c2.r, - percentage * c1.g + (1 - percentage) * c2.g, - percentage * c1.b + (1 - percentage) * c2.b, - percentage * c1.a + (1 - percentage) * c2.a - ); - } - - function transparentize(color, percentage = 1) { - var c = Qt.color(color); - return Qt.rgba(c.r, c.g, c.b, c.a * (1 - percentage)); - } - - function applyAlpha(color, alpha) { - var c = Qt.color(color); - var a = Math.max(0, Math.min(1, alpha)); - return Qt.rgba(c.r, c.g, c.b, a); - } -} diff --git a/config/quickshell/overview-trixie/common/functions/qmldir b/config/quickshell/overview-trixie/common/functions/qmldir deleted file mode 100644 index 4c648e7e..00000000 --- a/config/quickshell/overview-trixie/common/functions/qmldir +++ /dev/null @@ -1 +0,0 @@ -singleton ColorUtils 1.0 ColorUtils.qml diff --git a/config/quickshell/overview-trixie/common/qmldir b/config/quickshell/overview-trixie/common/qmldir deleted file mode 100644 index a8485188..00000000 --- a/config/quickshell/overview-trixie/common/qmldir +++ /dev/null @@ -1,7 +0,0 @@ -singleton Appearance 1.0 Appearance.qml -singleton Config 1.0 Config.qml -singleton ColorUtils 1.0 functions/ColorUtils.qml -StyledText 1.0 widgets/StyledText.qml -StyledRectangularShadow 1.0 widgets/StyledRectangularShadow.qml -StyledToolTip 1.0 widgets/StyledToolTip.qml -StyledToolTipContent 1.0 widgets/StyledToolTipContent.qml diff --git a/config/quickshell/overview-trixie/common/widgets/StyledRectangularShadow.qml b/config/quickshell/overview-trixie/common/widgets/StyledRectangularShadow.qml deleted file mode 100644 index dba2159f..00000000 --- a/config/quickshell/overview-trixie/common/widgets/StyledRectangularShadow.qml +++ /dev/null @@ -1,13 +0,0 @@ -import QtQuick -import QtQuick.Effects -import ".." - -RectangularShadow { - anchors.fill: target - radius: 20 - blur: 0.9 * Appearance.sizes.elevationMargin - offset: Qt.vector2d(0.0, 1.0) - spread: 1 - color: Appearance.colors.colShadow - cached: true -} diff --git a/config/quickshell/overview-trixie/common/widgets/StyledText.qml b/config/quickshell/overview-trixie/common/widgets/StyledText.qml deleted file mode 100644 index abfcefae..00000000 --- a/config/quickshell/overview-trixie/common/widgets/StyledText.qml +++ /dev/null @@ -1,16 +0,0 @@ -import QtQuick -import ".." - -Text { - id: root - property bool animateChange: false - - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter - font { - hintingPreference: Font.PreferFullHinting - family: Appearance?.font.family.main ?? "sans-serif" - pixelSize: Appearance?.font.pixelSize.small ?? 15 - } - color: Appearance?.m3colors.m3onBackground ?? "white" -} diff --git a/config/quickshell/overview-trixie/common/widgets/StyledToolTip.qml b/config/quickshell/overview-trixie/common/widgets/StyledToolTip.qml deleted file mode 100644 index 4d4678c8..00000000 --- a/config/quickshell/overview-trixie/common/widgets/StyledToolTip.qml +++ /dev/null @@ -1,23 +0,0 @@ -import QtQuick -import QtQuick.Controls -import "." - -ToolTip { - id: root - property bool extraVisibleCondition: true - property bool alternativeVisibleCondition: false - readonly property bool internalVisibleCondition: (extraVisibleCondition && (parent.hovered === undefined || parent?.hovered)) || alternativeVisibleCondition - verticalPadding: 5 - horizontalPadding: 10 - background: null - - visible: internalVisibleCondition - - contentItem: StyledToolTipContent { - id: contentItem - text: root.text - shown: root.internalVisibleCondition - horizontalPadding: root.horizontalPadding - verticalPadding: root.verticalPadding - } -} diff --git a/config/quickshell/overview-trixie/common/widgets/StyledToolTipContent.qml b/config/quickshell/overview-trixie/common/widgets/StyledToolTipContent.qml deleted file mode 100644 index b8c29c1a..00000000 --- a/config/quickshell/overview-trixie/common/widgets/StyledToolTipContent.qml +++ /dev/null @@ -1,49 +0,0 @@ -import QtQuick -import "." -import "../" - -Item { - id: root - required property string text - property bool shown: false - property real horizontalPadding: 10 - property real verticalPadding: 5 - implicitWidth: tooltipTextObject.implicitWidth + 2 * root.horizontalPadding - implicitHeight: tooltipTextObject.implicitHeight + 2 * root.verticalPadding - - property bool isVisible: backgroundRectangle.implicitHeight > 0 - - Rectangle { - id: backgroundRectangle - anchors { - bottom: root.bottom - horizontalCenter: root.horizontalCenter - } - color: Appearance?.colors.colTooltip ?? "#3C4043" - radius: Appearance?.rounding.verysmall ?? 7 - opacity: shown ? 1 : 0 - implicitWidth: shown ? (tooltipTextObject.implicitWidth + 2 * root.horizontalPadding) : 0 - implicitHeight: shown ? (tooltipTextObject.implicitHeight + 2 * root.verticalPadding) : 0 - clip: true - - Behavior on implicitWidth { - animation: Appearance?.animation.elementMoveFast.numberAnimation.createObject(this) - } - Behavior on implicitHeight { - animation: Appearance?.animation.elementMoveFast.numberAnimation.createObject(this) - } - Behavior on opacity { - animation: Appearance?.animation.elementMoveFast.numberAnimation.createObject(this) - } - - StyledText { - id: tooltipTextObject - anchors.centerIn: parent - text: root.text - font.pixelSize: Appearance?.font.pixelSize.smaller ?? 14 - font.hintingPreference: Font.PreferNoHinting - color: Appearance?.colors.colOnTooltip ?? "#FFFFFF" - wrapMode: Text.Wrap - } - } -} diff --git a/config/quickshell/overview-trixie/common/widgets/qmldir b/config/quickshell/overview-trixie/common/widgets/qmldir deleted file mode 100644 index c974f193..00000000 --- a/config/quickshell/overview-trixie/common/widgets/qmldir +++ /dev/null @@ -1,5 +0,0 @@ -StyledText 1.0 StyledText.qml -StyledRectangularShadow 1.0 StyledRectangularShadow.qml -RectangularShadow 1.0 RectangularShadow.qml -StyledToolTip 1.0 StyledToolTip.qml -StyledToolTipContent 1.0 StyledToolTipContent.qml diff --git a/config/quickshell/overview-trixie/config.example.json b/config/quickshell/overview-trixie/config.example.json deleted file mode 100644 index 1c764788..00000000 --- a/config/quickshell/overview-trixie/config.example.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "appearance": { - "colorSource": "default", - "caelestia": { - "autoRefresh": true, - "refreshInterval": 2000, - "accentProfile": "vibrant" - }, - "rounding": { - "unsharpen": 2, - "verysmall": 8, - "small": 12, - "normal": 17, - "large": 23, - "full": 9999, - "screenRounding": 23, - "windowRounding": 18 - }, - "font": { - "family": { - "main": "sans-serif", - "title": "sans-serif", - "expressive": "sans-serif" - }, - "pixelSize": { - "smaller": 12, - "small": 15, - "normal": 16, - "larger": 19, - "huge": 22 - } - }, - "animation": { - "duration": { - "elementMove": 500, - "elementMoveEnter": 400, - "elementMoveFast": 200 - } - }, - "sizes": { - "elevationMargin": 10 - } - }, - "overview": { - "rows": 2, - "columns": 5, - "scale": 0.16, - "enable": true, - "hideEmptyRows": false, - "closeOnFocusLoss": true, - "useWorkspaceMap": false, - "workspaceMap": [0, 10], - "orderRightLeft": false, - "orderBottomUp": false, - "previewsEnabled": true, - "previewMode": "live", - "includeInactiveMonitorPreviews": true, - "previewRecaptureDelayMs": 60, - "showSpecialWorkspaces": false, - "specialWorkspaces": [], - "specialWorkspaceColumns": 5, - "emptyWorkspaceWallpaper": "", - "specialEmptyWorkspaceWallpaper": "", - "effects": { - "enableBackdrop": false, - "backdropOpacity": 0.28, - "panelOpacity": 0.92, - "workspaceOpacity": 0.86, - "emptyWorkspaceWallpaperOverlayOpacity": 0.18, - "windowOverlayOpacity": 0.22, - "enableBlur": false, - "glassMode": false, - "glassTintStrength": 0.35, - "glassBorderOpacity": 0.72, - "glassShineOpacity": 0.14 - }, - "workspaceSpacing": 5, - "backgroundPadding": 10, - "workspaceNumberBaseSize": 250 - }, - "position": { - "topMargin": 100 - }, - "windowPreview": { - "showIcons": true, - "iconToWindowRatio": 0.25, - "iconToWindowRatioCompact": 0.45, - "xwaylandIndicatorToIconRatio": 0.35, - "inactiveMonitorOpacity": 0.4, - "cropToFill": false - }, - "hacks": { - "arbitraryRaceConditionDelay": 150, - "hyprlandEventDebounceMs": 40 - } -} diff --git a/config/quickshell/overview-trixie/config.json b/config/quickshell/overview-trixie/config.json deleted file mode 100644 index d5c183e3..00000000 --- a/config/quickshell/overview-trixie/config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "overview": { - "hideEmptyRows": false, - "showEmptyWorkspaces": true, - "showSpecialWorkspaces": false - } -} diff --git a/config/quickshell/overview-trixie/modules/overview/Overview.qml b/config/quickshell/overview-trixie/modules/overview/Overview.qml deleted file mode 100644 index 2fb08bb9..00000000 --- a/config/quickshell/overview-trixie/modules/overview/Overview.qml +++ /dev/null @@ -1,252 +0,0 @@ -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts -import Quickshell -import Quickshell.Io -import Quickshell.Wayland -import Quickshell.Hyprland -import "../../common" -import "../../services" -import "." - -Scope { - id: overviewScope - Variants { - id: overviewVariants - model: Quickshell.screens - PanelWindow { - id: root - required property var modelData - readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.screen) - property bool monitorIsFocused: (Hyprland.focusedMonitor?.id == monitor?.id) - property bool blurEnabled: Config.options.overview.effects.enableBlur - property bool backdropEnabled: Config.options.overview.effects.enableBackdrop - property real backdropOpacity: Math.max(0, Math.min(1, Config.options.overview.effects.backdropOpacity)) - property bool closeOnFocusLoss: Config.options.overview.closeOnFocusLoss ?? true - screen: modelData - visible: GlobalStates.overviewOpen - - WlrLayershell.namespace: blurEnabled ? "quickshell:overview-blur" : "quickshell:overview" - WlrLayershell.layer: WlrLayer.Overlay - WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive - color: "transparent" - - anchors { - top: true - bottom: true - left: true - right: true - } - - HyprlandFocusGrab { - id: grab - windows: [root] - property bool canBeActive: root.monitorIsFocused - active: false - onCleared: () => { - // Only the monitor that owns the grab may close the overview - if (root.closeOnFocusLoss && !active && canBeActive) - GlobalStates.overviewOpen = false; - } - } - - Connections { - target: GlobalStates - function onOverviewOpenChanged() { - if (GlobalStates.overviewOpen) { - delayedGrabTimer.start(); - } - } - } - - // Re-evaluate grab ownership when focused monitor changes - Connections { - target: Hyprland - function onFocusedMonitorChanged() { - if (!GlobalStates.overviewOpen) - return; - // Transfer the grab to the newly focused monitor - if (root.monitorIsFocused && !grab.active) { - grab.active = true; - } else if (!root.monitorIsFocused && grab.active) { - grab.active = false; - } - } - } - - Timer { - id: delayedGrabTimer - interval: Config.options.hacks.arbitraryRaceConditionDelay - repeat: false - onTriggered: { - if (!grab.canBeActive) - return; - grab.active = GlobalStates.overviewOpen; - } - } - - // Keep the layershell surface full-screen so backdrop/blur are not constrained by content size. - implicitWidth: screen.width - implicitHeight: screen.height - - Item { - id: keyHandler - anchors.fill: parent - visible: GlobalStates.overviewOpen - focus: GlobalStates.overviewOpen - z: 0 - - Rectangle { - id: backdropLayer - anchors.fill: parent - visible: root.backdropEnabled - color: "#000000" - opacity: root.backdropOpacity - z: 0 - } - - MouseArea { - id: outsideClickCatcher - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton - enabled: root.closeOnFocusLoss && GlobalStates.overviewOpen - z: 0 - onPressed: mouse => { - GlobalStates.overviewOpen = false; - mouse.accepted = true; - } - } - - Keys.onPressed: event => { - // close: Escape or Enter - if (event.key === Qt.Key_Escape || event.key === Qt.Key_Return) { - GlobalStates.overviewOpen = false; - event.accepted = true; - return; - } - - // Helper: compute current group bounds - const workspacesPerGroup = Config.options.overview.rows * Config.options.overview.columns; - const currentId = Hyprland.focusedMonitor?.activeWorkspace?.id ?? 1; - const useWorkspaceMap = Config.options.overview.useWorkspaceMap; - const workspaceMap = Config.options.overview.workspaceMap ?? []; - const focusedMonitorId = Hyprland.focusedMonitor?.id ?? root.monitor?.id ?? 0; - const workspaceOffset = useWorkspaceMap ? Number(workspaceMap[focusedMonitorId] ?? 0) : 0; - const currentGroup = Math.floor((currentId - workspaceOffset - 1) / workspacesPerGroup); - const minWorkspaceId = currentGroup * workspacesPerGroup + 1 + workspaceOffset; - const maxWorkspaceId = minWorkspaceId + workspacesPerGroup - 1; - - const rows = Config.options.overview.rows; - const columns = Config.options.overview.columns; - const reverseColumns = Config.options.overview.orderRightLeft; - const reverseRows = Config.options.overview.orderBottomUp; - - const clampedIndex = Math.max(0, Math.min(workspacesPerGroup - 1, currentId - minWorkspaceId)); - const currentNormalRow = Math.floor(clampedIndex / columns); - const currentNormalColumn = clampedIndex % columns; - - function toVisualRow(normalRow) { - return reverseRows ? (rows - normalRow - 1) : normalRow; - } - - function toVisualColumn(normalColumn) { - return reverseColumns ? (columns - normalColumn - 1) : normalColumn; - } - - function toNormalRow(visualRow) { - return reverseRows ? (rows - visualRow - 1) : visualRow; - } - - function toNormalColumn(visualColumn) { - return reverseColumns ? (columns - visualColumn - 1) : visualColumn; - } - - let targetVisualRow = toVisualRow(currentNormalRow); - let targetVisualColumn = toVisualColumn(currentNormalColumn); - - let targetId = null; - - // Arrow keys and vim-style hjkl - if (event.key === Qt.Key_Left || event.key === Qt.Key_H) { - targetVisualColumn = (targetVisualColumn - 1 + columns) % columns; - } else if (event.key === Qt.Key_Right || event.key === Qt.Key_L) { - targetVisualColumn = (targetVisualColumn + 1) % columns; - } else if (event.key === Qt.Key_Up || event.key === Qt.Key_K) { - targetVisualRow = (targetVisualRow - 1 + rows) % rows; - } else if (event.key === Qt.Key_Down || event.key === Qt.Key_J) { - targetVisualRow = (targetVisualRow + 1) % rows; - } - - // Number keys: jump to workspace within the current group - // 1-9 map to positions 1-9, 0 maps to position 10 - else if (event.key >= Qt.Key_1 && event.key <= Qt.Key_9) { - const position = event.key - Qt.Key_0; // 1-9 - if (position <= workspacesPerGroup) { - targetId = minWorkspaceId + position - 1; - } - } else if (event.key === Qt.Key_0) { - // 0 = 10th workspace in the group (if group has 10+ workspaces) - if (workspacesPerGroup >= 10) { - targetId = minWorkspaceId + 9; // 10th position = offset 9 - } - } - - if (targetId === null && ( - event.key === Qt.Key_Left || event.key === Qt.Key_H || - event.key === Qt.Key_Right || event.key === Qt.Key_L || - event.key === Qt.Key_Up || event.key === Qt.Key_K || - event.key === Qt.Key_Down || event.key === Qt.Key_J - )) { - const targetNormalRow = toNormalRow(targetVisualRow); - const targetNormalColumn = toNormalColumn(targetVisualColumn); - targetId = minWorkspaceId + targetNormalRow * columns + targetNormalColumn; - } - - if (targetId !== null) { - const clampedTarget = Math.max(minWorkspaceId, Math.min(maxWorkspaceId, targetId)); - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.focus({workspace = '${clampedTarget}'})`); - } else { - Hyprland.dispatch("workspace " + clampedTarget); - } - event.accepted = true; - } - } - } - - ColumnLayout { - id: columnLayout - visible: GlobalStates.overviewOpen - z: 1 - anchors { - horizontalCenter: parent.horizontalCenter - top: parent.top - topMargin: Config.options.position.topMargin - } - - Loader { - id: overviewLoader - active: Config?.options.overview.enable ?? true - sourceComponent: OverviewWidget { - panelWindow: root - visible: true - } - } - } - } - } - - IpcHandler { - target: "overview" - - function toggle() { - GlobalStates.overviewOpen = !GlobalStates.overviewOpen; - } - function close() { - GlobalStates.overviewOpen = false; - } - function open() { - GlobalStates.overviewOpen = true; - } - } -} diff --git a/config/quickshell/overview-trixie/modules/overview/OverviewWidget.qml b/config/quickshell/overview-trixie/modules/overview/OverviewWidget.qml deleted file mode 100644 index 6d00803b..00000000 --- a/config/quickshell/overview-trixie/modules/overview/OverviewWidget.qml +++ /dev/null @@ -1,1214 +0,0 @@ -import QtQuick -import QtQuick.Effects -import QtQuick.Layouts -import Quickshell -import Quickshell.Wayland -import Quickshell.Hyprland -import "../../common" -import "../../common/functions" -import "../../common/widgets" -import "../../services" -import "." - -Item { - id: root - required property var panelWindow - readonly property HyprlandMonitor monitor: Hyprland.monitorFor(panelWindow.screen) - readonly property var toplevels: ToplevelManager.toplevels - readonly property int effectiveActiveWorkspaceId: Math.max(1, Math.min(100, monitor?.activeWorkspace?.id ?? 1)) - readonly property int workspacesShown: Config.options.overview.rows * Config.options.overview.columns - readonly property bool useWorkspaceMap: Config.options.overview.useWorkspaceMap - readonly property var workspaceMap: Config.options.overview.workspaceMap - readonly property int workspaceOffset: useWorkspaceMap ? Number(workspaceMap[root.monitor?.id] ?? 0) : 0 - readonly property int workspaceGroup: Math.floor((effectiveActiveWorkspaceId - workspaceOffset - 1) / workspacesShown) - property bool monitorIsFocused: (Hyprland.focusedMonitor?.name == monitor.name) - property var windows: HyprlandData.windowList - property var windowByAddress: HyprlandData.windowByAddress - property var windowAddresses: HyprlandData.addresses - property var workspaceIds: HyprlandData.workspaceIds - property var monitorData: HyprlandData.monitors.find(m => m.id === root.monitor?.id) - property real scale: Config.options.overview.scale - property color activeBorderColor: Appearance.colors.colSecondary - - property real workspaceImplicitWidth: Math.round((monitorData?.transform % 2 === 1) ? - ((monitor.height / monitor.scale - (monitorData?.reserved?.[0] ?? 0) - (monitorData?.reserved?.[2] ?? 0)) * root.scale) : - ((monitor.width / monitor.scale - (monitorData?.reserved?.[0] ?? 0) - (monitorData?.reserved?.[2] ?? 0)) * root.scale)) - property real workspaceImplicitHeight: Math.round((monitorData?.transform % 2 === 1) ? - ((monitor.width / monitor.scale - (monitorData?.reserved?.[1] ?? 0) - (monitorData?.reserved?.[3] ?? 0)) * root.scale) : - ((monitor.height / monitor.scale - (monitorData?.reserved?.[1] ?? 0) - (monitorData?.reserved?.[3] ?? 0)) * root.scale)) - - property real workspaceNumberMargin: 80 - property real workspaceNumberSize: Config.options.overview.workspaceNumberBaseSize * monitor.scale - property int workspaceZ: 0 - property int windowZ: 1 - property int windowDraggingZ: 99999 - property real workspaceSpacing: Config.options.overview.workspaceSpacing - property string emptyWorkspaceWallpaperPath: Config.options.overview.emptyWorkspaceWallpaper - property string specialEmptyWorkspaceWallpaperPath: Config.options.overview.specialEmptyWorkspaceWallpaper - property bool showSpecialWorkspaces: Config.options.overview.showSpecialWorkspaces - property var configuredSpecialWorkspaces: Config.options.overview.specialWorkspaces ?? [] - property int specialWorkspaceColumns: Math.max(1, Config.options.overview.specialWorkspaceColumns) - property real panelOpacity: Math.max(0, Math.min(1, Config.options.overview.effects.panelOpacity)) - property real workspaceOpacity: Math.max(0, Math.min(1, Config.options.overview.effects.workspaceOpacity)) - property real emptyWorkspaceWallpaperOverlayOpacity: Math.max(0, Math.min(1, Config.options.overview.effects.emptyWorkspaceWallpaperOverlayOpacity)) - property bool glassMode: Config.options.overview.effects.glassMode - property real glassTintStrength: Math.max(0, Math.min(1, Config.options.overview.effects.glassTintStrength)) - property real glassBorderOpacity: Math.max(0, Math.min(1, Config.options.overview.effects.glassBorderOpacity)) - property real glassShineOpacity: Math.max(0, Math.min(1, Config.options.overview.effects.glassShineOpacity)) - property real effectivePanelOpacity: glassMode ? Math.min(panelOpacity, 0.72) : panelOpacity - property real effectiveWorkspaceOpacity: glassMode ? Math.min(workspaceOpacity, 0.62) : workspaceOpacity - - property int draggingFromWorkspace: -1 - property int draggingTargetWorkspace: -1 - property string draggingTargetSpecialWorkspace: "" - property int previewRecaptureToken: 0 - property var allWorkspaces: HyprlandData.allWorkspaces - property bool previewsEnabled: Config.options.overview.previewsEnabled - property string previewModeRaw: Config.options.overview.previewMode - property string previewMode: { - const mode = `${previewModeRaw ?? "live"}`.trim().toLowerCase(); - return (mode === "event" || mode === "snapshot") ? "event" : "live"; - } - property bool useEventPreviewRefresh: previewsEnabled && previewMode === "event" - - readonly property var monitorSpecialWorkspaceNames: { - const names = []; - for (const ws of (allWorkspaces ?? [])) { - const name = `${ws?.name ?? ""}`; - if (!name.startsWith("special:")) - continue; - if (`${ws?.monitor ?? ""}` !== `${root.monitor?.name ?? ""}`) - continue; - names.push(name.slice(8)); - } - return names; - } - - readonly property var specialWorkspaceNamesFromWindows: { - const names = []; - for (const addr in windowByAddress) { - const win = windowByAddress[addr]; - if ((win?.monitor ?? -1) !== (root.monitor?.id ?? -1)) - continue; - const wsName = `${win?.workspace?.name ?? ""}`; - if (!wsName.startsWith("special:")) - continue; - names.push(wsName.slice(8)); - } - return names; - } - - readonly property var visibleSpecialWorkspaces: { - if (!showSpecialWorkspaces) - return []; - - const out = []; - const pushUnique = (value) => { - const cleaned = `${value ?? ""}`.trim(); - if (cleaned.length === 0 || out.includes(cleaned)) - return; - out.push(cleaned); - }; - - for (const configured of configuredSpecialWorkspaces ?? []) - pushUnique(configured); - for (const name of monitorSpecialWorkspaceNames) - pushUnique(name); - for (const name of specialWorkspaceNamesFromWindows) - pushUnique(name); - - return out; - } - - readonly property bool hasSpecialWorkspaceSection: visibleSpecialWorkspaces.length > 0 - readonly property bool hasEmptyWorkspaceWallpaper: `${emptyWorkspaceWallpaperPath ?? ""}`.trim().length > 0 - readonly property bool hasSpecialEmptyWorkspaceWallpaper: `${specialEmptyWorkspaceWallpaperPath ?? ""}`.trim().length > 0 - readonly property string createSpecialWorkspaceTarget: "__create_special_workspace__" - readonly property real specialWorkspaceTileHeight: root.workspaceImplicitHeight - readonly property real specialStripGap: workspaceSpacing * 1.8 - readonly property real specialStripPadding: Math.max(8, 12 * root.scale) - readonly property real specialStripTitleHeight: Math.max(14, Appearance.font.pixelSize.small * root.scale) - readonly property real specialStripTitleGap: Math.max(6, 8 * root.scale) - readonly property int totalSpecialTiles: visibleSpecialWorkspaces.length + 1 - readonly property real specialSectionWidth: workspaceColumnLayout.implicitWidth - readonly property real specialGridInnerWidth: Math.max(0, root.specialSectionWidth - root.specialStripPadding * 2) - readonly property int effectiveSpecialColumns: Math.max(1, Math.min(root.specialWorkspaceColumns, root.totalSpecialTiles)) - readonly property int specialWorkspaceRows: Math.ceil(root.totalSpecialTiles / root.effectiveSpecialColumns) - readonly property real specialWorkspaceAspectCap: { - let maxAspect = Math.max(1, root.workspaceImplicitWidth / Math.max(1, root.workspaceImplicitHeight)); - for (const name of visibleSpecialWorkspaces) { - const geometry = root.specialWorkspaceGeometry(name, root.monitor?.id); - const width = geometry?.width; - const height = geometry?.height; - if (!Number.isFinite(width) || !Number.isFinite(height) || height <= 0) - continue; - maxAspect = Math.max(maxAspect, width / height); - } - return maxAspect; - } - readonly property real specialWorkspaceTileWidth: { - const gaps = Math.max(0, root.effectiveSpecialColumns - 1); - const rawWidth = (root.specialGridInnerWidth - gaps * workspaceSpacing) / root.effectiveSpecialColumns; - const aspectWidth = root.specialWorkspaceTileHeight * root.specialWorkspaceAspectCap; - const cappedWidth = Math.min(rawWidth, aspectWidth); - return Math.max(80 * root.scale, cappedWidth); - } - readonly property real specialGridUsedWidth: root.effectiveSpecialColumns * root.specialWorkspaceTileWidth + Math.max(0, root.effectiveSpecialColumns - 1) * workspaceSpacing - readonly property real specialGridOffsetX: root.specialStripPadding + Math.max(0, (root.specialGridInnerWidth - root.specialGridUsedWidth) / 2) - readonly property real specialStripTop: workspaceColumnLayout.implicitHeight + workspaceSpacing + root.specialStripGap - readonly property real specialStripTilesTop: root.specialStripTop + root.specialStripPadding + root.specialStripTitleHeight + root.specialStripTitleGap - readonly property real specialGridHeight: root.specialWorkspaceRows * root.specialWorkspaceTileHeight + Math.max(0, root.specialWorkspaceRows - 1) * workspaceSpacing - readonly property real specialStripHeight: root.specialStripPadding * 2 + root.specialStripTitleHeight + root.specialStripTitleGap + root.specialGridHeight - - function getWorkspaceRow(workspaceId) { - if (!Number.isFinite(workspaceId)) - return 0; - const adjusted = workspaceId - workspaceOffset; - const normalRow = Math.floor((adjusted - 1) / Config.options.overview.columns) % Config.options.overview.rows; - return Config.options.overview.orderBottomUp ? (Config.options.overview.rows - normalRow - 1) : normalRow; - } - - function getWorkspaceColumn(workspaceId) { - if (!Number.isFinite(workspaceId)) - return 0; - const adjusted = workspaceId - workspaceOffset; - const normalCol = (adjusted - 1) % Config.options.overview.columns; - return Config.options.overview.orderRightLeft ? (Config.options.overview.columns - normalCol - 1) : normalCol; - } - - function getWorkspaceInCell(rowIndex, colIndex) { - const mappedRow = Config.options.overview.orderBottomUp ? (Config.options.overview.rows - rowIndex - 1) : rowIndex; - const mappedCol = Config.options.overview.orderRightLeft ? (Config.options.overview.columns - colIndex - 1) : colIndex; - return (workspaceGroup * workspacesShown) + (mappedRow * Config.options.overview.columns) + mappedCol + 1 + workspaceOffset; - } - - function getVisibleRowPosition(rowIndex) { - if (!Number.isFinite(rowIndex) || rowIndex < 0) - return 0; - if (!Config.options.overview.hideEmptyRows || !(rowsWithContent instanceof Set)) - return rowIndex; - - let visibleRow = 0; - for (let i = 0; i < rowIndex; i += 1) { - if (rowsWithContent.has(i)) - visibleRow += 1; - } - return visibleRow; - } - - function stepWorkspace(delta) { - if (!Number.isFinite(delta) || delta === 0) - return; - - const currentId = monitor?.activeWorkspace?.id ?? effectiveActiveWorkspaceId; - const minWorkspaceId = workspaceOffset + 1; - let maxWorkspaceId = minWorkspaceId + workspacesShown - 1; - for (const workspaceId of (workspaceIds ?? [])) { - if (Number.isFinite(workspaceId) && workspaceId >= minWorkspaceId) { - maxWorkspaceId = Math.max(maxWorkspaceId, workspaceId); - } - } - maxWorkspaceId = Math.max(maxWorkspaceId, currentId); - - let targetId = currentId + delta; - if (targetId < minWorkspaceId) { - targetId = maxWorkspaceId; - } else if (targetId > maxWorkspaceId) { - targetId = minWorkspaceId; - } - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.focus({workspace = '${targetId}'})`); - } else { - Hyprland.dispatch(`workspace ${targetId}`); - } - } - - function isSpecialWorkspace(windowData) { - const wsName = `${windowData?.workspace?.name ?? ""}`; - return wsName.startsWith("special:"); - } - - function specialWorkspaceName(windowData) { - const wsName = `${windowData?.workspace?.name ?? ""}`; - return wsName.startsWith("special:") ? wsName.slice(8) : ""; - } - - function specialWorkspaceIndex(name) { - return visibleSpecialWorkspaces.indexOf(`${name ?? ""}`); - } - - function specialWorkspaceLabel(name) { - const raw = `${name ?? ""}`.trim(); - if (raw.length === 0) - return "Special"; - return raw.replace(/[-_]+/g, " "); - } - - function nextSpecialWorkspaceName() { - const taken = new Set(); - for (const name of visibleSpecialWorkspaces) - taken.add(`${name ?? ""}`.trim().toLowerCase()); - - const base = "stash"; - if (!taken.has(base)) - return base; - - let index = 2; - while (taken.has(`${base}-${index}`)) - index += 1; - - return `${base}-${index}`; - } - - function wallpaperSource(path) { - const trimmed = `${path ?? ""}`.trim(); - if (trimmed.length === 0) - return ""; - if (trimmed.startsWith("file:/") || trimmed.startsWith("qrc:/") || trimmed.startsWith("image://") || trimmed.startsWith("http://") || trimmed.startsWith("https://")) - return trimmed; - if (trimmed.startsWith("/")) - return `file://${trimmed}`; - return trimmed; - } - - function workspaceHasWindows(workspaceId) { - if (!Number.isFinite(workspaceId)) - return false; - - for (const addr in windowByAddress) { - const win = windowByAddress[addr]; - if (root.isSpecialWorkspace(win)) - continue; - if ((win?.workspace?.id ?? -1) === workspaceId) - return true; - } - return false; - } - - function specialWindowZ(win) { - const pinned = win?.pinned ? 200000 : 0; - const floating = win?.floating ? 100000 : 0; - const focus = 10000 - (win?.focusHistoryID ?? 9999); - return pinned + floating + focus; - } - - function specialWorkspaceGeometry(name, monitorId) { - const trimmedName = `${name ?? ""}`.trim(); - const currentMonitorId = monitorId ?? -1; - let minX = null; - let minY = null; - let maxX = null; - let maxY = null; - - for (const addr in windowByAddress) { - const win = windowByAddress[addr]; - if ((win?.monitor ?? -1) !== currentMonitorId) - continue; - if (root.specialWorkspaceName(win) !== trimmedName) - continue; - - const atX = win?.at?.[0]; - const atY = win?.at?.[1]; - const width = win?.size?.[0]; - const height = win?.size?.[1]; - if (!Number.isFinite(atX) || !Number.isFinite(atY)) - continue; - if (!Number.isFinite(width) || !Number.isFinite(height)) - continue; - - minX = minX === null ? atX : Math.min(minX, atX); - minY = minY === null ? atY : Math.min(minY, atY); - maxX = maxX === null ? (atX + width) : Math.max(maxX, atX + width); - maxY = maxY === null ? (atY + height) : Math.max(maxY, atY + height); - } - - return { - x: minX, - y: minY, - width: (minX !== null && maxX !== null) ? Math.max(1, maxX - minX) : null, - height: (minY !== null && maxY !== null) ? Math.max(1, maxY - minY) : null - }; - } - - // Calculate which rows have windows or current workspace - property var rowsWithContent: { - if (!Config.options.overview.hideEmptyRows) return null; - - let rows = new Set(); - const firstWorkspace = root.workspaceGroup * root.workspacesShown + 1 + workspaceOffset; - const lastWorkspace = (root.workspaceGroup + 1) * root.workspacesShown + workspaceOffset; - - // Add row containing current workspace - const currentWorkspace = effectiveActiveWorkspaceId; - if (currentWorkspace >= firstWorkspace && currentWorkspace <= lastWorkspace) { - rows.add(getWorkspaceRow(currentWorkspace)); - } - - // Add rows with windows - for (let addr in windowByAddress) { - const win = windowByAddress[addr]; - const wsId = win?.workspace?.id; - if (wsId >= firstWorkspace && wsId <= lastWorkspace) { - const rowIndex = getWorkspaceRow(wsId); - rows.add(rowIndex); - } - } - - return rows; - } - - implicitWidth: overviewBackground.implicitWidth + Appearance.sizes.elevationMargin * 2 - implicitHeight: overviewBackground.implicitHeight + Appearance.sizes.elevationMargin * 2 - - property Component windowComponent: OverviewWindow {} - property list<OverviewWindow> windowWidgets: [] - - Connections { - target: Hyprland - function onRawEvent(event) { - if (!GlobalStates.overviewOpen || !root.useEventPreviewRefresh) - return; - - const eventName = `${event?.name ?? event?.event ?? event?.type ?? ""}`; - if (eventName === "closewindow" || eventName === "openwindow" || eventName === "movewindow") { - root.previewRecaptureToken += 1; - } - } - } - - StyledRectangularShadow { - target: overviewBackground - } - Rectangle { // Background - id: overviewBackground - property real padding: Config.options.overview.backgroundPadding - anchors.fill: parent - anchors.margins: Appearance.sizes.elevationMargin - - implicitWidth: contentLayout.implicitWidth + padding * 2 - implicitHeight: contentLayout.implicitHeight + padding * 2 - radius: Appearance.rounding.screenRounding * root.scale + padding - clip: true - color: ColorUtils.applyAlpha( - root.glassMode - ? ColorUtils.mix(Appearance.colors.colLayer0, Appearance.colors.colLayer1, 0.78 - root.glassTintStrength * 0.35) - : Appearance.colors.colLayer0, - root.effectivePanelOpacity - ) - border.width: 1 - border.color: ColorUtils.applyAlpha( - root.glassMode - ? ColorUtils.mix(Appearance.colors.colLayer0Border, Appearance.m3colors.m3outline, 0.52) - : Appearance.colors.colLayer0Border, - root.glassMode ? root.glassBorderOpacity : root.effectivePanelOpacity - ) - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton - onPressed: mouse => mouse.accepted = true - } - - Rectangle { - visible: root.glassMode - anchors.fill: parent - radius: parent.radius - color: "transparent" - gradient: Gradient { - GradientStop { position: 0.0; color: ColorUtils.applyAlpha("#FFFFFF", root.glassShineOpacity * 0.35) } - GradientStop { position: 0.42; color: ColorUtils.applyAlpha("#FFFFFF", 0.0) } - GradientStop { position: 1.0; color: ColorUtils.applyAlpha("#000000", root.glassShineOpacity * 0.22) } - } - } - - Rectangle { - visible: root.glassMode - anchors.fill: parent - anchors.margins: 1 - radius: Math.max(parent.radius - 1, 0) - color: "transparent" - border.width: 1 - border.color: ColorUtils.applyAlpha("#FFFFFF", root.glassBorderOpacity * 0.20) - } - - ColumnLayout { // Workspaces - id: contentLayout - - z: root.workspaceZ - anchors.centerIn: parent - spacing: workspaceSpacing - ColumnLayout { - id: workspaceColumnLayout - spacing: workspaceSpacing - - Repeater { - model: Config.options.overview.rows - delegate: RowLayout { - id: row - property int rowIndex: index - spacing: workspaceSpacing - visible: !Config.options.overview.hideEmptyRows || - (root.rowsWithContent && root.rowsWithContent.has(rowIndex)) - height: visible ? implicitHeight : 0 - - Repeater { // Workspace repeater - model: Config.options.overview.columns - Rectangle { // Workspace - id: workspace - property int colIndex: index - property int workspaceValue: root.getWorkspaceInCell(rowIndex, colIndex) - property bool showWallpaper: root.hasEmptyWorkspaceWallpaper - property color defaultWorkspaceColor: Appearance.colors.colLayer1 - property color hoveredWorkspaceColor: ColorUtils.mix(defaultWorkspaceColor, Appearance.colors.colLayer1Hover, 0.1) - property color hoveredBorderColor: Appearance.colors.colLayer2Hover - property bool hoveredWhileDragging: false - - implicitWidth: root.workspaceImplicitWidth - implicitHeight: root.workspaceImplicitHeight - color: showWallpaper ? "transparent" : ColorUtils.applyAlpha( - root.glassMode - ? ColorUtils.mix(hoveredWhileDragging ? hoveredWorkspaceColor : defaultWorkspaceColor, Appearance.colors.colLayer0, 0.46) - : (hoveredWhileDragging ? hoveredWorkspaceColor : defaultWorkspaceColor), - root.effectiveWorkspaceOpacity - ) - radius: Appearance.rounding.screenRounding * root.scale - border.width: 2 - border.color: hoveredWhileDragging - ? ColorUtils.applyAlpha(hoveredBorderColor, root.glassMode ? root.glassBorderOpacity : 1) - : "transparent" - - Image { - id: workspaceWallpaper - visible: workspace.showWallpaper - anchors.fill: parent - source: root.wallpaperSource(root.emptyWorkspaceWallpaperPath) - fillMode: Image.PreserveAspectCrop - asynchronous: true - cache: true - smooth: true - mipmap: true - layer.enabled: workspace.showWallpaper - layer.smooth: true - layer.effect: MultiEffect { - maskEnabled: true - maskSource: workspaceWallpaperMask - maskThresholdMin: 0.5 - maskSpreadAtMin: 1.0 - } - } - - Item { - id: workspaceWallpaperMask - anchors.fill: parent - visible: false - layer.enabled: true - layer.smooth: true - Rectangle { - anchors.fill: parent - radius: workspace.radius - } - } - - Rectangle { - visible: workspace.showWallpaper - anchors.fill: parent - radius: parent.radius - color: ColorUtils.applyAlpha( - root.glassMode - ? ColorUtils.mix(workspace.hoveredWhileDragging ? workspace.hoveredWorkspaceColor : workspace.defaultWorkspaceColor, Appearance.colors.colLayer0, 0.40) - : (workspace.hoveredWhileDragging ? workspace.hoveredWorkspaceColor : workspace.defaultWorkspaceColor), - workspace.hoveredWhileDragging - ? Math.min(0.28, root.emptyWorkspaceWallpaperOverlayOpacity + 0.08) - : root.emptyWorkspaceWallpaperOverlayOpacity - ) - } - - Rectangle { - visible: root.glassMode - anchors.fill: parent - radius: parent.radius - color: "transparent" - gradient: Gradient { - GradientStop { position: 0.0; color: ColorUtils.applyAlpha("#FFFFFF", root.glassShineOpacity * 0.22) } - GradientStop { position: 0.46; color: ColorUtils.applyAlpha("#FFFFFF", 0.0) } - GradientStop { position: 1.0; color: ColorUtils.applyAlpha("#000000", root.glassShineOpacity * 0.14) } - } - } - - Rectangle { - visible: root.glassMode - anchors.fill: parent - anchors.margins: 1 - radius: Math.max(parent.radius - 1, 0) - color: "transparent" - border.width: 1 - border.color: ColorUtils.applyAlpha("#FFFFFF", root.glassBorderOpacity * 0.16) - } - - StyledText { - anchors.centerIn: parent - visible: !workspace.showWallpaper - text: workspaceValue - font { - pixelSize: root.workspaceNumberSize * root.scale - weight: Font.DemiBold - family: Appearance.font.family.expressive - } - color: ColorUtils.transparentize(Appearance.colors.colOnLayer1, 0.8) - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - - MouseArea { - id: workspaceArea - anchors.fill: parent - acceptedButtons: Qt.LeftButton - onClicked: { - if (root.draggingTargetWorkspace === -1) { - GlobalStates.overviewOpen = false - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.focus({workspace = '${workspaceValue}'})`); - } else { - Hyprland.dispatch(`workspace ${workspaceValue}`) - } - } - } - } - - DropArea { - anchors.fill: parent - onEntered: { - root.draggingTargetWorkspace = workspaceValue - root.draggingTargetSpecialWorkspace = "" - if (root.draggingFromWorkspace == root.draggingTargetWorkspace) return; - hoveredWhileDragging = true - } - onExited: { - hoveredWhileDragging = false - if (root.draggingTargetWorkspace == workspaceValue) root.draggingTargetWorkspace = -1 - } - } - - } - } - } - } - } - - Item { - visible: root.showSpecialWorkspaces - implicitWidth: 1 - implicitHeight: root.specialStripGap - } - - Item { - id: specialWorkspaceSection - visible: root.showSpecialWorkspaces - implicitWidth: root.specialSectionWidth - implicitHeight: root.specialStripHeight - - Rectangle { - anchors.fill: parent - radius: Appearance.rounding.normal * root.scale - color: ColorUtils.applyAlpha( - root.glassMode - ? ColorUtils.mix(Appearance.colors.colLayer0, Appearance.colors.colLayer1, 0.70) - : Appearance.colors.colLayer1, - root.glassMode ? Math.min(0.74, root.effectivePanelOpacity) : root.effectiveWorkspaceOpacity - ) - border.width: 1 - border.color: ColorUtils.applyAlpha(Appearance.colors.colLayer2Border, root.glassMode ? root.glassBorderOpacity : 0.65) - - Rectangle { - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - height: Math.max(18 * root.scale, root.specialStripPadding + root.specialStripTitleHeight * 0.8) - radius: parent.radius - color: ColorUtils.applyAlpha(Appearance.colors.colSecondary, root.glassMode ? 0.12 : 0.08) - } - - StyledText { - anchors.left: parent.left - anchors.top: parent.top - anchors.leftMargin: root.specialStripPadding - anchors.topMargin: root.specialStripPadding - text: "Special Workspaces" - font.family: Appearance.font.family.title - font.pixelSize: root.specialStripTitleHeight - font.weight: Font.DemiBold - color: ColorUtils.applyAlpha(Appearance.colors.colOnLayer1, 0.84) - } - - Grid { - id: specialWorkspaceGrid - x: root.specialGridOffsetX - y: root.specialStripPadding + root.specialStripTitleHeight + root.specialStripTitleGap - width: root.specialGridUsedWidth - columns: root.effectiveSpecialColumns - rowSpacing: workspaceSpacing - columnSpacing: workspaceSpacing - - Repeater { - model: root.visibleSpecialWorkspaces - delegate: Rectangle { - id: specialWorkspaceTile - required property string modelData - property string specialName: modelData - property var specialGeometry: root.specialWorkspaceGeometry(specialName, root.monitor?.id) - property color baseColor: ColorUtils.mix(Appearance.colors.colLayer1, Appearance.colors.colLayer0, 0.52) - property bool hasRenderableGeometry: Number.isFinite(specialGeometry?.width) - && Number.isFinite(specialGeometry?.height) - && specialGeometry.width > 0 - && specialGeometry.height > 0 - property bool showWallpaper: root.hasSpecialEmptyWorkspaceWallpaper - property real geometryWidth: hasRenderableGeometry ? specialGeometry.width : Math.max(1, root.workspaceImplicitWidth / root.scale) - property real geometryHeight: hasRenderableGeometry ? specialGeometry.height : Math.max(1, root.workspaceImplicitHeight / root.scale) - property real fitScale: hasRenderableGeometry ? Math.min(width / geometryWidth, height / geometryHeight) : root.scale - property real contentWidth: hasRenderableGeometry ? (geometryWidth * fitScale) : width - property real contentHeight: hasRenderableGeometry ? (geometryHeight * fitScale) : height - property real contentOffsetX: Math.max(0, (width - contentWidth) / 2) - property real contentOffsetY: Math.max(0, (height - contentHeight) / 2) - implicitWidth: root.specialWorkspaceTileWidth - implicitHeight: root.specialWorkspaceTileHeight - radius: Appearance.rounding.screenRounding * root.scale - clip: true - color: showWallpaper ? "transparent" : ColorUtils.applyAlpha( - root.glassMode - ? ColorUtils.mix(baseColor, Appearance.colors.colLayer0, 0.44) - : baseColor, - root.effectiveWorkspaceOpacity - ) - border.width: 1 - border.color: ColorUtils.applyAlpha(Appearance.colors.colLayer2Border, root.glassMode ? root.glassBorderOpacity : 0.75) - - Image { - visible: specialWorkspaceTile.showWallpaper - anchors.fill: parent - source: root.wallpaperSource(root.specialEmptyWorkspaceWallpaperPath) - fillMode: Image.PreserveAspectCrop - asynchronous: true - cache: true - smooth: true - mipmap: true - } - - Rectangle { - visible: specialWorkspaceTile.showWallpaper - anchors.fill: parent - radius: parent.radius - color: ColorUtils.applyAlpha( - root.glassMode - ? ColorUtils.mix(specialWorkspaceTile.baseColor, Appearance.colors.colLayer0, 0.40) - : specialWorkspaceTile.baseColor, - root.emptyWorkspaceWallpaperOverlayOpacity - ) - } - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton - onClicked: { - if (root.draggingTargetWorkspace === -1 && !root.draggingTargetSpecialWorkspace) { - GlobalStates.overviewOpen = false; - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.workspace.toggle_special('${specialWorkspaceTile.specialName}')`); - } else { - Hyprland.dispatch(`togglespecialworkspace ${specialWorkspaceTile.specialName}`); - } - } - } - } - - DropArea { - anchors.fill: parent - onEntered: { - root.draggingTargetWorkspace = -1; - root.draggingTargetSpecialWorkspace = specialWorkspaceTile.specialName; - } - onExited: { - if (root.draggingTargetSpecialWorkspace === specialWorkspaceTile.specialName) - root.draggingTargetSpecialWorkspace = ""; - } - } - - Item { - id: specialWorkspaceContent - x: specialWorkspaceTile.contentOffsetX - y: specialWorkspaceTile.contentOffsetY - width: specialWorkspaceTile.contentWidth - height: specialWorkspaceTile.contentHeight - clip: true - - Repeater { - model: ScriptModel { - values: { - if (!specialWorkspaceTile.hasRenderableGeometry) - return []; - return ToplevelManager.toplevels.values.filter((toplevel) => { - const address = `0x${toplevel.HyprlandToplevel.address}`; - const win = windowByAddress[address]; - if ((win?.monitor ?? -1) !== (root.monitor?.id ?? -1)) - return false; - return root.specialWorkspaceName(win) === specialWorkspaceTile.specialName; - }).sort((a, b) => { - const addrA = `0x${a.HyprlandToplevel.address}`; - const addrB = `0x${b.HyprlandToplevel.address}`; - return addrA.localeCompare(addrB); - }); - } - } - delegate: OverviewWindow { - id: specialWindow - required property var modelData - required property int index - property var address: `0x${modelData.HyprlandToplevel.address}` - property int monitorId: windowData?.monitor - property var monitor: HyprlandData.monitors.find(m => m.id === monitorId) - property Item homeParent: specialWorkspaceContent - windowData: windowByAddress[address] - toplevel: modelData - monitorData: monitor - widgetMonitorData: root.monitorData - scale: root.scale - availableWorkspaceWidth: specialWorkspaceContent.width - availableWorkspaceHeight: specialWorkspaceContent.height - positionBaseX: Number.isFinite(specialWorkspaceTile.specialGeometry?.x) ? specialWorkspaceTile.specialGeometry.x : ((monitor?.x ?? 0) + (monitor?.reserved?.[0] ?? 0)) - positionBaseY: Number.isFinite(specialWorkspaceTile.specialGeometry?.y) ? specialWorkspaceTile.specialGeometry.y : ((monitor?.y ?? 0) + (monitor?.reserved?.[1] ?? 0)) - geometryScaleX: specialWorkspaceTile.fitScale / root.scale - geometryScaleY: specialWorkspaceTile.fitScale / root.scale - xOffset: 0 - yOffset: 0 - widgetMonitorId: root.monitor.id - recaptureToken: root.previewRecaptureToken - restrictToWorkspace: false - animateSize: false - z: root.specialWindowZ(windowData) - - function moveToDragLayer() { - const mapped = specialWindow.mapToItem(specialWindowDragLayer, 0, 0); - specialWindow.suspendPositionAnimation = true; - specialWindow.parent = specialWindowDragLayer; - specialWindow.x = mapped.x; - specialWindow.y = mapped.y; - specialWindow.z = root.windowDraggingZ + 1; - Qt.callLater(() => specialWindow.suspendPositionAnimation = false); - } - - function returnToHomeParent() { - specialWindow.suspendPositionAnimation = true; - specialWindow.parent = homeParent; - specialWindow.z = root.specialWindowZ(windowData); - Qt.callLater(() => specialWindow.suspendPositionAnimation = false); - } - - MouseArea { - id: specialDragArea - anchors.fill: parent - hoverEnabled: true - onEntered: hovered = true - onExited: hovered = false - acceptedButtons: Qt.LeftButton | Qt.MiddleButton - drag.target: parent - onPressed: (mouse) => { - root.draggingFromWorkspace = -1 - root.draggingTargetSpecialWorkspace = "" - specialWindow.pressed = true - specialWindow.dragInProgress = true - specialWindow.Drag.source = specialWindow - specialWindow.Drag.hotSpot.x = mouse.x - specialWindow.Drag.hotSpot.y = mouse.y - specialWindow.moveToDragLayer() - specialWindow.Drag.active = true - } - onReleased: { - const targetWorkspace = root.draggingTargetWorkspace - const targetSpecialWorkspace = root.draggingTargetSpecialWorkspace - specialWindow.pressed = false - specialWindow.Drag.active = false - specialWindow.dragInProgress = false - root.draggingFromWorkspace = -1 - root.draggingTargetWorkspace = -1 - root.draggingTargetSpecialWorkspace = "" - if (targetSpecialWorkspace === root.createSpecialWorkspaceTarget) { - const createdName = root.nextSpecialWorkspaceName() - //INFO: From special TO NEW special - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.window.move({workspace = 'special:${createdName}', follow = false, window = 'address:${specialWindow.windowData?.address}'})`); - } else { - Hyprland.dispatch(`movetoworkspacesilent special:${createdName}, address:${specialWindow.windowData?.address}`) - } - specialWindow.returnToHomeParent() - specialWindow.x = specialWindow.initX - specialWindow.y = specialWindow.initY - } - else if (targetSpecialWorkspace && targetSpecialWorkspace !== specialWorkspaceTile.specialName) { - // Idk - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.window.move({workspace = 'special:${targetSpecialWorkspace}', follow = false, window = 'address:${specialWindow.windowData?.address}'})`); - } else { - Hyprland.dispatch(`movetoworkspacesilent special:${targetSpecialWorkspace}, address:${specialWindow.windowData?.address}`) - } - specialWindow.returnToHomeParent() - specialWindow.x = specialWindow.initX - specialWindow.y = specialWindow.initY - } - else if (targetWorkspace !== -1) { - //INFO: From Special TO Normal workspace - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.window.move({workspace = '${targetWorkspace}', follow = false, window = 'address:${specialWindow.windowData?.address}'})`); - } else { - Hyprland.dispatch(`movetoworkspacesilent ${targetWorkspace}, address:${specialWindow.windowData?.address}`) - } - specialWindow.returnToHomeParent() - specialWindow.x = specialWindow.initX - specialWindow.y = specialWindow.initY - } - else { - specialWindow.returnToHomeParent() - specialWindow.x = specialWindow.initX - specialWindow.y = specialWindow.initY - } - } - onClicked: (event) => { - if (!windowData) - return; - if (event.button === Qt.LeftButton) { - GlobalStates.overviewOpen = false; - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.focus({ window = 'address:${windowData.address}' })`); - } else { - Hyprland.dispatch(`focuswindow address:${windowData.address}`); - } - event.accepted = true; - } else if (event.button === Qt.MiddleButton) { - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.window.close('address:${windowData.address}')`); - } else { - Hyprland.dispatch(`closewindow address:${windowData.address}`); - } - event.accepted = true; - } - } - - StyledToolTip { - extraVisibleCondition: false - alternativeVisibleCondition: specialDragArea.containsMouse && !specialWindow.Drag.active - text: `${windowData?.title ?? "Unknown"}\n[${windowData?.class ?? "unknown"}] ${windowData?.xwayland ? "[XWayland] " : ""}` - } - } - } - } - } - } - } - Rectangle { - id: createSpecialWorkspaceTile - property bool showWallpaper: root.hasSpecialEmptyWorkspaceWallpaper - implicitWidth: root.specialWorkspaceTileWidth - implicitHeight: root.specialWorkspaceTileHeight - radius: Appearance.rounding.screenRounding * root.scale - color: showWallpaper ? "transparent" : ColorUtils.applyAlpha( - root.glassMode - ? ColorUtils.mix(Appearance.colors.colSecondaryContainer, Appearance.colors.colLayer1, 0.58) - : ColorUtils.mix(Appearance.colors.colLayer2, Appearance.colors.colLayer1, 0.55), - root.draggingTargetSpecialWorkspace === root.createSpecialWorkspaceTarget ? 0.90 : root.effectiveWorkspaceOpacity - ) - border.width: 1 - border.color: root.draggingTargetSpecialWorkspace === root.createSpecialWorkspaceTarget - ? ColorUtils.applyAlpha(root.activeBorderColor, 0.96) - : ColorUtils.applyAlpha(Appearance.colors.colSecondary, 0.46) - - Image { - visible: createSpecialWorkspaceTile.showWallpaper - anchors.fill: parent - source: root.wallpaperSource(root.specialEmptyWorkspaceWallpaperPath) - fillMode: Image.PreserveAspectCrop - asynchronous: true - cache: true - smooth: true - mipmap: true - } - - Rectangle { - visible: createSpecialWorkspaceTile.showWallpaper - anchors.fill: parent - radius: parent.radius - color: ColorUtils.applyAlpha( - root.glassMode - ? ColorUtils.mix(Appearance.colors.colSecondaryContainer, Appearance.colors.colLayer0, 0.40) - : ColorUtils.mix(Appearance.colors.colLayer2, Appearance.colors.colLayer1, 0.55), - root.draggingTargetSpecialWorkspace === root.createSpecialWorkspaceTarget - ? Math.min(0.28, root.emptyWorkspaceWallpaperOverlayOpacity + 0.08) - : root.emptyWorkspaceWallpaperOverlayOpacity - ) - } - - Rectangle { - anchors.fill: parent - anchors.margins: 1 - radius: Math.max(parent.radius - 1, 0) - color: "transparent" - border.width: 1 - border.color: ColorUtils.applyAlpha("#FFFFFF", root.glassMode ? 0.12 : 0.08) - } - - Column { - anchors.centerIn: parent - spacing: 0 - - StyledText { - anchors.horizontalCenter: parent.horizontalCenter - visible: !createSpecialWorkspaceTile.showWallpaper - text: root.draggingTargetSpecialWorkspace === root.createSpecialWorkspaceTarget ? "Release" : "+" - font.family: Appearance.font.family.expressive - font.pixelSize: root.draggingTargetSpecialWorkspace === root.createSpecialWorkspaceTarget - ? Appearance.font.pixelSize.larger * root.scale - : Appearance.font.pixelSize.huge * 1.25 * root.scale - font.weight: Font.DemiBold - color: ColorUtils.applyAlpha(Appearance.colors.colOnLayer1, 0.92) - horizontalAlignment: Text.AlignHCenter - } - } - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton - onClicked: { - const createdName = root.nextSpecialWorkspaceName(); - GlobalStates.overviewOpen = false; - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.workspace.toggle_special('${createdName}')`); - } else { - Hyprland.dispatch(`togglespecialworkspace ${createdName}`); - } - } - } - - DropArea { - anchors.fill: parent - onEntered: { - root.draggingTargetWorkspace = -1; - root.draggingTargetSpecialWorkspace = root.createSpecialWorkspaceTarget; - } - onExited: { - if (root.draggingTargetSpecialWorkspace === root.createSpecialWorkspaceTarget) - root.draggingTargetSpecialWorkspace = ""; - } - } - } - } - } - } - } - - Item { // Windows & focused workspace indicator - id: windowSpace - anchors.centerIn: parent - implicitWidth: contentLayout.implicitWidth - implicitHeight: contentLayout.implicitHeight - - WheelHandler { - target: null - acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad - onWheel: event => { - const deltaY = event.angleDelta.y; - if (!deltaY) - return; - root.stepWorkspace(deltaY > 0 ? -1 : 1); - event.accepted = true; - } - } - - Repeater { // Window repeater - model: ScriptModel { - values: { - return ToplevelManager.toplevels.values.filter((toplevel) => { - const address = `0x${toplevel.HyprlandToplevel.address}` - var win = windowByAddress[address] - if (root.isSpecialWorkspace(win)) - return false; - const minWorkspace = root.workspaceGroup * root.workspacesShown + 1 + workspaceOffset; - const maxWorkspace = (root.workspaceGroup + 1) * root.workspacesShown + workspaceOffset; - const inWorkspaceGroup = (minWorkspace <= win?.workspace?.id && win?.workspace?.id <= maxWorkspace) - return inWorkspaceGroup; - }).sort((a, b) => { - // Proper stacking order based on Hyprland's window properties - const addrA = `0x${a.HyprlandToplevel.address}` - const addrB = `0x${b.HyprlandToplevel.address}` - const winA = windowByAddress[addrA] - const winB = windowByAddress[addrB] - - // 1. Pinned windows are always on top - if (winA?.pinned !== winB?.pinned) { - return winA?.pinned ? 1 : -1 - } - - // 2. Floating windows above tiled windows - if (winA?.floating !== winB?.floating) { - return winA?.floating ? 1 : -1 - } - - // 3. Within same category, sort by focus history - // Lower focusHistoryID = more recently focused = higher in stack - return (winB?.focusHistoryID ?? 0) - (winA?.focusHistoryID ?? 0) - }) - } - } - delegate: OverviewWindow { - id: window - required property var modelData - required property int index - property int monitorId: windowData?.monitor - property var monitor: HyprlandData.monitors.find(m => m.id === monitorId) - property var address: `0x${modelData.HyprlandToplevel.address}` - windowData: windowByAddress[address] - toplevel: modelData - monitorData: monitor - widgetMonitorData: root.monitorData - scale: root.scale - availableWorkspaceWidth: root.workspaceImplicitWidth - availableWorkspaceHeight: root.workspaceImplicitHeight - widgetMonitorId: root.monitor.id - recaptureToken: root.previewRecaptureToken - - property bool atInitPosition: (initX == x && initY == y) - - property int workspaceColIndex: root.getWorkspaceColumn(windowData?.workspace.id) - property int workspaceRowIndex: root.getWorkspaceRow(windowData?.workspace.id) - property int visibleWorkspaceRowIndex: root.getVisibleRowPosition(workspaceRowIndex) - xOffset: (root.workspaceImplicitWidth + workspaceSpacing) * workspaceColIndex - yOffset: (root.workspaceImplicitHeight + workspaceSpacing) * visibleWorkspaceRowIndex - - Timer { - id: updateWindowPosition - interval: Config.options.hacks.arbitraryRaceConditionDelay - repeat: false - running: false - onTriggered: { - window.x = Math.round(Math.max((windowData?.at[0] - (monitor?.x ?? 0) - (monitorData?.reserved?.[0] ?? 0)) * root.scale * window.widthRatio, 0) + xOffset) - window.y = Math.round(Math.max((windowData?.at[1] - (monitor?.y ?? 0) - (monitorData?.reserved?.[1] ?? 0)) * root.scale * window.heightRatio, 0) + yOffset) - } - } - - z: atInitPosition ? (root.windowZ + index) : root.windowDraggingZ - Drag.hotSpot.x: targetWindowWidth / 2 - Drag.hotSpot.y: targetWindowHeight / 2 - MouseArea { - id: dragArea - anchors.fill: parent - hoverEnabled: true - onEntered: hovered = true - onExited: hovered = false - acceptedButtons: Qt.LeftButton | Qt.MiddleButton - drag.target: parent - onPressed: (mouse) => { - root.draggingFromWorkspace = windowData?.workspace.id - root.draggingTargetSpecialWorkspace = "" - window.pressed = true - window.Drag.active = true - window.Drag.source = window - window.Drag.hotSpot.x = mouse.x - window.Drag.hotSpot.y = mouse.y - } - onReleased: { - const targetWorkspace = root.draggingTargetWorkspace - const targetSpecialWorkspace = root.draggingTargetSpecialWorkspace - window.pressed = false - window.Drag.active = false - root.draggingFromWorkspace = -1 - root.draggingTargetWorkspace = -1 - root.draggingTargetSpecialWorkspace = "" - if (targetSpecialWorkspace === root.createSpecialWorkspaceTarget) { - const createdName = root.nextSpecialWorkspaceName() - //INFO: From normal TO special - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.window.move({workspace = 'special:${createdName}', follow = false, window = 'address:${window.windowData?.address}'})`); - } else { - Hyprland.dispatch(`movetoworkspacesilent special:${createdName}, address:${window.windowData?.address}`) - } - updateWindowPosition.restart() - } - else if (targetSpecialWorkspace && targetSpecialWorkspace !== root.specialWorkspaceName(windowData)) { - // Idk - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.window.move({workspace = 'special:${targetSpecialWorkspace}', follow = false, window = 'address:${window.windowData?.address}'})`); - } else { - Hyprland.dispatch(`movetoworkspacesilent special:${targetSpecialWorkspace}, address:${window.windowData?.address}`) - } - updateWindowPosition.restart() - } - else if (targetWorkspace !== -1 && targetWorkspace !== windowData?.workspace.id) { - //INFO: From normal TO normal - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.window.move({workspace = '${targetWorkspace}', follow = false, window = 'address:${window.windowData?.address}'})`); - } else { - Hyprland.dispatch(`movetoworkspacesilent ${targetWorkspace}, address:${window.windowData?.address}`) - } - updateWindowPosition.restart() - } - else { - window.x = window.initX - window.y = window.initY - } - } - onClicked: (event) => { - if (!windowData) return; - - if (event.button === Qt.LeftButton) { - GlobalStates.overviewOpen = false - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.focus({ window = 'address:${windowData.address}' })`); - } else { - Hyprland.dispatch(`focuswindow address:${windowData.address}`) - } - event.accepted = true - } else if (event.button === Qt.MiddleButton) { - if (Hyprland.usingLua) { - Hyprland.dispatch(`hl.dsp.window.close('address:${windowData.address}')`); - } else { - Hyprland.dispatch(`closewindow address:${windowData.address}`) - } - event.accepted = true - } - } - - StyledToolTip { - extraVisibleCondition: false - alternativeVisibleCondition: dragArea.containsMouse && !window.Drag.active - text: `${windowData?.title ?? "Unknown"}\n[${windowData?.class ?? "unknown"}] ${windowData?.xwayland ? "[XWayland] " : ""}` - } - } - } - } - - Rectangle { // Focused workspace indicator - id: focusedWorkspaceIndicator - property int activeWorkspaceRowIndex: root.getWorkspaceRow(root.effectiveActiveWorkspaceId) - property int visibleActiveWorkspaceRowIndex: root.getVisibleRowPosition(activeWorkspaceRowIndex) - property int activeWorkspaceColIndex: root.getWorkspaceColumn(root.effectiveActiveWorkspaceId) - x: (root.workspaceImplicitWidth + workspaceSpacing) * activeWorkspaceColIndex - y: (root.workspaceImplicitHeight + workspaceSpacing) * visibleActiveWorkspaceRowIndex - z: root.windowDraggingZ - 1 - width: root.workspaceImplicitWidth - height: root.workspaceImplicitHeight - color: "transparent" - radius: Appearance.rounding.screenRounding * root.scale - border.width: 2 - border.color: root.activeBorderColor - Behavior on x { - animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this) - } - Behavior on y { - animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this) - } - } - } - - Item { - id: specialWindowDragLayer - anchors.fill: parent - z: root.windowDraggingZ + 1 - } - } -} diff --git a/config/quickshell/overview-trixie/modules/overview/OverviewWindow.qml b/config/quickshell/overview-trixie/modules/overview/OverviewWindow.qml deleted file mode 100644 index 3b2652a9..00000000 --- a/config/quickshell/overview-trixie/modules/overview/OverviewWindow.qml +++ /dev/null @@ -1,264 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Effects -import Quickshell -import Quickshell.Wayland -import "../../common" -import "../../common/functions" -import "../../services" - -Item { // Window - id: root - property var toplevel - property var windowData - property var monitorData - property var widgetMonitorData - property var scale - property var availableWorkspaceWidth - property var availableWorkspaceHeight - property real positionBaseX: (monitorData?.x ?? 0) + (monitorData?.reserved?.[0] ?? 0) - property real positionBaseY: (monitorData?.y ?? 0) + (monitorData?.reserved?.[1] ?? 0) - property int recaptureToken: 0 - property bool restrictToWorkspace: true - property real widthRatio: { - if (!widgetMonitorData || !monitorData) - return 1; - - const widgetWidth = (widgetMonitorData.transform % 2 === 1) ? (widgetMonitorData.height ?? 1) : (widgetMonitorData.width ?? 1); - const sourceWidth = (monitorData.transform % 2 === 1) ? (monitorData.height ?? 1) : (monitorData.width ?? 1); - const sourceScale = monitorData.scale ?? 1; - const widgetScale = widgetMonitorData.scale ?? 1; - return (widgetWidth * sourceScale) / (sourceWidth * widgetScale); - } - property real heightRatio: { - if (!widgetMonitorData || !monitorData) - return 1; - - const widgetHeight = (widgetMonitorData.transform % 2 === 1) ? (widgetMonitorData.width ?? 1) : (widgetMonitorData.height ?? 1); - const sourceHeight = (monitorData.transform % 2 === 1) ? (monitorData.width ?? 1) : (monitorData.height ?? 1); - const sourceScale = monitorData.scale ?? 1; - const widgetScale = widgetMonitorData.scale ?? 1; - return (widgetHeight * sourceScale) / (sourceHeight * widgetScale); - } - property real initX: Math.max(((windowData?.at[0] ?? 0) - positionBaseX) * root.scale * geometryScaleX, 0) + xOffset - property real initY: Math.max(((windowData?.at[1] ?? 0) - positionBaseY) * root.scale * geometryScaleY, 0) + yOffset - property real xOffset: 0 - property real yOffset: 0 - property int widgetMonitorId: 0 - property real geometryScaleX: widthRatio - property real geometryScaleY: heightRatio - - property var targetWindowWidth: (windowData?.size[0] ?? 100) * scale * geometryScaleX - property var targetWindowHeight: (windowData?.size[1] ?? 100) * scale * geometryScaleY - property bool hovered: false - property bool pressed: false - - property bool showIcons: Config.options.windowPreview.showIcons - property var iconToWindowRatio: Config.options.windowPreview.iconToWindowRatio - property var xwaylandIndicatorToIconRatio: Config.options.windowPreview.xwaylandIndicatorToIconRatio - property var iconToWindowRatioCompact: Config.options.windowPreview.iconToWindowRatioCompact - property bool cropToFill: Config.options.windowPreview.cropToFill - property bool previewsEnabled: Config.options.overview.previewsEnabled - property bool includeInactiveMonitorPreviews: Config.options.overview.includeInactiveMonitorPreviews - property int previewRecaptureDelayMs: Config.options.overview.previewRecaptureDelayMs - property real windowOverlayOpacity: Math.max(0, Math.min(1, Config.options.overview.effects.windowOverlayOpacity)) - property bool glassMode: Config.options.overview.effects.glassMode - property real glassShineOpacity: Math.max(0, Math.min(1, Config.options.overview.effects.glassShineOpacity)) - property real effectiveWindowOverlayOpacity: glassMode ? Math.min(windowOverlayOpacity, 0.10) : windowOverlayOpacity - property string previewModeRaw: Config.options.overview.previewMode - property string previewMode: { - const mode = `${previewModeRaw ?? "live"}`.trim().toLowerCase(); - return (mode === "event" || mode === "snapshot") ? "event" : "live"; - } - property bool livePreviewEnabled: previewsEnabled && previewMode === "live" - property bool shouldCapturePreview: { - if (!GlobalStates.overviewOpen || !previewsEnabled || !previewCaptureEnabled) - return false; - if (includeInactiveMonitorPreviews) - return true; - return (windowData?.monitor ?? -1) === widgetMonitorId; - } - property var entry: { - DesktopEntries.applications.values; // re-run when the entry index updates - return DesktopEntries.heuristicLookup(windowData?.class); - } - property string iconName: { - const raw = `${entry?.icon ?? ""}`.trim(); - const withoutProviderPrefix = raw.replace(/^image:\/\/icon\//, ""); - const withoutQuery = withoutProviderPrefix.split("?")[0].trim(); - return withoutQuery.length > 0 ? withoutQuery : "application-x-executable"; - } - property var iconPath: Quickshell.iconPath(iconName, "image-missing") - property bool compactMode: Appearance.font.pixelSize.smaller * 4 > targetWindowHeight || Appearance.font.pixelSize.smaller * 4 > targetWindowWidth - - property bool indicateXWayland: windowData?.xwayland ?? false - property bool previewCaptureEnabled: true - property bool initialized: false - property bool dragInProgress: false - property bool suspendPositionAnimation: false - property bool animateSize: true - - x: initX - y: initY - width: Math.min(targetWindowWidth, availableWorkspaceWidth) - height: Math.min(targetWindowHeight, availableWorkspaceHeight) - opacity: (windowData?.monitor ?? -1) == widgetMonitorId ? 1 : Config.options.windowPreview.inactiveMonitorOpacity - visible: { - const thisWsId = windowData?.workspace?.id; - const isFullscreen = (windowData?.fullscreen ?? 0) > 0; - if (isFullscreen || thisWsId === undefined) return true; - return !HyprlandData.windowList.some(w => w.workspace?.id === thisWsId && (w.fullscreen ?? 0) > 0); - } - - clip: true - Component.onCompleted: Qt.callLater(() => root.initialized = true) - - Behavior on x { - enabled: root.initialized && !root.dragInProgress && !root.suspendPositionAnimation - animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) - } - Behavior on y { - enabled: root.initialized && !root.dragInProgress && !root.suspendPositionAnimation - animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) - } - Behavior on width { - enabled: root.initialized && root.animateSize && !root.dragInProgress && !root.suspendPositionAnimation - animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) - } - Behavior on height { - enabled: root.initialized && root.animateSize && !root.dragInProgress && !root.suspendPositionAnimation - animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) - } - - // Opaque background for windows on the active monitor. - // The simplest solution for making those windows fully opaque and not interacting with actual - // windows behind the overview, e.g., applying blur to them. - Rectangle { - visible: (root.windowData?.monitor ?? -1) === root.widgetMonitorId - anchors.fill: parent - radius: Appearance.rounding.windowRounding * root.scale - color: root.glassMode - ? ColorUtils.mix(Appearance.colors.colLayer2, Appearance.colors.colLayer0, 0.38) - : Appearance.colors.colLayer2 - } - - ScreencopyView { - id: windowPreview - readonly property real srcAspect: { - const w = root.windowData?.size?.[0] ?? 0; - const h = root.windowData?.size?.[1] ?? 0; - return (w > 0 && h > 0) ? (w / h) : 1; - } - anchors.centerIn: parent - width: root.cropToFill - ? Math.max(parent.width, parent.height * srcAspect) - : Math.min(parent.width, parent.height * srcAspect) - height: root.cropToFill - ? Math.max(parent.height, parent.width / srcAspect) - : Math.min(parent.height, parent.width / srcAspect) - captureSource: shouldCapturePreview ? root.toplevel : null - live: livePreviewEnabled - layer.enabled: true - layer.smooth: true - layer.effect: MultiEffect { - maskEnabled: true - maskSource: previewMask - maskThresholdMin: 0.5 - maskSpreadAtMin: 1.0 - } - } - - Rectangle { - anchors.fill: parent - radius: Appearance.rounding.windowRounding * root.scale - color: pressed ? ColorUtils.applyAlpha(Appearance.colors.colLayer2Active, Math.min(1, root.effectiveWindowOverlayOpacity + 0.30)) : - hovered ? ColorUtils.applyAlpha(Appearance.colors.colLayer2Hover, Math.min(1, root.effectiveWindowOverlayOpacity + 0.20)) : - ColorUtils.applyAlpha( - root.glassMode ? ColorUtils.mix(Appearance.colors.colLayer2, Appearance.colors.colLayer0, 0.38) : Appearance.colors.colLayer2, - root.effectiveWindowOverlayOpacity - ) - border.color: root.glassMode - ? ColorUtils.applyAlpha(Appearance.m3colors.m3outline, 0.62) - : ColorUtils.transparentize(Appearance.m3colors.m3outline, 0.7) - border.width: 1 - - Rectangle { - visible: root.glassMode - anchors.fill: parent - radius: parent.radius - color: "transparent" - gradient: Gradient { - GradientStop { position: 0.0; color: ColorUtils.applyAlpha("#FFFFFF", root.glassShineOpacity * 0.24) } - GradientStop { position: 0.5; color: ColorUtils.applyAlpha("#FFFFFF", 0.0) } - GradientStop { position: 1.0; color: ColorUtils.applyAlpha("#000000", root.glassShineOpacity * 0.14) } - } - } - - Rectangle { - visible: root.glassMode - anchors.fill: parent - anchors.margins: 1 - radius: Math.max(parent.radius - 1, 0) - color: "transparent" - border.width: 1 - border.color: ColorUtils.applyAlpha("#FFFFFF", root.glassShineOpacity * 0.32) - } - - ColumnLayout { - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.right: parent.right - spacing: Appearance.font.pixelSize.smaller * 0.5 - - Image { - id: windowIcon - visible: root.showIcons - property var iconSize: { - const renderedSize = Math.min(root.width, root.height); - return renderedSize * (root.compactMode ? root.iconToWindowRatioCompact : root.iconToWindowRatio) / (root.monitorData?.scale ?? 1); - } - Layout.alignment: Qt.AlignHCenter - source: root.iconPath - width: iconSize - height: iconSize - sourceSize: Qt.size(Math.max(1, Math.round(iconSize)), Math.max(1, Math.round(iconSize))) - } - } - } - - Item { - id: previewMask - width: windowPreview.width - height: windowPreview.height - anchors.centerIn: parent - visible: false - layer.enabled: true - layer.smooth: true - Rectangle { - anchors.centerIn: parent - width: root.width - height: root.height - radius: Appearance.rounding.windowRounding * root.scale - } - } - - function refreshCapture() { - if (!GlobalStates.overviewOpen || livePreviewEnabled || !previewsEnabled) - return; - - root.previewCaptureEnabled = false; - previewResetTimer.restart(); - } - - Timer { - id: previewResetTimer - interval: Math.max(1, previewRecaptureDelayMs) - repeat: false - onTriggered: root.previewCaptureEnabled = true - } - - onRecaptureTokenChanged: { - if (recaptureToken > 0) - root.refreshCapture(); - } -} diff --git a/config/quickshell/overview-trixie/modules/overview/qmldir b/config/quickshell/overview-trixie/modules/overview/qmldir deleted file mode 100644 index 9b15b45b..00000000 --- a/config/quickshell/overview-trixie/modules/overview/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -Overview 1.0 Overview.qml -OverviewWidget 1.0 OverviewWidget.qml -OverviewWindow 1.0 OverviewWindow.qml diff --git a/config/quickshell/overview-trixie/quickshell-overview.qml b/config/quickshell/overview-trixie/quickshell-overview.qml deleted file mode 100644 index 95176b4e..00000000 --- a/config/quickshell/overview-trixie/quickshell-overview.qml +++ /dev/null @@ -1,41 +0,0 @@ - -import QtQuick - -QtObject { - id: m3 - - property color m3primary: "{{colors.primary.default.hex}}" - property color m3onPrimary: "{{colors.on_primary.default.hex}}" - - property color m3primaryContainer: "{{colors.primary_container.default.hex}}" - property color m3onPrimaryContainer: "{{colors.on_primary_container.default.hex}}" - - property color m3secondary: "{{colors.secondary.default.hex}}" - property color m3onSecondary: "{{colors.on_secondary.default.hex}}" - - property color m3secondaryContainer: "{{colors.secondary_container.default.hex}}" - property color m3onSecondaryContainer: "{{colors.on_secondary_container.default.hex}}" - - property color m3background: "{{colors.background.default.hex}}" - property color m3onBackground: "{{colors.on_background.default.hex}}" - - property color m3surface: "{{colors.surface.default.hex}}" - - property color m3surfaceContainerLow: "{{colors.surface_container_low.default.hex}}" - property color m3surfaceContainer: "{{colors.surface_container.default.hex}}" - property color m3surfaceContainerHigh: "{{colors.surface_container_high.default.hex}}" - property color m3surfaceContainerHighest: "{{colors.surface_container_highest.default.hex}}" - - property color m3onSurface: "{{colors.on_surface.default.hex}}" - - property color m3surfaceVariant: "{{colors.surface_variant.default.hex}}" - property color m3onSurfaceVariant: "{{colors.on_surface_variant.default.hex}}" - - property color m3inverseSurface: "{{colors.inverse_surface.default.hex}}" - property color m3inverseOnSurface: "{{colors.inverse_on_surface.default.hex}}" - - property color m3outline: "{{colors.outline.default.hex}}" - property color m3outlineVariant: "{{colors.outline_variant.default.hex}}" - - property color m3shadow: "#000000" -} diff --git a/config/quickshell/overview-trixie/services/GlobalStates.qml b/config/quickshell/overview-trixie/services/GlobalStates.qml deleted file mode 100644 index 7644e385..00000000 --- a/config/quickshell/overview-trixie/services/GlobalStates.qml +++ /dev/null @@ -1,11 +0,0 @@ -pragma Singleton -pragma ComponentBehavior: Bound - -import QtQuick -import Quickshell - -Singleton { - id: root - property bool overviewOpen: false - property bool superReleaseMightTrigger: true -} diff --git a/config/quickshell/overview-trixie/services/HyprlandData.qml b/config/quickshell/overview-trixie/services/HyprlandData.qml deleted file mode 100644 index 6127e989..00000000 --- a/config/quickshell/overview-trixie/services/HyprlandData.qml +++ /dev/null @@ -1,209 +0,0 @@ -pragma Singleton -pragma ComponentBehavior: Bound - -import QtQuick -import Quickshell -import Quickshell.Io -import Quickshell.Hyprland -import "../common" - -/** - * Provides access to some Hyprland data not available in Quickshell.Hyprland. - */ -Singleton { - id: root - property var windowList: [] - property var addresses: [] - property var windowByAddress: ({}) - property var workspaces: [] - property var allWorkspaces: [] - property var workspaceIds: [] - property var workspaceById: ({}) - property var activeWorkspace: null - property var monitors: [] - property var layers: ({}) - property bool pendingWindowsUpdate: false - property bool pendingMonitorsUpdate: false - property bool pendingLayersUpdate: false - property bool pendingWorkspacesUpdate: false - property bool pendingActiveWorkspaceUpdate: false - - function updateWindowList() { - getClients.running = true; - } - - function updateLayers() { - getLayers.running = true; - } - - function updateMonitors() { - getMonitors.running = true; - } - - function updateWorkspaces() { - getWorkspaces.running = true; - getActiveWorkspace.running = true; - } - - function updateAll() { - scheduleUpdates(true, true, true, true, true); - } - - function scheduleUpdates(windows, monitors, layers, workspaces, activeWorkspace) { - pendingWindowsUpdate = pendingWindowsUpdate || !!windows; - pendingMonitorsUpdate = pendingMonitorsUpdate || !!monitors; - pendingLayersUpdate = pendingLayersUpdate || !!layers; - pendingWorkspacesUpdate = pendingWorkspacesUpdate || !!workspaces; - pendingActiveWorkspaceUpdate = pendingActiveWorkspaceUpdate || !!activeWorkspace; - - const debounceMs = Math.max(0, Config.options.hacks.hyprlandEventDebounceMs); - if (debounceMs === 0) { - flushPendingUpdates(); - } else { - eventDebounceTimer.interval = debounceMs; - eventDebounceTimer.restart(); - } - } - - function flushPendingUpdates() { - if (pendingWindowsUpdate) { - pendingWindowsUpdate = false; - updateWindowList(); - } - if (pendingMonitorsUpdate) { - pendingMonitorsUpdate = false; - updateMonitors(); - } - if (pendingLayersUpdate) { - pendingLayersUpdate = false; - updateLayers(); - } - if (pendingWorkspacesUpdate) { - pendingWorkspacesUpdate = false; - getWorkspaces.running = true; - } - if (pendingActiveWorkspaceUpdate) { - pendingActiveWorkspaceUpdate = false; - getActiveWorkspace.running = true; - } - } - - function biggestWindowForWorkspace(workspaceId) { - const windowsInThisWorkspace = HyprlandData.windowList.filter(w => w.workspace.id == workspaceId); - return windowsInThisWorkspace.reduce((maxWin, win) => { - const maxArea = (maxWin?.size?.[0] ?? 0) * (maxWin?.size?.[1] ?? 0); - const winArea = (win?.size?.[0] ?? 0) * (win?.size?.[1] ?? 0); - return winArea > maxArea ? win : maxWin; - }, null); - } - - Component.onCompleted: { - scheduleUpdates(true, true, true, true, true); - flushPendingUpdates(); - } - - Connections { - target: Hyprland - - function onRawEvent(event) { - const eventName = `${event?.name ?? event?.event ?? event?.type ?? ""}`; - if (["openlayer", "closelayer", "screencast"].includes(eventName)) - return; - - if (eventName === "openwindow" || eventName === "closewindow" || eventName === "movewindow" || eventName === "movewindowv2" || eventName === "windowtitle") { - scheduleUpdates(true, false, false, true, false); - return; - } - - if (eventName === "workspace" || eventName === "workspacev2" || eventName === "focusedmon" || eventName === "focusedmonv2" || eventName === "activewindow" || eventName === "activewindowv2") { - scheduleUpdates(false, false, false, true, true); - return; - } - - if (eventName.startsWith("monitor") || eventName === "configreloaded") { - scheduleUpdates(true, true, false, true, true); - return; - } - - scheduleUpdates(true, true, true, true, true); - } - } - - Timer { - id: eventDebounceTimer - interval: Math.max(0, Config.options.hacks.hyprlandEventDebounceMs) - repeat: false - onTriggered: root.flushPendingUpdates() - } - - Process { - id: getClients - command: ["hyprctl", "clients", "-j"] - stdout: StdioCollector { - id: clientsCollector - onStreamFinished: { - root.windowList = JSON.parse(clientsCollector.text); - let tempWinByAddress = {}; - for (var i = 0; i < root.windowList.length; ++i) { - var win = root.windowList[i]; - tempWinByAddress[win.address] = win; - } - root.windowByAddress = tempWinByAddress; - root.addresses = root.windowList.map(win => win.address); - } - } - } - - Process { - id: getMonitors - command: ["hyprctl", "monitors", "-j"] - stdout: StdioCollector { - id: monitorsCollector - onStreamFinished: { - root.monitors = JSON.parse(monitorsCollector.text); - } - } - } - - Process { - id: getLayers - command: ["hyprctl", "layers", "-j"] - stdout: StdioCollector { - id: layersCollector - onStreamFinished: { - root.layers = JSON.parse(layersCollector.text); - } - } - } - - Process { - id: getWorkspaces - command: ["hyprctl", "workspaces", "-j"] - stdout: StdioCollector { - id: workspacesCollector - onStreamFinished: { - const rawWorkspaces = JSON.parse(workspacesCollector.text); - root.allWorkspaces = rawWorkspaces; - root.workspaces = rawWorkspaces.filter(ws => ws.id >= 1 && ws.id <= 100); - let tempWorkspaceById = {}; - for (var i = 0; i < root.workspaces.length; ++i) { - var ws = root.workspaces[i]; - tempWorkspaceById[ws.id] = ws; - } - root.workspaceById = tempWorkspaceById; - root.workspaceIds = root.workspaces.map(ws => ws.id); - } - } - } - - Process { - id: getActiveWorkspace - command: ["hyprctl", "activeworkspace", "-j"] - stdout: StdioCollector { - id: activeWorkspaceCollector - onStreamFinished: { - root.activeWorkspace = JSON.parse(activeWorkspaceCollector.text); - } - } - } -} diff --git a/config/quickshell/overview-trixie/services/qmldir b/config/quickshell/overview-trixie/services/qmldir deleted file mode 100644 index b9008641..00000000 --- a/config/quickshell/overview-trixie/services/qmldir +++ /dev/null @@ -1,2 +0,0 @@ -singleton HyprlandData 1.0 HyprlandData.qml -singleton GlobalStates 1.0 GlobalStates.qml diff --git a/config/quickshell/overview-trixie/shell.qml b/config/quickshell/overview-trixie/shell.qml deleted file mode 100644 index 7fc9e0ee..00000000 --- a/config/quickshell/overview-trixie/shell.qml +++ /dev/null @@ -1,25 +0,0 @@ -//@ pragma UseQApplication -//@ pragma Env QT_QUICK_CONTROLS_STYLE=Basic -//@ pragma Env QT_QPA_PLATFORMTHEME= - -import "./modules/overview/" -import "./services/" -import "./common/" -import "./common/functions/" -import "./common/widgets/" - -import QtQuick -import Quickshell -import Quickshell.Hyprland - -ShellRoot { - Connections { - target: Quickshell - - function onReloadCompleted() { - Quickshell.inhibitReloadPopup(); - } - } - - Overview {} -} diff --git a/config/quickshell/overview-unified/README.md b/config/quickshell/overview-unified/README.md deleted file mode 100644 index c32e7ac5..00000000 --- a/config/quickshell/overview-unified/README.md +++ /dev/null @@ -1,214 +0,0 @@ -# Quickshell Overview for Hyprland - -<div align="center"> - -A standalone workspace overview module for Hyprland using Quickshell - shows all workspaces with live window previews, drag-and-drop support, and Super+Tab keybind. - - - - - - -</div> - ---- - -## 📸 Preview - - - -https://github.com/user-attachments/assets/79ceb141-6b9e-4956-8e09-aaf72b66550c - -> *Workspace overview showing live window previews with drag-and-drop support* - ---- - -## ✨ Features - -- 🖼️ Visual workspace overview showing all workspaces and windows -- 🎯 Click windows to focus them -- 🖱️ Middle-click windows to close them -- 🔄 Drag and drop windows between workspaces -- ⌨️ Keyboard navigation (Arrow keys to switch workspaces, Escape/Enter to close) -- 💡 Hover tooltips showing window information -- 🎨 Material Design 3 theming -- ⚡ Smooth animations and transitions - -## 📦 Installation - -### Prerequisites - -- **Hyprland** compositor -- **Quickshell** ([installation guide](https://quickshell.org/docs/v0.1.0/guide/install-setup/)) -- **Qt 6** with modules: QtQuick, QtQuick.Controls, Qt5Compat.GraphicalEffects - -### Setup - -1. **Clone this repository** to your Quickshell config directory: - ```bash - git clone https://github.com/Shanu-Kumawat/quickshell-overview ~/.config/quickshell/overview - ``` - -2. **Add keybind** to your Hyprland config (`~/.config/hypr/hyprland.conf`): - ```conf - bind = Super, TAB, exec, qs ipc -c overview call overview toggle - ``` - -3. **Auto-start** the overview (add to Hyprland config): - ```conf - exec-once = qs -c overview - ``` - -4. **Reload Hyprland**: - ```bash - hyprctl reload - ``` - -### Manual Start (if needed) - -```bash -qs -c overview & -``` - -## 🎮 Usage - -| Action | Description | -|--------|-------------| -| **Super + Tab** | Toggle the overview | -| **Left/Right Arrow Keys** | Navigate between workspaces horizontally | -| **Up/Down Arrow Keys** | Navigate between workspace rows | -| **Escape / Enter** | Close the overview | -| **Click workspace** | Switch to that workspace | -| **Click window** | Focus that window | -| **Middle-click window** | Close that window | -| **Drag window** | Move window to different workspace | - ---- - -## ⚙️ Configuration - -> **⚠️ Want to change the size, position, or number of workspaces?** -> Edit `~/.config/quickshell/overview/common/Config.qml` - it's all there! - -### Workspace Grid - -Edit `~/.config/quickshell/overview/common/Config.qml`: - -```qml -property QtObject overview: QtObject { - property int rows: 2 // Number of workspace rows - property int columns: 5 // Number of workspace columns (10 total workspaces) - property real scale: 0.16 // Overview scale factor (0.1-0.3, smaller = more compact) - property bool enable: true -} -``` - -**Common adjustments:** -- **Too small?** Increase `scale` (try 0.20 or 0.25) -- **Too big?** Decrease `scale` (try 0.12 or 0.14) -- **More workspaces?** Change `rows` and `columns` (e.g., 3 rows × 4 columns = 12 workspaces) - -### Position - -Edit `~/.config/quickshell/overview/modules/overview/Overview.qml` (line ~111): - -```qml -anchors { - horizontalCenter: parent.horizontalCenter - top: parent.top - topMargin: 100 // Change this value to move up/down -} -``` - -### Theme & Colors - -Edit `~/.config/quickshell/overview/common/Appearance.qml` to customize: -- Colors (m3colors and colors objects) -- Font families and sizes -- Animation curves and durations -- Border radius values - ---- - -## 📋 Requirements - -- **Hyprland** compositor (tested on latest versions) -- **Quickshell** (Qt6-based shell framework) -- **Qt 6** with the following modules: - - QtQuick - - QtQuick.Controls - - QtQuick.Layouts - - Qt5Compat.GraphicalEffects - - Quickshell.Wayland - - Quickshell.Hyprland - -## 🚫 Removed Features (from original illogical-impulse) - -The following features were removed to make it standalone: - -- App search functionality -- Emoji picker -- Clipboard history integration -- Search widget -- Integration with the full illogical-impulse shell ecosystem - -## 📁 File Structure - -``` -~/.config/quickshell/overview/ -├── shell.qml # Main entry point -├── README.md # This file -├── hyprland-config.conf # Configuration reference -├── common/ -│ ├── Appearance.qml # Theme and styling -│ ├── Config.qml # Configuration options -│ ├── functions/ -│ │ └── ColorUtils.qml # Color manipulation utilities -│ └── widgets/ -│ ├── StyledText.qml # Styled text component -│ ├── StyledRectangularShadow.qml -│ ├── StyledToolTip.qml -│ └── StyledToolTipContent.qml -├── services/ -│ ├── GlobalStates.qml # Global state management -│ └── HyprlandData.qml # Hyprland data provider -└── modules/ - └── overview/ - ├── Overview.qml # Main overview component - ├── OverviewWidget.qml # Workspace grid widget - └── OverviewWindow.qml # Individual window preview -``` - -## 🎯 IPC Commands - -```bash -# Toggle overview -qs ipc -c overview call overview toggle - -# Open overview -qs ipc -c overview call overview open - -# Close overview -qs ipc -c overview call overview close -``` - -## 🐛 Known Issues - -- Window icons may fallback to generic icon if app class name doesn't match icon theme -- Potential crashes during rapid window state changes due to Wayland screencopy buffer management - -## Credits - -Extracted from the overview feature in [illogical-impulse](https://github.com/end-4/dots-hyprland) by [end-4](https://github.com/end-4). - -Adapted as a standalone component for Hyprland + Quickshell users who want just the overview functionality. - ---- - -<div align="center"> - -**Note:** Maintenance will be limited due to time constraints, but **PRs and code improvements are welcome!** Feel free to contribute or fork for your own needs. - -Made with ❤️ for the Hyprland community - -</div> diff --git a/config/quickshell/overview-unified/assets/image.png b/config/quickshell/overview-unified/assets/image.png Binary files differdeleted file mode 100644 index 91db17cb..00000000 --- a/config/quickshell/overview-unified/assets/image.png +++ /dev/null diff --git a/config/quickshell/overview-unified/common/Appearance.qml b/config/quickshell/overview-unified/common/Appearance.qml deleted file mode 100644 index 79a30b44..00000000 --- a/config/quickshell/overview-unified/common/Appearance.qml +++ /dev/null @@ -1,148 +0,0 @@ -pragma Singleton -pragma ComponentBehavior: Bound - -import QtQuick -import Quickshell -import "functions" - -Singleton { - id: root - property QtObject m3colors - property QtObject animation - property QtObject animationCurves - property QtObject colors - property QtObject rounding - property QtObject font - property QtObject sizes - - m3colors: QtObject { - property bool darkmode: true - property color m3primary: "#E5B6F2" - property color m3onPrimary: "#452152" - property color m3primaryContainer: "#5D386A" - property color m3onPrimaryContainer: "#F9D8FF" - property color m3secondary: "#D5C0D7" - property color m3onSecondary: "#392C3D" - property color m3secondaryContainer: "#534457" - property color m3onSecondaryContainer: "#F2DCF3" - property color m3background: "#161217" - property color m3onBackground: "#EAE0E7" - property color m3surface: "#161217" - property color m3surfaceContainerLow: "#1F1A1F" - property color m3surfaceContainer: "#231E23" - property color m3surfaceContainerHigh: "#2D282E" - property color m3surfaceContainerHighest: "#383339" - property color m3onSurface: "#EAE0E7" - property color m3surfaceVariant: "#4C444D" - property color m3onSurfaceVariant: "#CFC3CD" - property color m3inverseSurface: "#EAE0E7" - property color m3inverseOnSurface: "#342F34" - property color m3outline: "#988E97" - property color m3outlineVariant: "#4C444D" - property color m3shadow: "#000000" - } - - colors: QtObject { - property color colSubtext: m3colors.m3outline - property color colLayer0: m3colors.m3background - property color colOnLayer0: m3colors.m3onBackground - property color colLayer0Border: ColorUtils.mix(root.m3colors.m3outlineVariant, colLayer0, 0.4) - property color colLayer1: m3colors.m3surfaceContainerLow - property color colOnLayer1: m3colors.m3onSurfaceVariant - property color colOnLayer1Inactive: ColorUtils.mix(colOnLayer1, colLayer1, 0.45) - property color colLayer1Hover: ColorUtils.mix(colLayer1, colOnLayer1, 0.92) - property color colLayer1Active: ColorUtils.mix(colLayer1, colOnLayer1, 0.85) - property color colLayer2: m3colors.m3surfaceContainer - property color colOnLayer2: m3colors.m3onSurface - property color colLayer2Hover: ColorUtils.mix(colLayer2, colOnLayer2, 0.90) - property color colLayer2Active: ColorUtils.mix(colLayer2, colOnLayer2, 0.80) - property color colPrimary: m3colors.m3primary - property color colOnPrimary: m3colors.m3onPrimary - property color colSecondary: m3colors.m3secondary - property color colSecondaryContainer: m3colors.m3secondaryContainer - property color colOnSecondaryContainer: m3colors.m3onSecondaryContainer - property color colTooltip: m3colors.m3inverseSurface - property color colOnTooltip: m3colors.m3inverseOnSurface - property color colShadow: ColorUtils.transparentize(m3colors.m3shadow, 0.7) - property color colOutline: m3colors.m3outline - } - - rounding: QtObject { - property int unsharpen: 2 - property int verysmall: 8 - property int small: 12 - property int normal: 17 - property int large: 23 - property int full: 9999 - property int screenRounding: large - property int windowRounding: 18 - } - - font: QtObject { - property QtObject family: QtObject { - property string main: "sans-serif" - property string title: "sans-serif" - property string expressive: "sans-serif" - } - property QtObject pixelSize: QtObject { - property int smaller: 12 - property int small: 15 - property int normal: 16 - property int larger: 19 - property int huge: 22 - } - } - - animationCurves: QtObject { - readonly property list<real> expressiveDefaultSpatial: [0.38, 1.21, 0.22, 1.00, 1, 1] - readonly property list<real> expressiveEffects: [0.34, 0.80, 0.34, 1.00, 1, 1] - readonly property list<real> emphasizedDecel: [0.05, 0.7, 0.1, 1, 1, 1] - readonly property real expressiveDefaultSpatialDuration: 500 - readonly property real expressiveEffectsDuration: 200 - } - - animation: QtObject { - property QtObject elementMove: QtObject { - property int duration: animationCurves.expressiveDefaultSpatialDuration - property int type: Easing.BezierSpline - property list<real> bezierCurve: animationCurves.expressiveDefaultSpatial - property Component numberAnimation: Component { - NumberAnimation { - duration: root.animation.elementMove.duration - easing.type: root.animation.elementMove.type - easing.bezierCurve: root.animation.elementMove.bezierCurve - } - } - } - - property QtObject elementMoveEnter: QtObject { - property int duration: 400 - property int type: Easing.BezierSpline - property list<real> bezierCurve: animationCurves.emphasizedDecel - property Component numberAnimation: Component { - NumberAnimation { - duration: root.animation.elementMoveEnter.duration - easing.type: root.animation.elementMoveEnter.type - easing.bezierCurve: root.animation.elementMoveEnter.bezierCurve - } - } - } - - property QtObject elementMoveFast: QtObject { - property int duration: animationCurves.expressiveEffectsDuration - property int type: Easing.BezierSpline - property list<real> bezierCurve: animationCurves.expressiveEffects - property Component numberAnimation: Component { - NumberAnimation { - duration: root.animation.elementMoveFast.duration - easing.type: root.animation.elementMoveFast.type - easing.bezierCurve: root.animation.elementMoveFast.bezierCurve - } - } - } - } - - sizes: QtObject { - property real elevationMargin: 10 - } -} diff --git a/config/quickshell/overview-unified/common/Config.qml b/config/quickshell/overview-unified/common/Config.qml deleted file mode 100644 index 48601dd3..00000000 --- a/config/quickshell/overview-unified/common/Config.qml +++ /dev/null @@ -1,22 +0,0 @@ -pragma Singleton -pragma ComponentBehavior: Bound - -import QtQuick -import Quickshell - -Singleton { - id: root - - property QtObject options: QtObject { - property QtObject overview: QtObject { - property int rows: 2 - property int columns: 5 - property real scale: 0.16 - property bool enable: true - } - - property QtObject hacks: QtObject { - property int arbitraryRaceConditionDelay: 150 - } - } -} diff --git a/config/quickshell/overview-unified/common/functions/ColorUtils.qml b/config/quickshell/overview-unified/common/functions/ColorUtils.qml deleted file mode 100644 index 6162df18..00000000 --- a/config/quickshell/overview-unified/common/functions/ColorUtils.qml +++ /dev/null @@ -1,68 +0,0 @@ -pragma Singleton -import Quickshell - -Singleton { - id: root - - function colorWithHueOf(color1, color2) { - var c1 = Qt.color(color1); - var c2 = Qt.color(color2); - var hue = c2.hsvHue; - var sat = c1.hsvSaturation; - var val = c1.hsvValue; - var alpha = c1.a; - return Qt.hsva(hue, sat, val, alpha); - } - - function colorWithSaturationOf(color1, color2) { - var c1 = Qt.color(color1); - var c2 = Qt.color(color2); - var hue = c1.hsvHue; - var sat = c2.hsvSaturation; - var val = c1.hsvValue; - var alpha = c1.a; - return Qt.hsva(hue, sat, val, alpha); - } - - function colorWithLightness(color, lightness) { - var c = Qt.color(color); - return Qt.hsla(c.hslHue, c.hslSaturation, lightness, c.a); - } - - function colorWithLightnessOf(color1, color2) { - var c2 = Qt.color(color2); - return colorWithLightness(color1, c2.hslLightness); - } - - function adaptToAccent(color1, color2) { - var c1 = Qt.color(color1); - var c2 = Qt.color(color2); - var hue = c2.hslHue; - var sat = c2.hslSaturation; - var light = c1.hslLightness; - var alpha = c1.a; - return Qt.hsla(hue, sat, light, alpha); - } - - function mix(color1, color2, percentage = 0.5) { - var c1 = Qt.color(color1); - var c2 = Qt.color(color2); - return Qt.rgba( - percentage * c1.r + (1 - percentage) * c2.r, - percentage * c1.g + (1 - percentage) * c2.g, - percentage * c1.b + (1 - percentage) * c2.b, - percentage * c1.a + (1 - percentage) * c2.a - ); - } - - function transparentize(color, percentage = 1) { - var c = Qt.color(color); - return Qt.rgba(c.r, c.g, c.b, c.a * (1 - percentage)); - } - - function applyAlpha(color, alpha) { - var c = Qt.color(color); - var a = Math.max(0, Math.min(1, alpha)); - return Qt.rgba(c.r, c.g, c.b, a); - } -} diff --git a/config/quickshell/overview-unified/common/functions/qmldir b/config/quickshell/overview-unified/common/functions/qmldir deleted file mode 100644 index 4c648e7e..00000000 --- a/config/quickshell/overview-unified/common/functions/qmldir +++ /dev/null @@ -1 +0,0 @@ -singleton ColorUtils 1.0 ColorUtils.qml diff --git a/config/quickshell/overview-unified/common/qmldir b/config/quickshell/overview-unified/common/qmldir deleted file mode 100644 index a8485188..00000000 --- a/config/quickshell/overview-unified/common/qmldir +++ /dev/null @@ -1,7 +0,0 @@ -singleton Appearance 1.0 Appearance.qml -singleton Config 1.0 Config.qml -singleton ColorUtils 1.0 functions/ColorUtils.qml -StyledText 1.0 widgets/StyledText.qml -StyledRectangularShadow 1.0 widgets/StyledRectangularShadow.qml -StyledToolTip 1.0 widgets/StyledToolTip.qml -StyledToolTipContent 1.0 widgets/StyledToolTipContent.qml diff --git a/config/quickshell/overview-unified/common/widgets/RectangularShadow.qml b/config/quickshell/overview-unified/common/widgets/RectangularShadow.qml deleted file mode 100644 index 2289d4c0..00000000 --- a/config/quickshell/overview-unified/common/widgets/RectangularShadow.qml +++ /dev/null @@ -1,28 +0,0 @@ -import QtQuick -import QtQuick.Effects - -Item { - id: root - - property var target: parent - property real radius: 0 - property real blur: 0 - property vector2d offset: Qt.vector2d(0.0, 0.0) - property real spread: 0 - property color color: "black" - property bool cached: false - - anchors.fill: target - visible: target !== null - - MultiEffect { - anchors.fill: target - source: target - shadowEnabled: true - shadowColor: root.color - shadowBlur: root.blur - shadowHorizontalOffset: root.offset.x - shadowVerticalOffset: root.offset.y - shadowOpacity: 1.0 - } -} diff --git a/config/quickshell/overview-unified/common/widgets/StyledRectangularShadow.qml b/config/quickshell/overview-unified/common/widgets/StyledRectangularShadow.qml deleted file mode 100644 index ccdff1ac..00000000 --- a/config/quickshell/overview-unified/common/widgets/StyledRectangularShadow.qml +++ /dev/null @@ -1,14 +0,0 @@ -import QtQuick -import QtQuick.Effects -import ".." - -RectangularShadow { - required property var target - anchors.fill: target - radius: 20 - blur: 0.9 * Appearance.sizes.elevationMargin - offset: Qt.vector2d(0.0, 1.0) - spread: 1 - color: Appearance.colors.colShadow - cached: true -} diff --git a/config/quickshell/overview-unified/common/widgets/StyledText.qml b/config/quickshell/overview-unified/common/widgets/StyledText.qml deleted file mode 100644 index abfcefae..00000000 --- a/config/quickshell/overview-unified/common/widgets/StyledText.qml +++ /dev/null @@ -1,16 +0,0 @@ -import QtQuick -import ".." - -Text { - id: root - property bool animateChange: false - - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter - font { - hintingPreference: Font.PreferFullHinting - family: Appearance?.font.family.main ?? "sans-serif" - pixelSize: Appearance?.font.pixelSize.small ?? 15 - } - color: Appearance?.m3colors.m3onBackground ?? "white" -} diff --git a/config/quickshell/overview-unified/common/widgets/StyledToolTip.qml b/config/quickshell/overview-unified/common/widgets/StyledToolTip.qml deleted file mode 100644 index 4d4678c8..00000000 --- a/config/quickshell/overview-unified/common/widgets/StyledToolTip.qml +++ /dev/null @@ -1,23 +0,0 @@ -import QtQuick -import QtQuick.Controls -import "." - -ToolTip { - id: root - property bool extraVisibleCondition: true - property bool alternativeVisibleCondition: false - readonly property bool internalVisibleCondition: (extraVisibleCondition && (parent.hovered === undefined || parent?.hovered)) || alternativeVisibleCondition - verticalPadding: 5 - horizontalPadding: 10 - background: null - - visible: internalVisibleCondition - - contentItem: StyledToolTipContent { - id: contentItem - text: root.text - shown: root.internalVisibleCondition - horizontalPadding: root.horizontalPadding - verticalPadding: root.verticalPadding - } -} diff --git a/config/quickshell/overview-unified/common/widgets/StyledToolTipContent.qml b/config/quickshell/overview-unified/common/widgets/StyledToolTipContent.qml deleted file mode 100644 index b8c29c1a..00000000 --- a/config/quickshell/overview-unified/common/widgets/StyledToolTipContent.qml +++ /dev/null @@ -1,49 +0,0 @@ -import QtQuick -import "." -import "../" - -Item { - id: root - required property string text - property bool shown: false - property real horizontalPadding: 10 - property real verticalPadding: 5 - implicitWidth: tooltipTextObject.implicitWidth + 2 * root.horizontalPadding - implicitHeight: tooltipTextObject.implicitHeight + 2 * root.verticalPadding - - property bool isVisible: backgroundRectangle.implicitHeight > 0 - - Rectangle { - id: backgroundRectangle - anchors { - bottom: root.bottom - horizontalCenter: root.horizontalCenter - } - color: Appearance?.colors.colTooltip ?? "#3C4043" - radius: Appearance?.rounding.verysmall ?? 7 - opacity: shown ? 1 : 0 - implicitWidth: shown ? (tooltipTextObject.implicitWidth + 2 * root.horizontalPadding) : 0 - implicitHeight: shown ? (tooltipTextObject.implicitHeight + 2 * root.verticalPadding) : 0 - clip: true - - Behavior on implicitWidth { - animation: Appearance?.animation.elementMoveFast.numberAnimation.createObject(this) - } - Behavior on implicitHeight { - animation: Appearance?.animation.elementMoveFast.numberAnimation.createObject(this) - } - Behavior on opacity { - animation: Appearance?.animation.elementMoveFast.numberAnimation.createObject(this) - } - - StyledText { - id: tooltipTextObject - anchors.centerIn: parent - text: root.text - font.pixelSize: Appearance?.font.pixelSize.smaller ?? 14 - font.hintingPreference: Font.PreferNoHinting - color: Appearance?.colors.colOnTooltip ?? "#FFFFFF" - wrapMode: Text.Wrap - } - } -} diff --git a/config/quickshell/overview-unified/common/widgets/qmldir b/config/quickshell/overview-unified/common/widgets/qmldir deleted file mode 100644 index c974f193..00000000 --- a/config/quickshell/overview-unified/common/widgets/qmldir +++ /dev/null @@ -1,5 +0,0 @@ -StyledText 1.0 StyledText.qml -StyledRectangularShadow 1.0 StyledRectangularShadow.qml -RectangularShadow 1.0 RectangularShadow.qml -StyledToolTip 1.0 StyledToolTip.qml -StyledToolTipContent 1.0 StyledToolTipContent.qml diff --git a/config/quickshell/overview-unified/modules/overview/Overview.qml b/config/quickshell/overview-unified/modules/overview/Overview.qml deleted file mode 100644 index b3a299cb..00000000 --- a/config/quickshell/overview-unified/modules/overview/Overview.qml +++ /dev/null @@ -1,147 +0,0 @@ -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts -import Quickshell -import Quickshell.Io -import Quickshell.Wayland -import Quickshell.Hyprland -import "../../common" -import "../../services" -import "." - -Scope { - id: overviewScope - Variants { - id: overviewVariants - model: Quickshell.screens - PanelWindow { - id: root - required property var modelData - readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.screen) - property bool monitorIsFocused: (Hyprland.focusedMonitor?.id == monitor?.id) - screen: modelData - visible: GlobalStates.overviewOpen - - WlrLayershell.namespace: "quickshell:overview" - WlrLayershell.layer: WlrLayer.Overlay - WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive - color: "transparent" - - mask: Region { - item: GlobalStates.overviewOpen ? keyHandler : null - } - - anchors { - top: true - bottom: true - left: !(Config?.options.overview.enable ?? true) - right: !(Config?.options.overview.enable ?? true) - } - - HyprlandFocusGrab { - id: grab - windows: [root] - property bool canBeActive: root.monitorIsFocused - active: false - onCleared: () => { - if (!active) - GlobalStates.overviewOpen = false; - } - } - - Connections { - target: GlobalStates - function onOverviewOpenChanged() { - if (GlobalStates.overviewOpen) { - delayedGrabTimer.start(); - } - } - } - - Timer { - id: delayedGrabTimer - interval: Config.options.hacks.arbitraryRaceConditionDelay - repeat: false - onTriggered: { - if (!grab.canBeActive) - return; - grab.active = GlobalStates.overviewOpen; - } - } - - implicitWidth: columnLayout.implicitWidth - implicitHeight: columnLayout.implicitHeight - - Item { - id: keyHandler - anchors.fill: parent - visible: GlobalStates.overviewOpen - focus: GlobalStates.overviewOpen - - Keys.onPressed: event => { - if (event.key === Qt.Key_Escape || event.key === Qt.Key_Return) { - GlobalStates.overviewOpen = false; - event.accepted = true; - } else if (event.key === Qt.Key_Left || event.key === Qt.Key_Right || event.key === Qt.Key_Up || event.key === Qt.Key_Down) { - const workspacesPerGroup = Config.options.overview.rows * Config.options.overview.columns; - const currentId = Hyprland.focusedMonitor?.activeWorkspace?.id ?? 1; - const currentGroup = Math.floor((currentId - 1) / workspacesPerGroup); - const minWorkspaceId = currentGroup * workspacesPerGroup + 1; - const maxWorkspaceId = minWorkspaceId + workspacesPerGroup - 1; - - let targetId; - if (event.key === Qt.Key_Left) { - targetId = currentId - 1; - if (targetId < minWorkspaceId) targetId = maxWorkspaceId; - } else if (event.key === Qt.Key_Right) { - targetId = currentId + 1; - if (targetId > maxWorkspaceId) targetId = minWorkspaceId; - } else if (event.key === Qt.Key_Up) { - targetId = currentId - Config.options.overview.columns; - if (targetId < minWorkspaceId) targetId += workspacesPerGroup; - } else { - targetId = currentId + Config.options.overview.columns; - if (targetId > maxWorkspaceId) targetId -= workspacesPerGroup; - } - - Hyprland.dispatch("workspace " + targetId); - event.accepted = true; - } - } - } - - ColumnLayout { - id: columnLayout - visible: GlobalStates.overviewOpen - anchors { - horizontalCenter: parent.horizontalCenter - top: parent.top - topMargin: 100 - } - - Loader { - id: overviewLoader - active: GlobalStates.overviewOpen && (Config?.options.overview.enable ?? true) - sourceComponent: OverviewWidget { - panelWindow: root - visible: true - } - } - } - } - } - - IpcHandler { - target: "overview" - - function toggle() { - GlobalStates.overviewOpen = !GlobalStates.overviewOpen; - } - function close() { - GlobalStates.overviewOpen = false; - } - function open() { - GlobalStates.overviewOpen = true; - } - } -} diff --git a/config/quickshell/overview-unified/modules/overview/OverviewWidget.qml b/config/quickshell/overview-unified/modules/overview/OverviewWidget.qml deleted file mode 100644 index 7defa64d..00000000 --- a/config/quickshell/overview-unified/modules/overview/OverviewWidget.qml +++ /dev/null @@ -1,303 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import Quickshell -import Quickshell.Wayland -import Quickshell.Hyprland -import "../../common" -import "../../common/functions" -import "../../common/widgets" -import "../../services" -import "." - -Item { - id: root - required property var panelWindow - readonly property HyprlandMonitor monitor: Hyprland.monitorFor(panelWindow.screen) - readonly property var toplevels: ToplevelManager.toplevels - readonly property int workspacesShown: Config.options.overview.rows * Config.options.overview.columns - readonly property int workspaceGroup: Math.floor((monitor.activeWorkspace?.id - 1) / workspacesShown) - property bool monitorIsFocused: (Hyprland.focusedMonitor?.name == monitor.name) - property var windows: HyprlandData.windowList - property var windowByAddress: HyprlandData.windowByAddress - property var windowAddresses: HyprlandData.addresses - property var monitorData: HyprlandData.monitors.find(m => m.id === root.monitor?.id) - property real scale: Config.options.overview.scale - property color activeBorderColor: Appearance.colors.colSecondary - - property real workspaceImplicitWidth: (monitorData?.transform % 2 === 1) ? - ((monitor.height / monitor.scale - (monitorData?.reserved?.[0] ?? 0) - (monitorData?.reserved?.[2] ?? 0)) * root.scale) : - ((monitor.width / monitor.scale - (monitorData?.reserved?.[0] ?? 0) - (monitorData?.reserved?.[2] ?? 0)) * root.scale) - property real workspaceImplicitHeight: (monitorData?.transform % 2 === 1) ? - ((monitor.width / monitor.scale - (monitorData?.reserved?.[1] ?? 0) - (monitorData?.reserved?.[3] ?? 0)) * root.scale) : - ((monitor.height / monitor.scale - (monitorData?.reserved?.[1] ?? 0) - (monitorData?.reserved?.[3] ?? 0)) * root.scale) - - property real workspaceNumberMargin: 80 - property real workspaceNumberSize: 250 * monitor.scale - property int workspaceZ: 0 - property int windowZ: 1 - property int windowDraggingZ: 99999 - property real workspaceSpacing: 5 - - property int draggingFromWorkspace: -1 - property int draggingTargetWorkspace: -1 - - implicitWidth: overviewBackground.implicitWidth + Appearance.sizes.elevationMargin * 2 - implicitHeight: overviewBackground.implicitHeight + Appearance.sizes.elevationMargin * 2 - - property Component windowComponent: OverviewWindow {} - property list<OverviewWindow> windowWidgets: [] - - StyledRectangularShadow { - target: overviewBackground - } - Rectangle { // Background - id: overviewBackground - property real padding: 10 - anchors.fill: parent - anchors.margins: Appearance.sizes.elevationMargin - - implicitWidth: workspaceColumnLayout.implicitWidth + padding * 2 - implicitHeight: workspaceColumnLayout.implicitHeight + padding * 2 - radius: Appearance.rounding.screenRounding * root.scale + padding - color: Appearance.colors.colLayer0 - border.width: 1 - border.color: Appearance.colors.colLayer0Border - - ColumnLayout { // Workspaces - id: workspaceColumnLayout - - z: root.workspaceZ - anchors.centerIn: parent - spacing: workspaceSpacing - Repeater { - model: Config.options.overview.rows - delegate: RowLayout { - id: row - property int rowIndex: index - spacing: workspaceSpacing - - Repeater { // Workspace repeater - model: Config.options.overview.columns - Rectangle { // Workspace - id: workspace - property int colIndex: index - property int workspaceValue: root.workspaceGroup * workspacesShown + rowIndex * Config.options.overview.columns + colIndex + 1 - property color defaultWorkspaceColor: Appearance.colors.colLayer1 - property color hoveredWorkspaceColor: ColorUtils.mix(defaultWorkspaceColor, Appearance.colors.colLayer1Hover, 0.1) - property color hoveredBorderColor: Appearance.colors.colLayer2Hover - property bool hoveredWhileDragging: false - - implicitWidth: root.workspaceImplicitWidth - implicitHeight: root.workspaceImplicitHeight - color: hoveredWhileDragging ? hoveredWorkspaceColor : defaultWorkspaceColor - radius: Appearance.rounding.screenRounding * root.scale - border.width: 2 - border.color: hoveredWhileDragging ? hoveredBorderColor : "transparent" - - StyledText { - anchors.centerIn: parent - text: workspaceValue - font { - pixelSize: root.workspaceNumberSize * root.scale - weight: Font.DemiBold - family: Appearance.font.family.expressive - } - color: ColorUtils.transparentize(Appearance.colors.colOnLayer1, 0.8) - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - - MouseArea { - id: workspaceArea - anchors.fill: parent - acceptedButtons: Qt.LeftButton - onClicked: { - if (root.draggingTargetWorkspace === -1) { - GlobalStates.overviewOpen = false - Hyprland.dispatch(`workspace ${workspaceValue}`) - } - } - } - - DropArea { - anchors.fill: parent - onEntered: { - root.draggingTargetWorkspace = workspaceValue - if (root.draggingFromWorkspace == root.draggingTargetWorkspace) return; - hoveredWhileDragging = true - } - onExited: { - hoveredWhileDragging = false - if (root.draggingTargetWorkspace == workspaceValue) root.draggingTargetWorkspace = -1 - } - } - - } - } - } - } - } - - Item { // Windows & focused workspace indicator - id: windowSpace - anchors.centerIn: parent - implicitWidth: workspaceColumnLayout.implicitWidth - implicitHeight: workspaceColumnLayout.implicitHeight - - Repeater { // Window repeater - model: ScriptModel { - values: { - return ToplevelManager.toplevels.values.filter((toplevel) => { - const address = `0x${toplevel.HyprlandToplevel.address}` - var win = windowByAddress[address] - const inWorkspaceGroup = (root.workspaceGroup * root.workspacesShown < win?.workspace?.id && win?.workspace?.id <= (root.workspaceGroup + 1) * root.workspacesShown) - return inWorkspaceGroup; - }).sort((a, b) => { - // Proper stacking order based on Hyprland's window properties - const addrA = `0x${a.HyprlandToplevel.address}` - const addrB = `0x${b.HyprlandToplevel.address}` - const winA = windowByAddress[addrA] - const winB = windowByAddress[addrB] - - // 1. Pinned windows are always on top - if (winA?.pinned !== winB?.pinned) { - return winA?.pinned ? 1 : -1 - } - - // 2. Floating windows above tiled windows - if (winA?.floating !== winB?.floating) { - return winA?.floating ? 1 : -1 - } - - // 3. Within same category, sort by focus history - // Lower focusHistoryID = more recently focused = higher in stack - return (winB?.focusHistoryID ?? 0) - (winA?.focusHistoryID ?? 0) - }) - } - } - delegate: OverviewWindow { - id: window - required property var modelData - required property int index - property int monitorId: windowData?.monitor - property var monitor: HyprlandData.monitors.find(m => m.id === monitorId) - property var address: `0x${modelData.HyprlandToplevel.address}` - windowData: windowByAddress[address] - toplevel: modelData - monitorData: monitor - - // Calculate scale relative to window's source monitor - property real sourceMonitorWidth: (monitor?.transform % 2 === 1) ? - (monitor?.height ?? 1920) / (monitor?.scale ?? 1) - (monitor?.reserved?.[0] ?? 0) - (monitor?.reserved?.[2] ?? 0) : - (monitor?.width ?? 1920) / (monitor?.scale ?? 1) - (monitor?.reserved?.[0] ?? 0) - (monitor?.reserved?.[2] ?? 0) - property real sourceMonitorHeight: (monitor?.transform % 2 === 1) ? - (monitor?.width ?? 1080) / (monitor?.scale ?? 1) - (monitor?.reserved?.[1] ?? 0) - (monitor?.reserved?.[3] ?? 0) : - (monitor?.height ?? 1080) / (monitor?.scale ?? 1) - (monitor?.reserved?.[1] ?? 0) - (monitor?.reserved?.[3] ?? 0) - - // Scale windows to fit the workspace size, accounting for different monitor sizes - scale: Math.min( - root.workspaceImplicitWidth / sourceMonitorWidth, - root.workspaceImplicitHeight / sourceMonitorHeight - ) - - availableWorkspaceWidth: root.workspaceImplicitWidth - availableWorkspaceHeight: root.workspaceImplicitHeight - widgetMonitorId: root.monitor.id - - property bool atInitPosition: (initX == x && initY == y) - - property int workspaceColIndex: (windowData?.workspace.id - 1) % Config.options.overview.columns - property int workspaceRowIndex: Math.floor((windowData?.workspace.id - 1) % root.workspacesShown / Config.options.overview.columns) - xOffset: (root.workspaceImplicitWidth + workspaceSpacing) * workspaceColIndex - yOffset: (root.workspaceImplicitHeight + workspaceSpacing) * workspaceRowIndex - - Timer { - id: updateWindowPosition - interval: Config.options.hacks.arbitraryRaceConditionDelay - repeat: false - running: false - onTriggered: { - window.x = Math.round(Math.max((windowData?.at[0] - (monitor?.x ?? 0) - (monitorData?.reserved?.[0] ?? 0)) * root.scale, 0) + xOffset) - window.y = Math.round(Math.max((windowData?.at[1] - (monitor?.y ?? 0) - (monitorData?.reserved?.[1] ?? 0)) * root.scale, 0) + yOffset) - } - } - - z: atInitPosition ? (root.windowZ + index) : root.windowDraggingZ - Drag.hotSpot.x: targetWindowWidth / 2 - Drag.hotSpot.y: targetWindowHeight / 2 - MouseArea { - id: dragArea - anchors.fill: parent - hoverEnabled: true - onEntered: hovered = true - onExited: hovered = false - acceptedButtons: Qt.LeftButton | Qt.MiddleButton - drag.target: parent - onPressed: (mouse) => { - root.draggingFromWorkspace = windowData?.workspace.id - window.pressed = true - window.Drag.active = true - window.Drag.source = window - window.Drag.hotSpot.x = mouse.x - window.Drag.hotSpot.y = mouse.y - } - onReleased: { - const targetWorkspace = root.draggingTargetWorkspace - window.pressed = false - window.Drag.active = false - root.draggingFromWorkspace = -1 - if (targetWorkspace !== -1 && targetWorkspace !== windowData?.workspace.id) { - Hyprland.dispatch(`movetoworkspacesilent ${targetWorkspace}, address:${window.windowData?.address}`) - updateWindowPosition.restart() - } - else { - window.x = window.initX - window.y = window.initY - } - } - onClicked: (event) => { - if (!windowData) return; - - if (event.button === Qt.LeftButton) { - GlobalStates.overviewOpen = false - Hyprland.dispatch(`focuswindow address:${windowData.address}`) - event.accepted = true - } else if (event.button === Qt.MiddleButton) { - Hyprland.dispatch(`closewindow address:${windowData.address}`) - event.accepted = true - } - } - - StyledToolTip { - extraVisibleCondition: false - alternativeVisibleCondition: dragArea.containsMouse && !window.Drag.active - text: `${windowData?.title ?? "Unknown"}\n[${windowData?.class ?? "unknown"}] ${windowData?.xwayland ? "[XWayland] " : ""}` - } - } - } - } - - Rectangle { // Focused workspace indicator - id: focusedWorkspaceIndicator - property int activeWorkspaceInGroup: monitor.activeWorkspace?.id - (root.workspaceGroup * root.workspacesShown) - property int activeWorkspaceRowIndex: Math.floor((activeWorkspaceInGroup - 1) / Config.options.overview.columns) - property int activeWorkspaceColIndex: (activeWorkspaceInGroup - 1) % Config.options.overview.columns - x: (root.workspaceImplicitWidth + workspaceSpacing) * activeWorkspaceColIndex - y: (root.workspaceImplicitHeight + workspaceSpacing) * activeWorkspaceRowIndex - z: root.windowZ - width: root.workspaceImplicitWidth - height: root.workspaceImplicitHeight - color: "transparent" - radius: Appearance.rounding.screenRounding * root.scale - border.width: 2 - border.color: root.activeBorderColor - Behavior on x { - animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this) - } - Behavior on y { - animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this) - } - } - } - } -} diff --git a/config/quickshell/overview-unified/modules/overview/OverviewWindow.qml b/config/quickshell/overview-unified/modules/overview/OverviewWindow.qml deleted file mode 100644 index fac3e22e..00000000 --- a/config/quickshell/overview-unified/modules/overview/OverviewWindow.qml +++ /dev/null @@ -1,112 +0,0 @@ -import QtQuick.Effects -import QtQuick -import QtQuick.Layouts -import Quickshell -import Quickshell.Wayland -import "../../common" -import "../../common/functions" -import "../../services" - -Item { // Window - id: root - property var toplevel - property var windowData - property var monitorData - property var scale - property var availableWorkspaceWidth - property var availableWorkspaceHeight - property bool restrictToWorkspace: true - property real initX: Math.max(((windowData?.at[0] ?? 0) - (monitorData?.x ?? 0) - (monitorData?.reserved?.[0] ?? 0)) * root.scale, 0) + xOffset - property real initY: Math.max(((windowData?.at[1] ?? 0) - (monitorData?.y ?? 0) - (monitorData?.reserved?.[1] ?? 0)) * root.scale, 0) + yOffset - property real xOffset: 0 - property real yOffset: 0 - property int widgetMonitorId: 0 - - property var targetWindowWidth: (windowData?.size[0] ?? 100) * scale - property var targetWindowHeight: (windowData?.size[1] ?? 100) * scale - property bool hovered: false - property bool pressed: false - - property var iconToWindowRatio: 0.25 - property var xwaylandIndicatorToIconRatio: 0.35 - property var iconToWindowRatioCompact: 0.45 - property var entry: DesktopEntries.heuristicLookup(windowData?.class) - property var iconPath: Quickshell.iconPath(entry?.icon ?? windowData?.class ?? "application-x-executable", "image-missing") - property bool compactMode: Appearance.font.pixelSize.smaller * 4 > targetWindowHeight || Appearance.font.pixelSize.smaller * 4 > targetWindowWidth - - property bool indicateXWayland: windowData?.xwayland ?? false - - x: initX - y: initY - width: Math.min((windowData?.size[0] ?? 100) * root.scale, availableWorkspaceWidth) - height: Math.min((windowData?.size[1] ?? 100) * root.scale, availableWorkspaceHeight) - opacity: (windowData?.monitor ?? -1) == widgetMonitorId ? 1 : 0.4 - - layer.enabled: true - layer.smooth: true - layer.mipmap: true - - Behavior on x { - animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) - } - Behavior on y { - animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) - } - Behavior on width { - animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) - } - Behavior on height { - animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) - } - - Rectangle { - id: clipContainer - anchors.fill: parent - radius: Appearance.rounding.windowRounding * root.scale - clip: true - color: "transparent" - - ScreencopyView { - id: windowPreview - anchors.fill: parent - captureSource: GlobalStates.overviewOpen ? root.toplevel : null - live: true - - Rectangle { - anchors.fill: parent - radius: Appearance.rounding.windowRounding * root.scale - color: pressed ? ColorUtils.transparentize(Appearance.colors.colLayer2Active, 0.5) : - hovered ? ColorUtils.transparentize(Appearance.colors.colLayer2Hover, 0.7) : - ColorUtils.transparentize(Appearance.colors.colLayer2) - border.color : ColorUtils.transparentize(Appearance.m3colors.m3outline, 0.7) - border.width : 1 - } - - ColumnLayout { - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.right: parent.right - spacing: Appearance.font.pixelSize.smaller * 0.5 - - Image { - id: windowIcon - property var iconSize: { - return Math.min(targetWindowWidth, targetWindowHeight) * (root.compactMode ? root.iconToWindowRatioCompact : root.iconToWindowRatio) / (root.monitorData?.scale ?? 1); - } - Layout.alignment: Qt.AlignHCenter - source: root.iconPath - width: iconSize - height: iconSize - sourceSize: Qt.size(iconSize, iconSize) - - Behavior on width { - animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) - } - Behavior on height { - animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) - } - } - } - } - } -} diff --git a/config/quickshell/overview-unified/modules/overview/qmldir b/config/quickshell/overview-unified/modules/overview/qmldir deleted file mode 100644 index 9b15b45b..00000000 --- a/config/quickshell/overview-unified/modules/overview/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -Overview 1.0 Overview.qml -OverviewWidget 1.0 OverviewWidget.qml -OverviewWindow 1.0 OverviewWindow.qml diff --git a/config/quickshell/overview-unified/services/GlobalStates.qml b/config/quickshell/overview-unified/services/GlobalStates.qml deleted file mode 100644 index 7644e385..00000000 --- a/config/quickshell/overview-unified/services/GlobalStates.qml +++ /dev/null @@ -1,11 +0,0 @@ -pragma Singleton -pragma ComponentBehavior: Bound - -import QtQuick -import Quickshell - -Singleton { - id: root - property bool overviewOpen: false - property bool superReleaseMightTrigger: true -} diff --git a/config/quickshell/overview-unified/services/HyprlandData.qml b/config/quickshell/overview-unified/services/HyprlandData.qml deleted file mode 100644 index e23472d0..00000000 --- a/config/quickshell/overview-unified/services/HyprlandData.qml +++ /dev/null @@ -1,137 +0,0 @@ -pragma Singleton -pragma ComponentBehavior: Bound - -import QtQuick -import Quickshell -import Quickshell.Io -import Quickshell.Hyprland - -/** - * Provides access to some Hyprland data not available in Quickshell.Hyprland. - */ -Singleton { - id: root - property var windowList: [] - property var addresses: [] - property var windowByAddress: ({}) - property var workspaces: [] - property var workspaceIds: [] - property var workspaceById: ({}) - property var activeWorkspace: null - property var monitors: [] - property var layers: ({}) - - function updateWindowList() { - getClients.running = true; - } - - function updateLayers() { - getLayers.running = true; - } - - function updateMonitors() { - getMonitors.running = true; - } - - function updateWorkspaces() { - getWorkspaces.running = true; - getActiveWorkspace.running = true; - } - - function updateAll() { - updateWindowList(); - updateMonitors(); - updateLayers(); - updateWorkspaces(); - } - - function biggestWindowForWorkspace(workspaceId) { - const windowsInThisWorkspace = HyprlandData.windowList.filter(w => w.workspace.id == workspaceId); - return windowsInThisWorkspace.reduce((maxWin, win) => { - const maxArea = (maxWin?.size?.[0] ?? 0) * (maxWin?.size?.[1] ?? 0); - const winArea = (win?.size?.[0] ?? 0) * (win?.size?.[1] ?? 0); - return winArea > maxArea ? win : maxWin; - }, null); - } - - Component.onCompleted: { - updateAll(); - } - - Connections { - target: Hyprland - - function onRawEvent(event) { - updateAll() - } - } - - Process { - id: getClients - command: ["hyprctl", "clients", "-j"] - stdout: StdioCollector { - id: clientsCollector - onStreamFinished: { - root.windowList = JSON.parse(clientsCollector.text) - let tempWinByAddress = {}; - for (var i = 0; i < root.windowList.length; ++i) { - var win = root.windowList[i]; - tempWinByAddress[win.address] = win; - } - root.windowByAddress = tempWinByAddress; - root.addresses = root.windowList.map(win => win.address); - } - } - } - - Process { - id: getMonitors - command: ["hyprctl", "monitors", "-j"] - stdout: StdioCollector { - id: monitorsCollector - onStreamFinished: { - root.monitors = JSON.parse(monitorsCollector.text); - } - } - } - - Process { - id: getLayers - command: ["hyprctl", "layers", "-j"] - stdout: StdioCollector { - id: layersCollector - onStreamFinished: { - root.layers = JSON.parse(layersCollector.text); - } - } - } - - Process { - id: getWorkspaces - command: ["hyprctl", "workspaces", "-j"] - stdout: StdioCollector { - id: workspacesCollector - onStreamFinished: { - root.workspaces = JSON.parse(workspacesCollector.text); - let tempWorkspaceById = {}; - for (var i = 0; i < root.workspaces.length; ++i) { - var ws = root.workspaces[i]; - tempWorkspaceById[ws.id] = ws; - } - root.workspaceById = tempWorkspaceById; - root.workspaceIds = root.workspaces.map(ws => ws.id); - } - } - } - - Process { - id: getActiveWorkspace - command: ["hyprctl", "activeworkspace", "-j"] - stdout: StdioCollector { - id: activeWorkspaceCollector - onStreamFinished: { - root.activeWorkspace = JSON.parse(activeWorkspaceCollector.text); - } - } - } -} diff --git a/config/quickshell/overview-unified/services/qmldir b/config/quickshell/overview-unified/services/qmldir deleted file mode 100644 index b9008641..00000000 --- a/config/quickshell/overview-unified/services/qmldir +++ /dev/null @@ -1,2 +0,0 @@ -singleton HyprlandData 1.0 HyprlandData.qml -singleton GlobalStates 1.0 GlobalStates.qml diff --git a/config/quickshell/overview-unified/shell.qml b/config/quickshell/overview-unified/shell.qml deleted file mode 100644 index e92b4eb7..00000000 --- a/config/quickshell/overview-unified/shell.qml +++ /dev/null @@ -1,16 +0,0 @@ -//@ pragma UseQApplication -//@ pragma Env QT_QUICK_CONTROLS_STYLE=Basic - -import "./modules/overview/" -import "./services/" -import "./common/" -import "./common/functions/" -import "./common/widgets/" - -import QtQuick -import Quickshell -import Quickshell.Hyprland - -ShellRoot { - Overview {} -} diff --git a/config/quickshell/overview-trixie/common/widgets/RectangularShadow.qml b/config/quickshell/overview/common/widgets/RectangularShadow.qml index 2289d4c0..2289d4c0 100644 --- a/config/quickshell/overview-trixie/common/widgets/RectangularShadow.qml +++ b/config/quickshell/overview/common/widgets/RectangularShadow.qml diff --git a/config/quickshell/overview/common/widgets/qmldir b/config/quickshell/overview/common/widgets/qmldir index 0efe1360..c974f193 100644 --- a/config/quickshell/overview/common/widgets/qmldir +++ b/config/quickshell/overview/common/widgets/qmldir @@ -1,4 +1,5 @@ StyledText 1.0 StyledText.qml StyledRectangularShadow 1.0 StyledRectangularShadow.qml +RectangularShadow 1.0 RectangularShadow.qml StyledToolTip 1.0 StyledToolTip.qml StyledToolTipContent 1.0 StyledToolTipContent.qml diff --git a/config/quickshell/qs-hyprview-unified/LICENSE b/config/quickshell/qs-hyprview-unified/LICENSE deleted file mode 100644 index f288702d..00000000 --- a/config/quickshell/qs-hyprview-unified/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<https://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<https://www.gnu.org/licenses/why-not-lgpl.html>. diff --git a/config/quickshell/qs-hyprview-unified/README.md b/config/quickshell/qs-hyprview-unified/README.md deleted file mode 100644 index a1f65aad..00000000 --- a/config/quickshell/qs-hyprview-unified/README.md +++ /dev/null @@ -1,226 +0,0 @@ -# Quickshell Window Switcher - -### The ultimate Hyprland Overview - -A modern, fluid, and highly customizable **Window Switcher (Exposé)** for **Hyprland**, built entirely in QML using the [Quickshell](https://github.com/outfoxxed/quickshell) framework. - -It provides a native Wayland experience similar to macOS Mission Control or GNOME Activities, featuring a suite of advanced mathematical layouts designed to visualize your windows beautifully on any screen size. - -## 📸 Gallery - -See `qs-hyprview` in action with its different layout algorithms. - -| | | | -| :---: | :---: | :---: | -| <br>**Smart Grid** | <br>**Bands** | <br>**Masonry** | -| <br>**Hero** | <br>**Spiral** | <br>**Satellite** | -| <br>**Vortex** | <br>**Staggered** | **What's next?** | - -## ✨ Features - -* **⚡ Native Performance:** Built on Qt6/QML and Wayland Layershell for zero latency and smooth 60fps animations. -* **🧮 10 Layout Algorithms:** A collection of layouts ranging from productive grids to scenic orbital views. -* **🔍 Instant Search:** Filter windows by title, class, or app name immediately upon typing. -* **🎮 Full Navigation:** Supports both Keyboard (Arrows/Tab/Enter) and Mouse (Hover/Click). -* **🎨 Smart Safe Area:** All layouts calculate a 90% "Safe Area" to ensure hover animations never clip against screen edges. -* **⚙️ Live Thumbnails:** Live window contents via Hyprland screencopy. -* **💐 Matugen Integration:** allows you to change the layout color to match your desktop. - -## 🛠️ Dependencies - -* **Hyprland**: The Wayland compositor. -* **Quickshell**: The QML shell framework. -* **Qt6**: Core libraries (usually pulled in by Quickshell). - -## 🚀 Installation - -1. Clone this repository: - ```bash - git clone https://github.com/dom0/qs-hyprview.git - ``` - -2. Ensure `quickshell` is installed and in your PATH. - -## ⚙️ Configuration & Usage - -### Launching -To start the daemon (add this to your `hyprland.conf` with `exec-once`): - -```bash -quickshell -p /path/to/cloned/repo - -# Or clone into $XDG_CONFIG_HOME/quickshell (usually ~/.config/quickshell) and run with -c flag: -quickshell -c qs-hyprview -``` - -### Toggle (Open/Close) -The project exposes an IPC handler named `expose`. You can bind a key in Hyprland to toggle the view. - -**In `hyprland.conf`:** -```ini -# "smartgrid", "justified", "masonry", "bands", "hero", "spiral" -# "satellite", "staggered", "columnar", "vortex", "random" -$layout = 'masonry' - -# Toggle overview visibility -bind = $mainMod, TAB, exec, quickshell ipc -p /path/to/cloned/repo call expose toggle $layout - -# Open overview -bind = $mainMod, TAB, exec, quickshell ipc -p /path/to/cloned/repo call expose open $layout - -# Close overview -bind = $mainMod, TAB, exec, quickshell ipc -p /path/to/cloned/repo call expose close - - -# Or, using XDG_CONFIG_HOME: -#bind = $mainMod, TAB, exec, quickshell ipc -c qs-hyprview call expose toggle $layout -#bind = $mainMod, TAB, exec, quickshell ipc -c qs-hyprview call expose open $layout -#bind = $mainMod, TAB, exec, quickshell ipc -c qs-hyprview call expose close -``` -### Visual optimizations - -You can optimize your experience by adding an opaque/blurred background (dimming area) or pop-in animations using native Hyprland features. - -**In `hyprland.conf`:** -```ini -# dimming area -decoration { - dim_around = 0.8 -} - -layerrule = dimaround, quickshell:expose -``` - -```ini -# blur area -decoration { - blur { - enabled = true - size = 3 - passes = 1 - } -} - -layerrule = blur, quickshell:expose -``` - -```ini -# popin animation -animations { - enabled = yes - animation = layersIn, 1, 1.5, default, popin -} -``` - -### Customization -You can modify the core properties at the top of `shell.qml`: - -```qml -// Set to true for live window updates (monitor refresh rate, higher CPU usage), false for static snapshots (~8fps) -property bool liveCapture: false - -// Automatically move mouse cursor to the center of selected window -property bool moveCursorToActiveWindow: true -``` - -## 🎨 Matugen Dynamic Colorscheme From Wallpaper - -### Manual Configuration - -If you don't want to use Matugen, you can simply edit common/Appearance.qml and change the hexadecimal values to match your color of choice (mainly m3Primary and m3OnPrimary). - -### Dynamic Colors (Matugen) - -1. Copy the template (qs-hyprspace-template.qml) from this repo to matugen's templates folder - -2. Add the following to your ~/.config/matugen/config.toml: -``` -[templates.qs-hyprview] -input_path = "~/.config/matugen/templates/qs-hyprview-template.qml" -output_path = "~/.config/quickshell/qs-hyprview/common/Appearance.qml" -``` - -3. Generate your colorscheme: - -``` -matugen image /path/to/your/wallpaper -``` - -## 📐 Layout Algorithms - -This project includes a sophisticated `LayoutsManager` offering **10 distinct algorithms**: - -### 1. Smart Grid (`smartgrid`) -The default layout. It uses an **Iterative Best-Fit** algorithm. It simulates every possible row/column combination to find the exact grid configuration that results in the largest possible thumbnails without overflowing the screen. - -### 2. Justified (`justified`) -A **Justified Layout** (similar to Google Images). It places windows in rows, maintaining fixed height and original aspect ratios, and scales the row to fit the screen width perfectly. - -### 3. Masonry (`masonry`) -A **Waterfall** layout (Pinterest-style). It optimizes vertical space by placing windows in dynamic columns. It automatically calculates the optimal number of columns based on the window count. - -### 4. Bands (`bands`) -Organizes windows by **Workspace**. Creates a horizontal "Band" for each active workspace, grouping relevant tasks together. Windows are justified within their workspace band. - -### 5. Hero (`hero`) -A focus-centric layout. -* **Hero Area:** The active window takes up 40% of the screen (left side). -* **Stack:** All other windows share the remaining 60% (right side) in a smart grid or column. - -### 6. Spiral (`spiral`) -A scenic layout based on the **Golden Ratio (BSP)**. -* Windows split the screen in a spiral pattern (Left half, Top-Right half, etc.). -* The first window is separated by a larger gap to emphasize focus. -* If many windows are open, the spiral stops after 3 cuts and arranges the rest in a grid. - -### 7. Satellite (`satellite`) -An **Orbital** layout. -* The active window sits in the center of the screen. -* All other windows orbit around it in an ellipse. -* Visually stunning and great for focusing on one task while keeping an eye on the surroundings. - -### 8. Staggered (`staggered`) -A **Honeycomb/Brick** layout. -* Similar to a grid, but every odd row is shifted horizontally by half a cell width. -* Creates a more organic, less rigid look compared to standard grids. - -### 9. Columnar (`columnar`) -Divides the screen into vertical strips. -* Ignores rows completely and gives every window maximum vertical space. -* Excellent for **Ultrawide** monitors (21:9 / 32:9). - -### 10. Vortex (`vortex`) -A depth-based Phyllotaxis layout (Sunflower pattern), designed for a scenographic and immersive experience. -* Center Focus: The active window sits in the absolute center at maximum scale. -* Depth Effect: Subsequent windows spiral outwards, gradually decreasing in size and z-index. This creates a 3D "tunnel" effect where older windows fade into the background. - -### 🎲 Random (`random`) -Feeling adventurous? This mode selects one of the above algorithms at random every time you open the dashboard. - -## ⌨️ Controls - -| Input | Action | -| :--- | :--- | -| **Typing** | Instantly filters windows by Title, Class, or App ID | -| **Arrows (↑ ↓ ← →)** | Spatial navigation between thumbnails | -| Ctrl + (H/J/K/L) | Vim-style spatial navigation | -| **Tab / Shift+Tab** | Sequential navigation | -| **Enter** | Activate selected window | -| **Middle Click** | Close hovered window | -| **Esc / Click BG** | Close dashboard | - -## 🤝 Contributing - -Pull Requests are welcome! If you want to add a new layout algorithm or improve performance, please open an issue or submit a PR. - -## 📄 License - -Distributed under the GNU General Public License v3.0. See `LICENSE` for more information. - ---- - -<div align="center"> - -Made with ❤️ for the Hyprland community - -</div> diff --git a/config/quickshell/qs-hyprview-unified/common/Appearance.qml b/config/quickshell/qs-hyprview-unified/common/Appearance.qml deleted file mode 100644 index 956b8d3d..00000000 --- a/config/quickshell/qs-hyprview-unified/common/Appearance.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick - -QtObject { - id: m3 - - property color m3Primary: "#b3c5ff" - property color m3OnPrimary: "#192e60" - - property color m3PrimaryContainer: "#324578" - property color m3OnPrimaryContainer: "#dbe1ff" - - property color m3Secondary: "#c1c6dd" - property color m3OnSecondary: "#2a3042" - - property color m3SecondaryContainer: "#414659" - property color m3OnSecondaryContainer: "#dde1f9" -} - diff --git a/config/quickshell/qs-hyprview-unified/layouts/BandsLayout.qml b/config/quickshell/qs-hyprview-unified/layouts/BandsLayout.qml deleted file mode 100644 index 386ef92e..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/BandsLayout.qml +++ /dev/null @@ -1,174 +0,0 @@ -pragma Singleton -import Quickshell - -Singleton { - id: root - - function doLayout(windowList, outerWidth, outerHeight) { - var N = windowList.length - if (N === 0) return [] - - // Gap: 0.8% of screen, clamped between 12px and 24px - var rawGap = Math.min(outerWidth * 0.08, outerHeight * 0.08) - var gap = Math.max(12, Math.min(24, rawGap)) - - // Safe Area: 90% of the screen - var contentScale = 0.90 - var useW = outerWidth * contentScale - var useH = outerHeight * contentScale - - // Global offsets to center everything - var offX = (outerWidth - useW) / 2 - var offY = (outerHeight - useH) / 2 - - // Group by workspace - var groups = {} - var wsOrder = [] - - for (var i = 0; i < N; i++) { - var w = windowList[i] - var wsId = w.workspaceId - - if (!groups[wsId]) { - groups[wsId] = [] - wsOrder.push(wsId) - } - groups[wsId].push(w) - } - - var bandCount = wsOrder.length - if (bandCount === 0) return [] - - // Band height & max thumb height - - // Calculate the height allocated for each workspace band - var totalGapH = gap * (bandCount - 1) - var bandHeight = (useH - totalGapH) / bandCount - - // Aesthetic Cap: Even if we have only 1 workspace, - // windows shouldn't exceed 45% of screen height. - var absoluteMaxH = useH * 0.45 - - // The effective max height is the smaller of the two. - // If we have 10 bands, bandHeight will be small (e.g. 100px), so that rules. - // If we have 1 band, bandHeight is huge (1000px), so absoluteMaxH (450px) rules. - var localMaxH = Math.min(bandHeight, absoluteMaxH) - - // Minimum safety height to avoid division by zero errors - if (localMaxH < 10) localMaxH = 10 - - var result = [] - var currentY = offY - - // Process each band - for (var b = 0; b < bandCount; b++) { - var wsId = wsOrder[b] - var items = groups[wsId] - var itemCount = items.length - - // ROW LAYOUT CALCULATION (Justified) - var rows = [] - var currentRow = [] - var currentAspectSum = 0 - - for (var k = 0; k < itemCount; k++) { - var item = items[k] - var w0 = (item.width > 0) ? item.width : 100 - var h0 = (item.height > 0) ? item.height : 100 - var aspect = w0 / h0 - - var wrapper = { win: item.win, aspect: aspect } - - // Check overflow: (SumAspects * MaxH) + Gaps > Width - var hypotheticalWidth = (currentAspectSum + aspect) * localMaxH + (currentRow.length * gap) - - if (currentRow.length > 0 && hypotheticalWidth > useW) { - rows.push({ items: currentRow, aspectSum: currentAspectSum }) - currentRow = [] - currentAspectSum = 0 - } - - currentRow.push(wrapper) - currentAspectSum += aspect - } - if (currentRow.length > 0) { - rows.push({ items: currentRow, aspectSum: currentAspectSum }) - } - - // SCALE & FIT ROWS - // Calculate how tall the content actually is - var totalContentH = 0 - var finalRows = [] - - for (var r = 0; r < rows.length; r++) { - var rowObj = rows[r] - var rItems = rowObj.items - - // Optimal Height = (Available Width / Sum Aspects) - var availRowW = useW - (gap * (rItems.length - 1)) - var optimalH = availRowW / rowObj.aspectSum - - // Clamp to limits - if (optimalH > localMaxH) optimalH = localMaxH - - finalRows.push({ items: rItems, h: optimalH }) - totalContentH += optimalH - } - - // Add vertical gaps between rows inside the band - if (finalRows.length > 1) { - totalContentH += gap * (finalRows.length - 1) - } - - // If rows overflow the band height (rare, but possible with many windows), scale down - var scaleFactor = 1.0 - if (totalContentH > bandHeight) { - scaleFactor = bandHeight / totalContentH - totalContentH = bandHeight // Cap for centering math - } - - // GENERATE COORDINATES - // Center the content vertically within the band slot - // Note: If bandCount=1, bandHeight is huge (90% screen), but totalContentH is constrained by absoluteMaxH. - // This ensures the single row floats nicely in the middle. - var rowY = currentY + (bandHeight - totalContentH) / 2 - - for (var r2 = 0; r2 < finalRows.length; r2++) { - var fRow = finalRows[r2] - var rHeight = fRow.h * scaleFactor - var rItems2 = fRow.items - - // Calculate row width for horizontal centering - var actualRowW = 0 - for (var j = 0; j < rItems2.length; j++) { - actualRowW += (rItems2[j].aspect * rHeight) - } - actualRowW += gap * (rItems2.length - 1) - - var rowX = offX + (useW - actualRowW) / 2 - - for (var j2 = 0; j2 < rItems2.length; j2++) { - var it = rItems2[j2] - var finalW = it.aspect * rHeight - - result.push({ - win: it.win, - x: rowX, - y: rowY, - width: finalW, - height: rHeight - }) - - rowX += finalW + gap - } - - rowY += rHeight + (gap * scaleFactor) - } - - // Advance Y to the next band slot - currentY += bandHeight + gap - } - - return result - } -} diff --git a/config/quickshell/qs-hyprview-unified/layouts/ColumnarLayout.qml b/config/quickshell/qs-hyprview-unified/layouts/ColumnarLayout.qml deleted file mode 100644 index feaa9afa..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/ColumnarLayout.qml +++ /dev/null @@ -1,72 +0,0 @@ -pragma Singleton -import Quickshell - -Singleton { - id: root - - function doLayout(windowList, outerWidth, outerHeight) { - var N = windowList.length - if (N === 0) return [] - - var gap = Math.max(8, outerWidth * 0.005) - - // Safe Area: We use slightly more width here (95%) - // as vertical strips look better when filling the screen horizontally. - var useW = outerWidth * 0.95 - var useH = outerHeight * 0.90 - var offX = (outerWidth - useW) / 2 - var offY = (outerHeight - useH) / 2 - - // Calculate width of a single column - var colW = (useW - (gap * (N - 1))) / N - - // Safety: If columns become too narrow (e.g. < 200px), - // we clamp the width to keep them readable. - var minColW = 200 - if (colW < minColW) colW = minColW - - // Calculate the actual total width used - var totalW = N * colW + (N - 1) * gap - - // Center the group horizontally. - // If N is small, it centers. If N is large (clamped), it starts from left. - var startX = offX - if (totalW < useW) { - startX = offX + (useW - totalW) / 2 - } - - var result = [] - - for (var i = 0; i < N; i++) { - var item = windowList[i] - - var w0 = (item.width > 0) ? item.width : 100 - var h0 = (item.height > 0) ? item.height : 100 - - // In this layout, vertical space is abundant (useH). - // The constraining factor is usually the column width. - var sc = Math.min(colW / w0, useH / h0) - - var thumbW = w0 * sc - var thumbH = h0 * sc - - var xPos = startX + i * (colW + gap) - - // Center horizontally within the strip - var xCentered = xPos + (colW - thumbW) / 2 - - // Center vertically on screen - var yCentered = offY + (useH - thumbH) / 2 - - result.push({ - win: item.win, - x: xCentered, - y: yCentered, - width: thumbW, - height: thumbH - }) - } - - return result - } -} diff --git a/config/quickshell/qs-hyprview-unified/layouts/HeroLayout.qml b/config/quickshell/qs-hyprview-unified/layouts/HeroLayout.qml deleted file mode 100644 index e45ecf2c..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/HeroLayout.qml +++ /dev/null @@ -1,144 +0,0 @@ -pragma Singleton -import Quickshell -import Quickshell.Hyprland - -Singleton { - id: root - - function doLayout(windowList, outerWidth, outerHeight) { - if (windowList.length === 0) return [] - - // Gap: 0.8% of screen, clamped between 12px and 32px - var rawGap = Math.min(outerWidth * 0.08, outerHeight * 0.08) - var gap = Math.max(12, Math.min(32, rawGap)) - - // Move active window to the head of windowList - var activeAddr = Hyprland.activeToplevel?.lastIpcObject?.address - if (activeAddr) { - var activeIdx = windowList.findIndex(it => it.lastIpcObject.address === activeAddr) - if (activeIdx !== -1) { - windowList = [windowList[activeIdx], ...windowList.filter(it => it !== windowList[activeIdx])] - } - } - - // Safe area definition (90%) - var contentScale = 0.90 - var useW = outerWidth * contentScale - var useH = outerHeight * contentScale - - // Global offset - center Safe area - var offX = (outerWidth - useW) / 2 - var offY = (outerHeight - useH) / 2 - - var result = [] - - // Screen zones (Hero/Stack) - var heroRatio = 0.40 // 40% Hero - var heroAreaW = useW * heroRatio - var stackAreaW = useW - heroAreaW - gap // 60% Stack - - var heroItem = windowList[0] - - // Aspect Fit - var hScale = Math.min(heroAreaW / heroItem.width, useH / heroItem.height) - var hW = heroItem.width * hScale - var hH = heroItem.height * hScale - - result.push({ - win: heroItem.win, - x: offX + (heroAreaW - hW) / 2, - y: offY + (useH - hH) / 2, - width: hW, - height: hH, - isHero: true - }) - - var others = windowList.slice(1) - var N = others.length - - if (N > 0) { - var stackStartX = offX + heroAreaW + gap - - // Evaluate col number - var bestCols = 1 - var bestRows = N - - // Windows height on a single column - var oneColH = (useH - (gap * (N - 1))) / N - - // TOLERANCE THRESHOLD (0.15 = 15% of screen height) - // If the windows are at least 15% of the screen height, we stay on 1 column. - // With 4 windows we are at ~25% -> OK (1 Column) - // With 7 windows we are at ~14% -> NO (Go to grid calculation) - var useSingleCol = oneColH > (useH * 0.15) - - if (!useSingleCol) { - // If space is limited, we look for the optimal grid starting with 2 columns. - var bestScale = 0 - var TARGET_ASPECT = 16.0 / 9.0 - - for (var cols = 2; cols <= N; cols++) { - var rows = Math.ceil(N / cols) - var availW = stackAreaW - (gap * (cols - 1)) - var availH = useH - (gap * (rows - 1)) - - if (availW <= 0 || availH <= 0) continue - - var cellW = availW / cols - var cellH = availH / rows - - // Size score - var sW = cellW / TARGET_ASPECT - var sH = cellH / 1.0 - var currentScale = Math.min(sW, sH) - - if (currentScale > bestScale) { - bestScale = currentScale - bestCols = cols - bestRows = rows - } - } - } - - // Evaluation of the final dimensions of the selected grid - var finalAvailW = stackAreaW - (gap * (bestCols - 1)) - var finalAvailH = useH - (gap * (bestRows - 1)) - - var finalCellW = finalAvailW / bestCols - var finalCellH = finalAvailH / bestRows - - // Vertical centering of the total stack - var totalGridH = bestRows * finalCellH + (bestRows - 1) * gap - var stackStartY = offY + (useH - totalGridH) / 2 - - // Items positioning - for (var i = 0; i < N; ++i) { - var item = others[i] - - var row = Math.floor(i / bestCols) - var col = i % bestCols - - // Cell coords (Standard Grid Alignment) - // No “rowOffsetX”, cell 0 always starts on the left - var cellAbsX = stackStartX + col * (finalCellW + gap) - var cellAbsY = stackStartY + row * (finalCellH + gap) - - // Thumb aspect Fit - var sc = Math.min(finalCellW / item.width, finalCellH / item.height) - var w = item.width * sc - var h = item.height * sc - - result.push({ - win: item.win, - x: cellAbsX + (finalCellW - w) / 2, - y: cellAbsY + (finalCellH - h) / 2, - width: w, - height: h, - isHero: false - }) - } - } - - return result - } -} diff --git a/config/quickshell/qs-hyprview-unified/layouts/JustifiedLayout.qml b/config/quickshell/qs-hyprview-unified/layouts/JustifiedLayout.qml deleted file mode 100644 index 655147b5..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/JustifiedLayout.qml +++ /dev/null @@ -1,149 +0,0 @@ -pragma Singleton -import Quickshell - -Singleton { - id: root - - function doLayout(windowList, outerWidth, outerHeight) { - var N = windowList.length - if (N === 0) - return [] - - var containerWidth = outerWidth * 0.9 - var containerHeight = outerHeight * 0.9 - - // Gap: 0.8% of screen, clamped between 12px and 32px - var rawGap = Math.min(outerWidth * 0.08, outerHeight * 0.08) - var gap = Math.max(12, Math.min(32, rawGap)) - - var maxThumbHeight = outerHeight * 0.3 - - if (containerWidth <= 0 || containerHeight <= 0) { - return windowList.map(function(item) { - return { - win: item.win, - x: 0, - y: 0, - width: 0, - height: 0 - } - }) - } - - var targetRowH = maxThumbHeight - var rows = [] - var currentRow = [] - var sumAspect = 0 - - function flushRow() { - if (currentRow.length === 0) - return - - var n = currentRow.length - var rowHeight = maxThumbHeight - if (sumAspect > 0) { - var totalGapWidth = gap * (n - 1) - var hFit = (containerWidth - totalGapWidth) / sumAspect - if (hFit < rowHeight) - rowHeight = hFit - } - - if (rowHeight > maxThumbHeight) - rowHeight = maxThumbHeight - if (rowHeight <= 0) - rowHeight = 1 - - rows.push({ - items: currentRow.slice(), - height: rowHeight, - sumAspect: sumAspect - }) - - currentRow = [] - sumAspect = 0 - } - - for (var i = 0; i < N; ++i) { - var item = windowList[i] - var w0 = item.width > 0 ? item.width : 1 - var h0 = item.height > 0 ? item.height : 1 - var a = w0 / h0 - item.aspect = a - - if (currentRow.length > 0 && - ((sumAspect + a) * targetRowH + gap * currentRow.length) > containerWidth) { - flushRow() - } - - currentRow.push(item) - sumAspect += a - } - - if (currentRow.length > 0) { - flushRow() - } - - var totalRawHeight = 0 - for (var r = 0; r < rows.length; ++r) { - totalRawHeight += rows[r].height - } - if (rows.length > 1) { - totalRawHeight += gap * (rows.length - 1) - } - - var sV = 1.0 - var availH = containerHeight - if (totalRawHeight > 0 && totalRawHeight > availH) { - sV = availH / totalRawHeight - } - if (sV <= 0) - sV = 0.1 - if (sV > 1.0) - sV = 1.0 - - var gridTotalHeightScaled = totalRawHeight * sV - var yAcc = (outerHeight - gridTotalHeightScaled) / 2 - if (!isFinite(yAcc) || yAcc < 0) - yAcc = 0 - - var result = [] - - for (var r2 = 0; r2 < rows.length; ++r2) { - var row = rows[r2] - var rowHeightScaled = row.height * sV - - var rowWidthNoGapsScaled = 0 - for (var j = 0; j < row.items.length; ++j) { - rowWidthNoGapsScaled += row.items[j].aspect * rowHeightScaled - } - var totalRowWidthScaled = rowWidthNoGapsScaled + gap * (row.items.length - 1) - - var xAcc = (outerWidth - totalRowWidthScaled) / 2 - if (!isFinite(xAcc)) - xAcc = 0 - - for (var j2 = 0; j2 < row.items.length; ++j2) { - var it2 = row.items[j2] - var wScaled = it2.aspect * rowHeightScaled - var hScaled = rowHeightScaled - - result.push({ - win: it2.win, - x: xAcc, - y: yAcc, - width: wScaled, - height: hScaled - }) - - xAcc += wScaled + gap - } - - yAcc += rowHeightScaled - if (r2 < rows.length - 1) { - yAcc += gap * sV - } - } - - return result - } -} diff --git a/config/quickshell/qs-hyprview-unified/layouts/LayoutsManager.qml b/config/quickshell/qs-hyprview-unified/layouts/LayoutsManager.qml deleted file mode 100644 index 8db0672d..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/LayoutsManager.qml +++ /dev/null @@ -1,47 +0,0 @@ -pragma Singleton -import Quickshell -import "." - -Singleton { - id: root - - function doLayout( layoutAlgorithm, windowList, width, height) { - var doLayout = null - switch (layoutAlgorithm) { - case 'smartgrid': - doLayout = SmartGridLayout.doLayout - break - case 'justified': - doLayout = JustifiedLayout.doLayout - break - case 'bands': - doLayout = BandsLayout.doLayout - break - case 'masonry': - doLayout = MasonryLayout.doLayout - break - case 'hero': - doLayout = HeroLayout.doLayout - break - case 'spiral': - doLayout = SpiralLayout.doLayout - break - case 'satellite': - doLayout = SatelliteLayout.doLayout - break - case 'staggered': - doLayout = StarggeredLayout.doLayout - break - case 'columnar': - doLayout = ColumnarLayout.doLayout - break - case 'vortex': - doLayout = VortexLayout.doLayout - break - default: - doLayout = SmartGridLayout.doLayout - } - - return doLayout( windowList, width, height) - } -} diff --git a/config/quickshell/qs-hyprview-unified/layouts/MasonryLayout.qml b/config/quickshell/qs-hyprview-unified/layouts/MasonryLayout.qml deleted file mode 100644 index 73192f17..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/MasonryLayout.qml +++ /dev/null @@ -1,139 +0,0 @@ -pragma Singleton -import Quickshell - -Singleton { - id: root - - function doLayout(windowList, outerWidth, outerHeight) { - var N = windowList.length - if (N === 0) return [] - - // Gap: 0.8% of screen, clamped between 12px and 32px - var rawGap = Math.min(outerWidth * 0.08, outerHeight * 0.08) - var gap = Math.max(12, Math.min(32, rawGap)) - - // Safe Area (90%) - // Define the bounding box for the content. - var contentScale = 0.90 - var useW = outerWidth * contentScale - var useH = outerHeight * contentScale - - // Find Best Column Count - // Standard logic: try to fit content in 1 col, then 2, etc. - var bestCols = N - - for (var cols = 1; cols <= N; cols++) { - var tryColWidth = (useW - (cols - 1) * gap) / cols - var tryColHeights = new Array(cols).fill(0) - - for (var i = 0; i < N; i++) { - var item = windowList[i] - var minH = Math.min.apply(null, tryColHeights) - var colIdx = tryColHeights.indexOf(minH) - - var w0 = (item.width && item.width > 0) ? item.width : 100 - var h0 = (item.height && item.height > 0) ? item.height : 100 - var scale = tryColWidth / w0 - - tryColHeights[colIdx] += (h0 * scale) + gap - } - - var currentMaxH = Math.max.apply(null, tryColHeights) - if (currentMaxH > 0) currentMaxH -= gap - - // If it fits vertically, we stop. - if (currentMaxH <= useH) { - bestCols = cols - break - } - } - - // Rigorous clamping - // We have chosen 'bestCols'. Now we calculate the theoretical column width. - // BUT, if N is small (e.g. 1), this width might produce a height > useH. - // We must calculate a "Global Downscale Factor" to ensure NO item exceeds useH. - - var rawColWidth = (useW - (bestCols - 1) * gap) / bestCols - var maxOverflowRatio = 1.0 // 1.0 means "fits perfectly" - - // Simulate again to find the worst offender (tallest item/column relative to screen) - // Note: In masonry, we care about the total column height, not just single item. - var clampHeights = new Array(bestCols).fill(0) - - for (var j = 0; j < N; j++) { - var it = windowList[j] - - // Standard masonry placement logic - var mH = Math.min.apply(null, clampHeights) - var cId = clampHeights.indexOf(mH) - - var wRaw = (it.width && it.width > 0) ? it.width : 100 - var hRaw = (it.height && it.height > 0) ? it.height : 100 - var sc = rawColWidth / wRaw - - clampHeights[cId] += (hRaw * sc) + gap - } - - // Find the tallest column produced by the raw width - var tallestCol = Math.max.apply(null, clampHeights) - if (tallestCol > 0) tallestCol -= gap - - // If the tallest column is taller than Safe Area, calculate reduction factor - if (tallestCol > useH) { - maxOverflowRatio = useH / tallestCol - } - - // Apply the reduction factor to the column width. - var finalColWidth = rawColWidth * maxOverflowRatio - - // Re-centering x - var finalGridW = (finalColWidth * bestCols) + (gap * (bestCols - 1)) - var finalOffX = (outerWidth - finalGridW) / 2 - - - // Final rendering - var colHeights = new Array(bestCols).fill(0) - var result = [] - - for (var k = 0; k < N; k++) { - var itemK = windowList[k] - - // 1. Find shortest column - var minH = Math.min.apply(null, colHeights) - var cIdx = colHeights.indexOf(minH) - - // 2. Dimensions - var wOrig = (itemK.width && itemK.width > 0) ? itemK.width : 100 - var hOrig = (itemK.height && itemK.height > 0) ? itemK.height : 100 - var s = finalColWidth / wOrig - var tH = hOrig * s - - // 3. Position (using Recalculated OffX) - var xPos = finalOffX + cIdx * (finalColWidth + gap) - var yPos = colHeights[cIdx] - - result.push({ - win: itemK.win, - x: xPos, - y: yPos, - width: finalColWidth, - height: tH, - colIndex: cIdx - }) - - colHeights[cIdx] += tH + gap - } - - // Vertical centering - var realGridH = Math.max.apply(null, colHeights) - if (realGridH > 0) realGridH -= gap - - var finalOffY = (outerHeight - realGridH) / 2 - - for (var m = 0; m < result.length; m++) { - result[m].y += finalOffY - } - - return result - } -} diff --git a/config/quickshell/qs-hyprview-unified/layouts/SatelliteLayout.qml b/config/quickshell/qs-hyprview-unified/layouts/SatelliteLayout.qml deleted file mode 100644 index 2efb703b..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/SatelliteLayout.qml +++ /dev/null @@ -1,98 +0,0 @@ -pragma Singleton -import Quickshell -import Quickshell.Hyprland - -Singleton { - id: root - - function doLayout(windowList, outerWidth, outerHeight) { - var N = windowList.length - if (N === 0) return [] - - // Move active window to the start of the list (Center Item) - var activeAddr = Hyprland.activeToplevel?.lastIpcObject?.address - if (activeAddr) { - var activeIdx = windowList.findIndex(it => it.lastIpcObject.address === activeAddr) - if (activeIdx !== -1) { - windowList = [windowList[activeIdx], ...windowList.filter(it => it !== windowList[activeIdx])] - } - } - - // Safe Area definition (90%) - var useW = outerWidth * 0.90 - var useH = outerHeight * 0.90 - var offX = (outerWidth - useW) / 2 - var offY = (outerHeight - useH) / 2 - - var result = [] - - // Center item (hero) - var centerItem = windowList[0] - - // The center item takes up roughly 35% of the screen dimensions - var centerW = useW * 0.35 - var centerH = useH * 0.35 - - // Aspect Fit for the center item - var w0 = (centerItem.width > 0) ? centerItem.width : 100 - var h0 = (centerItem.height > 0) ? centerItem.height : 100 - var sc0 = Math.min(centerW / w0, centerH / h0) - var finalCenterW = w0 * sc0 - var finalCenterH = h0 * sc0 - - result.push({ - win: centerItem.win, - x: offX + (useW - finalCenterW) / 2, - y: offY + (useH - finalCenterH) / 2, - width: finalCenterW, - height: finalCenterH, - isSatellite: false - }) - - // Orbit items (satellites) - var satellites = windowList.slice(1) - var numSat = satellites.length - - if (numSat > 0) { - // Orbit Radius (distance from center) - var radiusX = useW * 0.4 - var radiusY = useH * 0.4 - - // Max size for satellites. - // As the number of satellites increases, we shrink them to avoid overlap. - var maxSatW = (useW * 0.25) / Math.max(1, (numSat / 6)) - var maxSatH = (useH * 0.25) / Math.max(1, (numSat / 6)) - - // Start angle (-90 degrees = Top) - var startAngle = -Math.PI / 2 - var stepAngle = (2 * Math.PI) / numSat - - for (var i = 0; i < numSat; i++) { - var item = satellites[i] - var angle = startAngle + (i * stepAngle) - - // Calculate satellite center coordinates - var cx = (useW / 2) + radiusX * Math.cos(angle) - var cy = (useH / 2) + radiusY * Math.sin(angle) - - // Aspect Fit satellite - var ws = (item.width > 0) ? item.width : 100 - var hs = (item.height > 0) ? item.height : 100 - var scS = Math.min(maxSatW / ws, maxSatH / hs) - var finalSatW = ws * scS - var finalSatH = hs * scS - - result.push({ - win: item.win, - x: offX + cx - (finalSatW / 2), - y: offY + cy - (finalSatH / 2), - width: finalSatW, - height: finalSatH, - isSatellite: true - }) - } - } - - return result - } -} diff --git a/config/quickshell/qs-hyprview-unified/layouts/SmartGridLayout.qml b/config/quickshell/qs-hyprview-unified/layouts/SmartGridLayout.qml deleted file mode 100644 index 6207d19c..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/SmartGridLayout.qml +++ /dev/null @@ -1,134 +0,0 @@ -pragma Singleton -import Quickshell - -Singleton { - id: root - - function doLayout(windowList, outerWidth, outerHeight) { - var N = windowList.length - if (N === 0) return [] - if (outerWidth <= 0 || outerHeight <= 0) return [] - - var gap = Math.min(outerWidth * 0.03, outerHeight * 0.03) - - // --- 0. DEFINIZIONE AREA SICURA (SCALATA) --- - // Riduciamo l'area di calcolo al 90% per lasciare spazio alle animazioni hover - var contentScale = 0.9 - var usableW = outerWidth * contentScale - var usableH = outerHeight * contentScale - - // --- 1. TROVARE LA SCALA OTTIMALE --- - // Usiamo usableW/H per decidere la dimensione delle finestre - var TARGET_ASPECT = 16.0 / 9.0 - var bestCols = 1 - var bestRows = 1 - var bestScale = 0 - - for (var cols = 1; cols <= N; cols++) { - var rows = Math.ceil(N / cols) - - // Calcoliamo lo spazio basandoci sull'area ridotta - var availW = usableW - gap * (cols - 1) - var availH = usableH - gap * (rows - 1) - - if (availW <= 0 || availH <= 0) continue - - var cellW = availW / cols - var cellH = availH / rows - - var scaleW = cellW / TARGET_ASPECT - var scaleH = cellH / 1.0 - var currentScale = Math.min(scaleW, scaleH) - - if (currentScale > bestScale) { - bestScale = currentScale - bestCols = cols - bestRows = rows - } - } - - // --- 2. CALCOLO DIMENSIONI REALI --- - - // Ricalcoliamo i limiti cella basati sull'area ridotta - var finalAvailW = usableW - gap * (bestCols - 1) - var finalAvailH = usableH - gap * (bestRows - 1) - var maxCellW = finalAvailW / bestCols - var maxCellH = finalAvailH / bestRows - - // --- 3. POSIZIONAMENTO (CENTRATO NELL'AREA TOTALE) --- - - // Calcoliamo l'altezza totale del blocco di contenuto - var totalGridContentH = bestRows * maxCellH + (bestRows - 1) * gap - - // Per centrare verticalmente, usiamo l'outerHeight REALE (al 100%) - // In questo modo il blocco ridotto (90%) finisce esattamente al centro dello schermo fisico - var startOffsetY = (outerHeight - totalGridContentH) / 2 - - var result = [] - - // Iteriamo per RIGA - for (var r = 0; r < bestRows; r++) { - var rowItems = [] - var startIndex = r * bestCols - var endIndex = Math.min(startIndex + bestCols, N) - - if (startIndex >= N) break - - var totalRowContentWidth = 0 - - // Fase 3a: Calcolo dimensioni miniature (Packed) - for (var i = startIndex; i < endIndex; i++) { - var item = windowList[i] - var w0 = (item.width && item.width > 0) ? item.width : 100 - var h0 = (item.height && item.height > 0) ? item.height : 100 - - // Scala calcolata sui limiti "sicuri" (90%) - var scale = Math.min(maxCellW / w0, maxCellH / h0) - - var thumbW = w0 * scale - var thumbH = h0 * scale - - rowItems.push({ - originalItem: item, - width: thumbW, - height: thumbH, - index: i, - col: i - startIndex - }) - - totalRowContentWidth += thumbW - } - - // Aggiungiamo i gap totali della riga - if (rowItems.length > 1) { - totalRowContentWidth += (rowItems.length - 1) * gap - } - - // Fase 3b: Posizionamento X - // Anche qui, usiamo outerWidth REALE per centrare il blocco riga nello schermo intero - var currentX = (outerWidth - totalRowContentWidth) / 2 - var cellAbsY = startOffsetY + r * (maxCellH + gap) - - for (var k = 0; k < rowItems.length; k++) { - var rItem = rowItems[k] - - // Centratura verticale nella fascia - var currentY = cellAbsY + (maxCellH - rItem.height) / 2 - - result.push({ - win: rItem.originalItem.win, - x: currentX, - y: currentY, - width: rItem.width, - height: rItem.height, - rowIndex: r, - colIndex: rItem.col - }) - - currentX += rItem.width + gap - } - } - - return result - } -} diff --git a/config/quickshell/qs-hyprview-unified/layouts/SpiralLayout.qml b/config/quickshell/qs-hyprview-unified/layouts/SpiralLayout.qml deleted file mode 100644 index bcfc7abb..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/SpiralLayout.qml +++ /dev/null @@ -1,155 +0,0 @@ -pragma Singleton -import Quickshell -import Quickshell.Hyprland - -Singleton { - id: root - - function doLayout(windowList, outerWidth, outerHeight, maxSplits) { - var N = windowList.length - if (N === 0) return [] - - if (maxSplits === undefined) maxSplits = 3 - - // Standard Gap: 0.8% of screen - var rawGap = outerWidth * 0.008 - var gap = Math.max(8, Math.min(24, rawGap)) - - // Primary Gap: The space between the first Big Window and the rest. - // We make it 3x larger than the standard gap for emphasis. - var primaryGap = gap * 3 - - // Safe Area (90%) - var contentScale = 0.90 - var useW = outerWidth * contentScale - var useH = outerHeight * contentScale - var offX = (outerWidth - useW) / 2 - var offY = (outerHeight - useH) / 2 - - // Move Active Window to start - var activeAddr = Hyprland.activeToplevel?.lastIpcObject?.address - if (activeAddr) { - var activeIdx = windowList.findIndex(it => it.lastIpcObject.address === activeAddr) - if (activeIdx !== -1) { - windowList = [windowList[activeIdx], ...windowList.filter(it => it !== windowList[activeIdx])] - } - } - - var result = [] - - // Working area cursor - var curX = offX - var curY = offY - var curW = useW - var curH = useH - - // Items to process in Spiral mode - var spiralCount = Math.min(N - 1, maxSplits) - - // Spiral cuts - for (var k = 0; k < spiralCount; k++) { - var sItem = windowList[k] - var sBoxW, sBoxH - var sBoxX = curX - var sBoxY = curY - - // Logic change: Use 'primaryGap' only for the very first cut (k=0), - // otherwise use standard 'gap'. - var currentGap = (k === 0) ? primaryGap : gap - - if (curW > curH) { // Split Vertical - // Calculate width subtracting the specific gap for this iteration - sBoxW = (curW - currentGap) / 2 - sBoxH = curH - - // Shift working area for next items by the specific gap - curX += sBoxW + currentGap - curW -= (sBoxW + currentGap) - } else { // Split Horizontal - sBoxW = curW - sBoxH = (curH - currentGap) / 2 - - // Shift working area for next items by the specific gap - curY += sBoxH + currentGap - curH -= (sBoxH + currentGap) - } - - // Aspect Fit - var sw0 = (sItem.width > 0) ? sItem.width : 100 - var sh0 = (sItem.height > 0) ? sItem.height : 100 - var sScale = Math.min(sBoxW / sw0, sBoxH / sh0) - - result.push({ - win: sItem.win, - x: sBoxX + (sBoxW - (sw0 * sScale))/2, - y: sBoxY + (sBoxH - (sh0 * sScale))/2, - width: sw0 * sScale, - height: sh0 * sScale, - isSpiral: true, - index: k - }) - } - - // Overflow grid - var remainingItems = windowList.slice(spiralCount) - var remN = remainingItems.length - - if (remN > 0) { - // Standard Grid logic for the remaining box - var bestCols = 1 - var bestScale = 0 - var TARGET_ASPECT = 16.0/9.0 - - for (var c = 1; c <= remN; c++) { - var r = Math.ceil(remN / c) - var avW = curW - gap * (c - 1) - var avH = curH - gap * (r - 1) - if (avW <= 0 || avH <= 0) continue - - var cW = avW / c - var cH = avH / r - var sc = Math.min(cW / TARGET_ASPECT, cH) - - if (sc > bestScale) { - bestScale = sc - bestCols = c - } - } - - var remRows = Math.ceil(remN / bestCols) - var finalCellW = (curW - gap * (bestCols - 1)) / bestCols - var finalCellH = (curH - gap * (remRows - 1)) / remRows - - var gridContentH = remRows * finalCellH + (remRows - 1) * gap - var gridStartY = curY + (curH - gridContentH) / 2 - - for (var j = 0; j < remN; j++) { - var rItem = remainingItems[j] - var row = Math.floor(j / bestCols) - var col = j % bestCols - - var itemsInRow = Math.min((row + 1) * bestCols, remN) - (row * bestCols) - var rowW = itemsInRow * finalCellW + (itemsInRow - 1) * gap - var rowStartX = curX + (curW - rowW) / 2 - - var cellX = rowStartX + col * (finalCellW + gap) - var cellY = gridStartY + row * (finalCellH + gap) - - var rw0 = (rItem.width > 0) ? rItem.width : 100 - var rh0 = (rItem.height > 0) ? rItem.height : 100 - var rSc = Math.min(finalCellW / rw0, finalCellH / rh0) - - result.push({ - win: rItem.win, - x: cellX + (finalCellW - (rw0 * rSc))/2, - y: cellY + (finalCellH - (rh0 * rSc))/2, - width: rw0 * rSc, - height: rh0 * rSc, - isSpiral: false - }) - } - } - - return result - } -} diff --git a/config/quickshell/qs-hyprview-unified/layouts/StarggeredLayout.qml b/config/quickshell/qs-hyprview-unified/layouts/StarggeredLayout.qml deleted file mode 100644 index 6a9deb3a..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/StarggeredLayout.qml +++ /dev/null @@ -1,64 +0,0 @@ -pragma Singleton -import Quickshell - -Singleton { - id: root - - function doLayout(windowList, outerWidth, outerHeight) { - var N = windowList.length - if (N === 0) return [] - - var gap = Math.max(10, outerWidth * 0.01) - - // Safe Area - var useW = outerWidth * 0.9 - var useH = outerHeight * 0.9 - var offX = (outerWidth - useW) / 2 - var offY = (outerHeight - useH) / 2 - - // Heuristic: roughly sqrt(N), but slightly weighted towards columns - // to accommodate 16:9 screens better. - var cols = Math.ceil(Math.sqrt(N * 1.5)) - var rows = Math.ceil(N / cols) - - // Calculate cell width. - // Note: In a staggered layout, the effective width needed is (cols + 0.5) - // because alternate rows are shifted by half a cell. - var cellW = (useW - (cols * gap)) / (cols + 0.5) - var cellH = (useH - (rows * gap)) / rows - - // Vertical centering of the whole block - var contentH = rows * cellH + (rows - 1) * gap - var startY = offY + (useH - contentH) / 2 - - var result = [] - - for (var i = 0; i < N; i++) { - var item = windowList[i] - - var r = Math.floor(i / cols) - var c = i % cols - - // Stagger offset: if row is odd, shift right by half cell width - var staggerOffset = (r % 2 === 1) ? (cellW / 2) : 0 - - var cellX = staggerOffset + c * (cellW + gap) - var cellY = r * (cellH + gap) - - // Aspect Fit - var w0 = (item.width > 0) ? item.width : 100 - var h0 = (item.height > 0) ? item.height : 100 - var sc = Math.min(cellW / w0, cellH / h0) - - // Center the thumbnail inside the calculated cell - result.push({ - win: item.win, - x: offX + cellX + (cellW - w0 * sc)/2, - y: startY + cellY + (cellH - h0 * sc)/2, - width: w0 * sc, - height: h0 * sc - }) - } - return result - } -} diff --git a/config/quickshell/qs-hyprview-unified/layouts/VortexLayout.qml b/config/quickshell/qs-hyprview-unified/layouts/VortexLayout.qml deleted file mode 100644 index 6d5fef37..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/VortexLayout.qml +++ /dev/null @@ -1,82 +0,0 @@ -pragma Singleton -import Quickshell - -Singleton { - id: root - - function doLayout(windowList, outerWidth, outerHeight) { - var N = windowList.length - if (N === 0) return [] - - // Safe Area (90%) - var contentScale = 0.90 - var useW = outerWidth * contentScale - var useH = outerHeight * contentScale - var offX = (outerWidth - useW) / 2 - var offY = (outerHeight - useH) / 2 - - var centerX = offX + useW / 2 - var centerY = offY + useH / 2 - - // Maximum radius (distance from center to the furthest edge of safe area) - var maxRadius = Math.min(useW, useH) / 2 - - var result = [] - - // --- THE VORTEX CONFIGURATION --- - - var goldenAngle = Math.PI * (3 - Math.sqrt(5)) - - // PARAMETER TWEAK 1: from 0.3 to 0.5 to keep distant windows readable - var minScale = 0.4 - - // PARAMETER TWEAK 2: from 0.4 to 0.6 (60% of screen height) - var baseSizeFactor = 0.5 - - for (var i = 0; i < N; i++) { - var item = windowList[i] - - var t = i / Math.max(1, N - 1) - if (N === 1) t = 0 - - // PARAMETER TWEAK 3: from 0.9 instead of 0.8 to accommodate larger thumbs - var currentRadius = (maxRadius * 0.85) * Math.sqrt(t) - var currentAngle = i * goldenAngle - var scale = 1.0 - (t * (1.0 - minScale)) - var tilt = (Math.cos(currentAngle) * 8) - - // Coordinates (Polar to Cartesian) - var cx = centerX + currentRadius * Math.cos(currentAngle) - var cy = centerY + currentRadius * Math.sin(currentAngle) - - // Dimensions (Aspect Fit) - var w0 = (item.width > 0) ? item.width : 100 - var h0 = (item.height > 0) ? item.height : 100 - - var baseBoxSize = Math.min(useW, useH) * baseSizeFactor - - var aspect = w0 / h0 - var thumbW, thumbH - - if (aspect > 1) { - thumbW = baseBoxSize * scale - thumbH = thumbW / aspect - } else { - thumbH = baseBoxSize * scale - thumbW = thumbH * aspect - } - - result.push({ - win: item.win, - x: cx - (thumbW / 2), - y: cy - (thumbH / 2), - width: thumbW, - height: thumbH, - rotation: tilt, - zIndex: N - i - }) - } - - return result - } -} diff --git a/config/quickshell/qs-hyprview-unified/layouts/qmldir b/config/quickshell/qs-hyprview-unified/layouts/qmldir deleted file mode 100644 index 653b90ca..00000000 --- a/config/quickshell/qs-hyprview-unified/layouts/qmldir +++ /dev/null @@ -1,12 +0,0 @@ -singleton HeroLayout 1.0 HeroLayout.qml -singleton JustifiedLayout 1.0 JustifiedLayout.qml -singleton MasonryLayout 1.0 MasonryLayout.qml -singleton SmartGridLayout 1.0 SmartGridLayout.qml -singleton SpiralLayout 1.0 SpiralLayout.qml -singleton BandsLayout 1.0 BandsLayout.qml -singleton SatelliteLayout 1.0 SatelliteLayout.qml -singleton StarggeredLayout 1.0 StarggeredLayout.qml -singleton ColumnarLayout 1.0 ColumnarLayout.qml -singleton VortexLayout 1.0 VortexLayout.qml - -singleton LayoutsManager 1.0 LayoutsManager.qml diff --git a/config/quickshell/qs-hyprview-unified/modules/Hyprview.qml b/config/quickshell/qs-hyprview-unified/modules/Hyprview.qml deleted file mode 100644 index 0efd25d4..00000000 --- a/config/quickshell/qs-hyprview-unified/modules/Hyprview.qml +++ /dev/null @@ -1,409 +0,0 @@ -import QtQuick -import QtQuick.Effects -import Quickshell -import Quickshell.Io -import Quickshell.Widgets -import Quickshell.Wayland -import Quickshell.Hyprland -import Qt5Compat.GraphicalEffects -import "../layouts" -import "." - -PanelWindow { - id: root - - // --- SETTINGS --- - property string layoutAlgorithm: "" - property string lastLayoutAlgorithm: "" - property bool liveCapture: false - property bool moveCursorToActiveWindow: false - - // --- INTERNAL STATE --- - property bool isActive: false - property bool specialActive: false - property bool animateWindows: false - property var lastPositions: {} - property real backdropOpacity: 0.2 - - anchors { top: true; bottom: true; left: true; right: true } - color: "transparent" - visible: isActive - - // LayerShell Configs - WlrLayershell.layer: WlrLayer.Top - WlrLayershell.exclusiveZone: -1 - WlrLayershell.keyboardFocus: isActive ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None - WlrLayershell.namespace: "quickshell:expose" - - Timer { - id: searchFocusTimer - interval: 25 - repeat: false - onTriggered: { - if (root.isActive) { - searchBox.focusInput() - } - } - } - - // --- IPC & EVENTS --- - IpcHandler { - target: "expose" - function toggle(layout: string) { - root.layoutAlgorithm = layout - root.toggleExpose() - } - - function open(layout: string) { - root.layoutAlgorithm = layout - if (root.isActive) return - root.toggleExpose() - } - - function close() { - if (!root.isActive) return - root.toggleExpose() - } - } - - Connections { - target: Hyprland - function onRawEvent(ev) { - if (!root.isActive && ev.name !== "activespecial") return - - switch (ev.name) { - case "openwindow": - case "closewindow": - case "changefloatingmode": - case "movewindow": - Hyprland.refreshToplevels() - refreshThumbs() - return - - case "activespecial": - var dataStr = String(ev.data) - var namePart = dataStr.split(",")[0] - root.specialActive = (namePart.length > 0) - return - - default: - return - } - } - } - - // Update thumbs every 125ms if liveCapture = false - Timer { - id: screencopyTimer - interval: 125 - repeat: true - running: !root.liveCapture && root.isActive - onTriggered: root.refreshThumbs() - } - - - function toggleExpose() { - root.isActive = !root.isActive - if (root.isActive) { - if (root.layoutAlgorithm === 'random') { - var layouts = [ - 'smartgrid', - 'justified', - 'bands', - 'masonry', - 'hero', - 'spiral', - 'satellite', - 'staggered', - 'columnar', - 'vortex', - ].filter((l) => l !== root.lastLayoutAlgorithm) - var randomLayout = layouts[Math.floor(Math.random() * layouts.length)] - root.lastLayoutAlgorithm = randomLayout - } else { - root.lastLayoutAlgorithm = root.layoutAlgorithm - } - - exposeArea.currentIndex = -1 - searchBox.reset() - Hyprland.refreshToplevels() - refreshThumbs() - searchFocusTimer.restart() - } else { - root.animateWindows = false - root.lastPositions = {} - searchFocusTimer.stop() - searchBox.releaseInputFocus() - } - } - - function refreshThumbs() { - if (!root.isActive) return - for (var i = 0; i < winRepeater.count; ++i) { - var it = winRepeater.itemAt(i) - if (it && it.visible && it.refreshThumb) { - it.refreshThumb() - } - } - } - - // --- USER INTERFACE --- - FocusScope { - id: mainScope - anchors.fill: parent - focus: true - - Rectangle { - anchors.fill: parent - color: "#000000" - opacity: root.isActive ? root.backdropOpacity : 0 - visible: root.isActive && root.backdropOpacity > 0 - z: -2 - } - - Keys.onPressed: (event) => { - if (!root.isActive) return - - if (event.key === Qt.Key_Escape) { - root.toggleExpose() - event.accepted = true - return - } - - const total = winRepeater.count - if (total <= 0) return - - // Helper for horizontal navigation - function moveSelectionHorizontal(delta) { - var start = exposeArea.currentIndex - for (var step = 1; step <= total; ++step) { - var candidate = (start + delta * step + total) % total - var it = winRepeater.itemAt(candidate) - if (it && it.visible) { - exposeArea.currentIndex = candidate - return - } - } - } - - // Helper for vertical navigation - function moveSelectionVertical(dir) { - var startIndex = exposeArea.currentIndex - var currentItem = winRepeater.itemAt(startIndex) - - if (!currentItem || !currentItem.visible) { - moveSelectionHorizontal(dir > 0 ? 1 : -1) - return - } - - var curCx = currentItem.x + currentItem.width / 2 - var curCy = currentItem.y + currentItem.height / 2 - - var bestIndex = -1 - var bestDy = 99999999 - var bestDx = 99999999 - - for (var i = 0; i < total; ++i) { - var it = winRepeater.itemAt(i) - if (!it || !it.visible || i === startIndex) continue - - var cx = it.x + it.width / 2 - var cy = it.y + it.height / 2 - var dy = cy - curCy - - // Direction filtering - if (dir > 0 && dy <= 0) continue - if (dir < 0 && dy >= 0) continue - - var absDy = Math.abs(dy) - var absDx = Math.abs(cx - curCx) - - // Search for nearest thumb (first in vertical, then horizontal distance) - if (absDy < bestDy || (absDy === bestDy && absDx < bestDx)) { - bestDy = absDy - bestDx = absDx - bestIndex = i - } - } - - if (bestIndex >= 0) { - exposeArea.currentIndex = bestIndex - } - } - - // --- NVIM-style navigation with Ctrl --- - const ctrl = event.modifiers & Qt.ControlModifier - - if (ctrl) { - if (event.key === Qt.Key_L) { - moveSelectionHorizontal(1) - event.accepted = true - } else if (event.key === Qt.Key_H) { - moveSelectionHorizontal(-1) - event.accepted = true - } else if (event.key === Qt.Key_J) { - moveSelectionVertical(1) - event.accepted = true - } else if (event.key === Qt.Key_K) { - moveSelectionVertical(-1) - event.accepted = true - } - return - } - - if (event.key === Qt.Key_Right || event.key === Qt.Key_Tab) { - moveSelectionHorizontal(1) - event.accepted = true - } else if (event.key === Qt.Key_Left || event.key === Qt.Key_Backtab) { - moveSelectionHorizontal(-1) - event.accepted = true - } else if (event.key === Qt.Key_Down) { - moveSelectionVertical(1) - event.accepted = true - } else if (event.key === Qt.Key_Up) { - moveSelectionVertical(-1) - event.accepted = true - } else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { - var item = winRepeater.itemAt(exposeArea.currentIndex) - if (item && item.activateWindow) { - item.activateWindow() - event.accepted = true - } - } - } - - MouseArea { - anchors.fill: parent - hoverEnabled: false - z: -1 - onClicked: root.toggleExpose() - } - - Item { - id: layoutContainer - anchors.fill: parent - anchors.margins: 32 - - Column { - id: layoutRoot - anchors.fill: parent - anchors.margins: 48 - spacing: 20 - - // thumbs area - Item { - id: exposeArea - width: layoutRoot.width - height: layoutRoot.height - searchBox.implicitHeight - layoutRoot.spacing - - property int currentIndex: 0 - property string searchText: "" - - // Reset active thumb on searchText change - onSearchTextChanged: { - currentIndex = (windowLayoutModel.count > 0) ? 0 : -1 - } - - ScriptModel { - id: windowLayoutModel - - property int areaW: exposeArea.width - property int areaH: exposeArea.height - property string query: exposeArea.searchText - property string algo: root.lastLayoutAlgorithm - property var rawToplevels: Hyprland.toplevels.values - - values: { - // Bailout on wrong screen size - if (areaW <= 0 || areaH <= 0) return [] - - var q = (query || "").toLowerCase() - var windowList = [] - var idx = 0 - - if (!rawToplevels) return [] - - for (var it of rawToplevels) { - var w = it - var clientInfo = w && w.lastIpcObject ? w.lastIpcObject : {} - var workspace = clientInfo && clientInfo.workspace ? clientInfo.workspace : null - var workspaceId = workspace && workspace.id !== undefined ? workspace.id : undefined - - // Filter invalid workspace or offscreen windows - if (workspaceId === undefined || workspaceId === null) continue - var size = clientInfo && clientInfo.size ? clientInfo.size : [0, 0] - var at = clientInfo && clientInfo.at ? clientInfo.at : [-1000, -1000] - if (at[1] + size[1] <= 0) continue - - // Text filtering - var title = (w.title || clientInfo.title || "").toLowerCase() - var clazz = (clientInfo["class"] || "").toLowerCase() - var ic = (clientInfo.initialClass || "").toLowerCase() - var app = (w.appId || clientInfo.initialClass || "").toLowerCase() - - if (q.length > 0) { - var match = title.indexOf(q) !== -1 || clazz.indexOf(q) !== -1 || - ic.indexOf(q) !== -1 || app.indexOf(q) !== -1 - if (!match) continue - } - - windowList.push({ - win: w, - clientInfo: clientInfo, - workspaceId: workspaceId, - width: size[0], - height: size[1], - originalIndex: idx++, - lastIpcObject: w.lastIpcObject - }) - } - - // Sort by workspaceId, then originalIndex - windowList.sort(function(a, b) { - if (a.workspaceId < b.workspaceId) return -1 - if (a.workspaceId > b.workspaceId) return 1 - if (a.originalIndex < b.originalIndex) return -1 - if (a.originalIndex > b.originalIndex) return 1 - return 0 - }) - - return LayoutsManager.doLayout(algo, windowList, areaW, areaH) - } - } - - Repeater { - id: winRepeater - model: windowLayoutModel - - delegate: WindowThumbnail { - // Model data - hWin: modelData.win - wHandle: hWin.wayland - winKey: String(hWin.address) - thumbW: modelData.width - thumbH: modelData.height - clientInfo: hWin.lastIpcObject - - // Layout-generated coordinates - targetX: modelData.x - targetY: modelData.y - targetZ: (visible && (exposeArea.currentIndex === index)) ? 1000: modelData.zIndex || 0 - targetRotation: modelData.rotation || 0 - - hovered: visible && (exposeArea.currentIndex === index) - moveCursorToActiveWindow: root.moveCursorToActiveWindow - } - } - } - - SearchBox { - id: searchBox - onTextChanged: function(text) { - root.animateWindows = true - exposeArea.searchText = text - } - } - } - } - } -} diff --git a/config/quickshell/qs-hyprview-unified/modules/SearchBox.qml b/config/quickshell/qs-hyprview-unified/modules/SearchBox.qml deleted file mode 100644 index 42971bd1..00000000 --- a/config/quickshell/qs-hyprview-unified/modules/SearchBox.qml +++ /dev/null @@ -1,53 +0,0 @@ -import QtQuick -import Quickshell - -Rectangle { - id: searchBar - width: Math.min(parent.width * 0.6, 480) - height: 40 - radius: 20 - color: "#66000000" - border.width: 1 - border.color: m3.m3Primary - anchors.horizontalCenter: parent.horizontalCenter - - property var onTextChanged: null - - function reset() { - searchInput.text = "" - } - - function focusInput() { - searchInput.forceActiveFocus(Qt.ActiveWindowFocusReason) - } - - function releaseInputFocus() { - searchInput.focus = false - } - - TextInput { - id: searchInput - anchors.fill: parent - anchors.leftMargin: 16 - anchors.rightMargin: 16 - verticalAlignment: TextInput.AlignVCenter - color: "white" - font.pixelSize: 16 - activeFocusOnTab: false - selectByMouse: true - focus: false - - onTextChanged: { - searchBar.onTextChanged(text) - } - - Text { - anchors.fill: parent - verticalAlignment: Text.AlignVCenter - color: "#88ffffff" - font.pixelSize: 14 - text: "Type to filter windows..." - visible: !searchInput.text || searchInput.text.length === 0 - } - } -} diff --git a/config/quickshell/qs-hyprview-unified/modules/WindowThumbnail.qml b/config/quickshell/qs-hyprview-unified/modules/WindowThumbnail.qml deleted file mode 100644 index 26834814..00000000 --- a/config/quickshell/qs-hyprview-unified/modules/WindowThumbnail.qml +++ /dev/null @@ -1,277 +0,0 @@ -import QtQuick -import QtQuick.Effects -import Quickshell -import Quickshell.Io -import Quickshell.Widgets -import Quickshell.Wayland -import Quickshell.Hyprland -import Qt5Compat.GraphicalEffects - -Item { - id: thumbContainer - - property var hWin: null - property var wHandle:null - - property string winKey: '' - - property real thumbW: -1 - property real thumbH: -1 - - property var clientInfo: {} - property bool hovered: false - - property real targetX: -1000 - property real targetY: -1000 - property real targetZ: 0 - property real targetRotation: 0 - - property bool moveCursorToActiveWindow: false - - width: thumbW - height: thumbH - - x: 0 - y: 0 - z: targetZ - rotation: 0 - - visible: !!wHandle - - NumberAnimation { - id: animX - target: thumbContainer - property: "x" - duration: root.animateWindows ? 100 : 0 - easing.type: Easing.OutQuad - } - NumberAnimation { - id: animY - target: thumbContainer - property: "y" - duration: root.animateWindows ? 100 : 0 - easing.type: Easing.OutQuad - } - NumberAnimation { - id: animRotation - target: thumbContainer - property: "rotation" - duration: 400 - easing.type: Easing.OutBack // Effetto rimbalzo/inerzia - easing.overshoot: 1.2 - } - - function updateLastPos() { - var lp = root.lastPositions || ({}) - var prev = lp[winKey] || ({}) - prev.x = x - prev.y = y - lp[winKey] = prev - root.lastPositions = lp - } - - onTargetXChanged: { - if (!root.animateWindows) { - x = targetX - updateLastPos() - return - } - - var lp = root.lastPositions || ({}) - var prev = lp[winKey] - var startX = (prev && prev.x !== undefined) ? prev.x : targetX - - if (startX === targetX) { - x = targetX - updateLastPos() - return - } - - animX.stop() - animX.from = startX - animX.to = targetX - animX.start() - } - - onTargetYChanged: { - if (!root.animateWindows) { - y = targetY - updateLastPos() - return - } - - var lp = root.lastPositions || ({}) - var prev = lp[winKey] - var startY = (prev && prev.y !== undefined) ? prev.y : targetY - - if (startY === targetY) { - y = targetY - updateLastPos() - return - } - - animY.stop() - animY.from = startY - animY.to = targetY - animY.start() - } - - onTargetRotationChanged: { - rotation = targetRotation - animRotation.stop() - animRotation.from = 0 - animRotation.to = targetRotation - animRotation.start() - } - - onXChanged: updateLastPos() - onYChanged: updateLastPos() - - Component.onCompleted: { - rotation = targetRotation - if (!root.animateWindows) { - x = targetX - y = targetY - updateLastPos() - } - } - - function activateWindow() { - if (!hWin) return - - var targetIsSpecial = (hWin?.workspace ?? 0) < 0 || (hWin?.workspace?.name ?? "").startsWith("special") - - if (root.specialActive && !targetIsSpecial) { - Hyprland.dispatch("togglespecialworkspace") - } - - if (hWin.workspace) { - hWin.workspace.activate() - } - - root.toggleExpose() - Hyprland.dispatch("focuswindow address:0x" + hWin.address) - Hyprland.dispatch("alterzorder top") - if (thumbContainer.moveCursorToActiveWindow) { - var cx = clientInfo.at[0] + (clientInfo.size[0]/2) - var cy = clientInfo.at[1] + (clientInfo.size[1]/2) - Hyprland.dispatch("movecursor " + cx + " " + cy) - - } - } - - function closeWindow() { - if (!hWin) return - Hyprland.dispatch("closewindow address:0x" + hWin.address) - } - - function refreshThumb() { - if (thumbLoader.item) { - thumbLoader.item.captureFrame() - } - } - - Item { - id: card - anchors.fill: parent - - scale: thumbContainer.hovered ? 1.05 : 0.95 - transformOrigin: Item.Center - - Behavior on scale { - NumberAnimation { duration: 100; easing.type: Easing.OutQuad } - } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - acceptedButtons: Qt.LeftButton | Qt.MiddleButton - - onEntered: { - exposeArea.currentIndex = index - } - onClicked: event => { - exposeArea.currentIndex = index - - if (event.button === Qt.LeftButton) { - thumbContainer.activateWindow() - } - if (event.button === Qt.MiddleButton) { - thumbContainer.closeWindow() - } - } - onExited: { - if (exposeArea.currentIndex === index) { - exposeArea.currentIndex = -1 - } - } - } - - Rectangle { - anchors.fill: parent - anchors.margins: -8 - radius: 22 - color: "#55000000" - z: -1 - } - - Loader { - id: thumbLoader - anchors.fill: parent - active: root.isActive && !!thumbContainer.wHandle - sourceComponent: ScreencopyView { - id: thumb - anchors.fill: parent - captureSource: thumbContainer.wHandle - live: root.liveCapture && root.isActive - paintCursor: false - visible: root.isActive && thumbContainer.wHandle && hasContent - - layer.enabled: true - layer.effect: OpacityMask { - maskSource: Rectangle { - width: thumb.width - height: thumb.height - radius: 16 - } - } - - Rectangle { - anchors.fill: parent - color: thumbContainer.hovered ? "transparent": "#33000000" - border.width : thumbContainer.hovered ? 3 : 1 - border.color : thumbContainer.hovered ? m3.m3Primary : m3.m3Secondary - radius: 16 - } - } - } - - Rectangle { - id: badge - z: 100 - width: Math.min(titleText.implicitWidth + 24, thumbContainer.thumbW * 0.75) - height: titleText.implicitHeight + 12 - - x: (card.width - width) / 2 - y: card.height - height - (card.height * 0.08) - - radius: 12 - color: thumbContainer.hovered ? "#FF000000" : "#CC000000" - border.width : 1 - border.color : "#ff464646" - - Text { - id: titleText - anchors.centerIn: parent - width: parent.width - 16 - text: hWin.title - color: "white" - font.pixelSize: thumbContainer.hovered ? 13 : 12 - elide: Text.ElideRight - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - } -} diff --git a/config/quickshell/qs-hyprview-unified/modules/qmldir b/config/quickshell/qs-hyprview-unified/modules/qmldir deleted file mode 100644 index 097b9ca9..00000000 --- a/config/quickshell/qs-hyprview-unified/modules/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -Hyprview 1.0 Hyprview.qml -WindowThumbnail 1.0 WindowThumbnail.qml -SearchBox 1.0 SearchBox.qml diff --git a/config/quickshell/qs-hyprview-unified/qs-hyprview-template.qml b/config/quickshell/qs-hyprview-unified/qs-hyprview-template.qml deleted file mode 100644 index 2a6fa2f8..00000000 --- a/config/quickshell/qs-hyprview-unified/qs-hyprview-template.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick - -QtObject { - id: m3 - - property color m3Primary: "{{colors.primary.default.hex}}" - property color m3OnPrimary: "{{colors.on_primary.default.hex}}" - - property color m3PrimaryContainer: "{{colors.primary_container.default.hex}}" - property color m3OnPrimaryContainer: "{{colors.on_primary_container.default.hex}}" - - property color m3Secondary: "{{colors.secondary.default.hex}}" - property color m3OnSecondary: "{{colors.on_secondary.default.hex}}" - - property color m3SecondaryContainer: "{{colors.secondary_container.default.hex}}" - property color m3OnSecondaryContainer: "{{colors.on_secondary_container.default.hex}}" -} - diff --git a/config/quickshell/qs-hyprview-unified/screenshots/bands.jpeg b/config/quickshell/qs-hyprview-unified/screenshots/bands.jpeg Binary files differdeleted file mode 100644 index 9d7834c0..00000000 --- a/config/quickshell/qs-hyprview-unified/screenshots/bands.jpeg +++ /dev/null diff --git a/config/quickshell/qs-hyprview-unified/screenshots/hero.jpeg b/config/quickshell/qs-hyprview-unified/screenshots/hero.jpeg Binary files differdeleted file mode 100644 index 35b022a9..00000000 --- a/config/quickshell/qs-hyprview-unified/screenshots/hero.jpeg +++ /dev/null diff --git a/config/quickshell/qs-hyprview-unified/screenshots/masonry.jpeg b/config/quickshell/qs-hyprview-unified/screenshots/masonry.jpeg Binary files differdeleted file mode 100644 index c0e379eb..00000000 --- a/config/quickshell/qs-hyprview-unified/screenshots/masonry.jpeg +++ /dev/null diff --git a/config/quickshell/qs-hyprview-unified/screenshots/satellite.jpeg b/config/quickshell/qs-hyprview-unified/screenshots/satellite.jpeg Binary files differdeleted file mode 100644 index 3063a3db..00000000 --- a/config/quickshell/qs-hyprview-unified/screenshots/satellite.jpeg +++ /dev/null diff --git a/config/quickshell/qs-hyprview-unified/screenshots/smartgrid.jpeg b/config/quickshell/qs-hyprview-unified/screenshots/smartgrid.jpeg Binary files differdeleted file mode 100644 index 265cf17c..00000000 --- a/config/quickshell/qs-hyprview-unified/screenshots/smartgrid.jpeg +++ /dev/null diff --git a/config/quickshell/qs-hyprview-unified/screenshots/spiral.jpeg b/config/quickshell/qs-hyprview-unified/screenshots/spiral.jpeg Binary files differdeleted file mode 100644 index 4274675c..00000000 --- a/config/quickshell/qs-hyprview-unified/screenshots/spiral.jpeg +++ /dev/null diff --git a/config/quickshell/qs-hyprview-unified/screenshots/staggered.jpeg b/config/quickshell/qs-hyprview-unified/screenshots/staggered.jpeg Binary files differdeleted file mode 100644 index 5cd462f3..00000000 --- a/config/quickshell/qs-hyprview-unified/screenshots/staggered.jpeg +++ /dev/null diff --git a/config/quickshell/qs-hyprview-unified/screenshots/vortex.jpeg b/config/quickshell/qs-hyprview-unified/screenshots/vortex.jpeg Binary files differdeleted file mode 100644 index c0d6adfa..00000000 --- a/config/quickshell/qs-hyprview-unified/screenshots/vortex.jpeg +++ /dev/null diff --git a/config/quickshell/qs-hyprview-unified/shell.qml b/config/quickshell/qs-hyprview-unified/shell.qml deleted file mode 100644 index 09201652..00000000 --- a/config/quickshell/qs-hyprview-unified/shell.qml +++ /dev/null @@ -1,16 +0,0 @@ -//@ pragma Env QT_LOGGING_RULES=qt.qpa.wayland.textinput=false -import QtQuick -import Quickshell -import "./modules" -import "./common" - -ShellRoot { - id: root - - Appearance { id: m3 } - - Hyprview { - liveCapture: true - moveCursorToActiveWindow: false - } -} diff --git a/config/quickshell/qs-hyprview/modules/WindowThumbnail.qml b/config/quickshell/qs-hyprview/modules/WindowThumbnail.qml index 89383291..26834814 100644 --- a/config/quickshell/qs-hyprview/modules/WindowThumbnail.qml +++ b/config/quickshell/qs-hyprview/modules/WindowThumbnail.qml @@ -208,13 +208,12 @@ Item { } } - RectangularShadow { + Rectangle { anchors.fill: parent - radius: 16 - blur: 24 - spread: 10 + anchors.margins: -8 + radius: 22 color: "#55000000" - cached: true + z: -1 } Loader { |
