//@ pragma UseQApplication // ~/.config/quickshell/shell.qml // QuickShell desktop shell for Hyprland (Nix-Vibe hp-laptop). // // "Sci-fi dark glass + vivid neon" theme: // - frosted-glass pill bar (blur via Hyprland layerrule, namespace qs-neon-bar) // - workspace pills with neon bloom on the active one // - icon status row: battery (UPower), volume (PipeWire), brightness // (brightnessctl), Wi-Fi (Networking); scroll volume/brightness chips // - notification center (native NotificationServer): toasts + history/DND/clear // - workspace overview (SUPER+W): lite mission control, jump with a click // - Orbitron display font, Symbols Nerd Font icons // - HUD corner brackets per monitor with a slow pulse // - animated accent sweep along the bar's bottom edge // QuickShell live-reloads this file on save. import Quickshell import Quickshell.Hyprland import Quickshell.Io import Quickshell.Networking import Quickshell.Services.Mpris import Quickshell.Services.Notifications import Quickshell.Services.Pipewire import Quickshell.Services.UPower import Quickshell.Services.SystemTray import Quickshell.Wayland import QtQuick import QtQuick.Layouts ShellRoot { id: root // Keep-awake: while true the compositor is told the session must not go // idle, so hypridle's lock/blank/suspend listeners never fire. // Session-lifetime only (resets on logout) — it's meant as a temporary hold. property bool keepAwake: false // ---------- system stats (qs-stats probe) ---------- // Parsed JSON from the stats probe; refreshed on the slow bar timer and // fast while the popup is open. property var stats: null readonly property string statsScript: "/home/petere/.local/bin/qs-stats" // Pinned flake.lock info (nixpkgs node) injected at build time by hyprland.nix. readonly property var flakeInfo: @FLAKEINFO@ // Build-time theme colors injected by hyprland.nix from the shared palette // (home-manager/modules/palette.nix). At startup these may be repainted by a // wallpaper-driven palette (~/.cache/quickshell/theme.json, see // applyRuntimeTheme/themeOverrideProc below). readonly property var themeColors: @THEMECOLORS@ // helpers for the chip/popup display values function statsHot() { if (root.stats === null || root.stats.temps === undefined || root.stats.temps.length === 0) return 0; let hot = 0; for (const t of root.stats.temps) hot = Math.max(hot, t.temp); return hot; } function statsAgeDays() { if (root.flakeInfo === null || root.flakeInfo.lastModified === undefined) return -1; return Math.max(0, Math.floor((Date.now() / 1000 - root.flakeInfo.lastModified) / 86400)); } function statsRev() { if (root.flakeInfo === null || root.flakeInfo.rev === undefined) return ""; return root.flakeInfo.rev.substring(0, 8); } // ---------- autostart app manager ---------- property var appsEntries: [] property bool appsAddOpen: false property string appsNewName: "" property string appsNewCmd: "" // ---------- battery charge limit (gear quick-settings panel) ---------- // Backend `battery-charge-limit` (NixOS hardware/battery-limit modules) is // provided by both the HP module (acpi_call SBCO/SBCC) and the ThinkPad // module (native charge_control_start/end_threshold sysfs). The on/off // switch refreshes the persisted state file via `status` and toggles via // `sudo