From 25dc8507b8ceb392d448722702f9aeca415d57c5 Mon Sep 17 00:00:00 2001 From: Tomas Rivera <137088692+Totorile1@users.noreply.github.com> Date: Tue, 10 Mar 2026 18:38:32 +0100 Subject: [PATCH] fixed a lot of quickshell problems --- hosts/laptop/home.nix | 6 ++-- modules/home-manager/hyprland.nix | 2 +- modules/home-manager/zsh.nix | 1 + other/quickshell/Globals.qml | 4 +-- other/quickshell/bar/Bar.qml | 4 +-- other/quickshell/bar/ClickableIcon.qml | 37 ++++++++++++++++++++- other/quickshell/bar/Time.qml | 2 +- other/quickshell/bar/Volume.qml | 3 +- other/quickshell/bar/Workspaces.qml | 2 +- other/quickshell/bar/mpris/Players.qml | 9 +++-- other/quickshell/bar/mpris/PlayersPopup.qml | 25 +++++++++++--- other/quickshell/notifs/Display.qml | 21 ++++++++++-- other/quickshell/notifs/Notif.qml | 6 ++-- other/quickshell/notifs/Overlay.qml | 13 ++++++-- other/quickshell/shell.qml | 10 +++--- todo | 32 ++++++++++++++++++ 16 files changed, 145 insertions(+), 32 deletions(-) diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index c4097bb..26503cf 100755 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -17,12 +17,12 @@ ../../modules/home-manager/hyprland.nix ../../modules/home-manager/wlogout.nix # logout utility ../../modules/home-manager/rofi.nix # launcher and keybindings helper - ../../modules/home-manager/swaync.nix # notification daemon + #notifications are now manager with quickshell../../modules/home-manager/swaync.nix # notification daemon ../../modules/home-manager/neovim.nix # dont use nixvim. broken #../../modules/home-manager/neovim2.nix # ./neovim2.nix uses vim plug instead of the nix repository as with ./neovim.nix see the begining of neovim2 for an explanation ../../modules/home-manager/rclone.nix - ../../modules/home-manager/waybar.nix - ../../modules/home-manager/quickshell.nix # used for widgets. Maybe it will replace waybar + #../../modules/home-manager/waybar.nix + ../../modules/home-manager/quickshell.nix # used for widgets, waybar and notifications #../../modules/home-manager/oh-my-posh.nix # zsh customizer ../../modules/home-manager/oh-my-zsh.nix # another zsh customizer ../../modules/home-manager/hypridle.nix diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index 793d442..eab6635 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -144,7 +144,7 @@ in { "Ctrl+$mod, 4, exec, kitty -e 'custom-launch'" "Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=5 -e btm --theme gruvbox --disable-click --disable_advanced_kill --enable_cache_memory -g -R -T " "Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=1 -e sh -c 'cmatrix -br'" - "Ctrl+Alt, 1, exec, swaync-client -t" # pos 4 1 notification center + #"Ctrl+Alt, 1, exec, swaync-client -t" # pos 4 1 notification center "Ctrl+$mod, 3, exec, pavucontrol" # pos 1 2 audiocontrol "Ctrl+$mod, 5, exec, gnome-characters" # pos 2 2 special chars "Ctrl+Alt, 8, exec, hyprpicker | tee >(wl-copy) | cliphist store" # pos 3 2 colorpicker diff --git a/modules/home-manager/zsh.nix b/modules/home-manager/zsh.nix index 4402ceb..77a4a88 100644 --- a/modules/home-manager/zsh.nix +++ b/modules/home-manager/zsh.nix @@ -29,6 +29,7 @@ librewolf = "kitty --class \"custom-librewolfprofiles\" --name \"Select LibreWolf profile\" --hold custom-librewolfprofiles"; manix = "custom-manix"; man = "custom-man"; + mplayer = "mplayer -volume 5"; }; }; } diff --git a/other/quickshell/Globals.qml b/other/quickshell/Globals.qml index 75efc69..5b1fb63 100644 --- a/other/quickshell/Globals.qml +++ b/other/quickshell/Globals.qml @@ -7,7 +7,7 @@ import Quickshell.Io Singleton { id: root - readonly property var getThemeProc: Process { + /*readonly property var getThemeProc: Process { running: true command: ["gsettings", "get", "org.gnome.desktop.interface", "color-scheme"] stdout: SplitParser { @@ -31,5 +31,5 @@ Singleton { gtk4ThemeProc.running = true; gtk3ThemeProc.command = ["gsettings", "set", "org.gnome.desktop.interface", "gtk-theme", `"Adwaita${root.isDarkTheme ? "-dark" : ""}"`]; gtk3ThemeProc.running = true; - } + }*/ } diff --git a/other/quickshell/bar/Bar.qml b/other/quickshell/bar/Bar.qml index 6b73802..89e6cdf 100644 --- a/other/quickshell/bar/Bar.qml +++ b/other/quickshell/bar/Bar.qml @@ -91,7 +91,7 @@ PanelWindow { spacing: 12 - Launcher {} + //Launcher {} Workspaces { bar: root @@ -154,7 +154,7 @@ PanelWindow { bar: root } - Theme {} + //Theme {} Power { id: power diff --git a/other/quickshell/bar/ClickableIcon.qml b/other/quickshell/bar/ClickableIcon.qml index a87ab98..6bcda68 100644 --- a/other/quickshell/bar/ClickableIcon.qml +++ b/other/quickshell/bar/ClickableIcon.qml @@ -1,4 +1,4 @@ -import QtQuick +/*import QtQuick BarButton { id: root @@ -17,4 +17,39 @@ BarButton { } } } + }*/ + import QtQuick + +BarButton { + id: root + + // NEW property: stores the intended image path + property string iconSource: "" + + // optional: alias for external access + property alias mirror: img.mirror + + implicitWidth: 24 + implicitHeight: 24 + + Image { + id: img + anchors.fill: parent + smooth: false + + // Use the property, fallback if empty + //source: root.iconSource ? root.iconSource : "../assets/noaudio.png" + Component.onCompleted: { + source: typeof root.iconSource === "string" && root.iconSource.length > 0 + ? root.iconSource + : "../assets/noaudio.png" + } + onSourceChanged: { + console.log("ClickableIcon: iconSource =", root.iconSource, " -> Image.source =", img.source); + } + scale: root.containsMouse ? 0.9 : 1 + Behavior on scale { + NumberAnimation { duration: 70 } + } + } } diff --git a/other/quickshell/bar/Time.qml b/other/quickshell/bar/Time.qml index dd14c58..4d9089b 100644 --- a/other/quickshell/bar/Time.qml +++ b/other/quickshell/bar/Time.qml @@ -13,7 +13,7 @@ Text { Process { id: dateProc - command: ["date", "+%H⯁%M"] + command: ["date", "+%H:%M"] running: true stdout: SplitParser { onRead: data => timetxt.text = data diff --git a/other/quickshell/bar/Volume.qml b/other/quickshell/bar/Volume.qml index aa85f1a..afc2bf1 100644 --- a/other/quickshell/bar/Volume.qml +++ b/other/quickshell/bar/Volume.qml @@ -30,7 +30,8 @@ MouseArea { Image { anchors.fill: parent - source: `../assets/${root.node.audio.muted ? "noaudio" : "audio"}.png` + //source: `../assets/${root.node.audio.muted ? "noaudio" : "audio"}.png` + source: root.node ? `../assets/${root.node.audio.muted ? "noaudio" : "audio"}.png` : "../assets/noaudio.png" smooth: false scale: popupLoader.active ? 0.9 : 1 diff --git a/other/quickshell/bar/Workspaces.qml b/other/quickshell/bar/Workspaces.qml index c14f0a8..6c76bdc 100644 --- a/other/quickshell/bar/Workspaces.qml +++ b/other/quickshell/bar/Workspaces.qml @@ -10,7 +10,7 @@ MouseArea { required property var bar property int wsBaseIndex: 1 - property int wsCount: 7 + property int wsCount: 9 readonly property HyprlandMonitor monitor: Hyprland.monitorFor(bar.screen) property int currentIndex: 0 property int existsCount: 0 diff --git a/other/quickshell/bar/mpris/Players.qml b/other/quickshell/bar/mpris/Players.qml index adf9e72..363a8c1 100644 --- a/other/quickshell/bar/mpris/Players.qml +++ b/other/quickshell/bar/mpris/Players.qml @@ -52,7 +52,8 @@ MouseArea { acceptedButtons: Qt.LeftButton implicitWidth: 20 implicitHeight: 20 - image: "../../assets/fastforward.png" + //image: "../../assets/fastforward.png" + iconSource:"../../assets/fastforward.png" mirror: true hoverEnabled: true enabled: MprisController.canGoPrevious @@ -71,7 +72,8 @@ MouseArea { implicitHeight: 26 Layout.leftMargin: -4 Layout.rightMargin: -4 - image: `../../assets/${MprisController.isPlaying ? "pause" : "play"}.png` + //image: `../../assets/${MprisController.isPlaying ? "pause" : "play"}.png` + iconSource:`../../assets/${MprisController.isPlaying ? "pause" : "play"}.png` hoverEnabled: true enabled: MprisController.canTogglePlaying onClicked: MprisController.togglePlaying() @@ -81,7 +83,8 @@ MouseArea { acceptedButtons: Qt.LeftButton implicitWidth: 20 implicitHeight: 20 - image: "../../assets/fastforward.png" + //image: "../../assets/fastforward.png" + iconSource:"../../assets/fastforward.png" hoverEnabled: true enabled: MprisController.canGoNext onClicked: MprisController.next() diff --git a/other/quickshell/bar/mpris/PlayersPopup.qml b/other/quickshell/bar/mpris/PlayersPopup.qml index 33fc82e..8732062 100644 --- a/other/quickshell/bar/mpris/PlayersPopup.qml +++ b/other/quickshell/bar/mpris/PlayersPopup.qml @@ -355,7 +355,8 @@ PopupWindow { implicitWidth: 24 implicitHeight: 24 enabled: MprisController.loopSupported - image: { + //image: { + /*iconSource { switch (MprisController.loopState) { case MprisLoopState.None: return "../../assets/repeat-off.png"; @@ -364,7 +365,17 @@ PopupWindow { case MprisLoopState.Track: return "../../assets/repeat-once.png"; } + }*/ + function getLoopIcon() { + switch (MprisController.loopState) { + case MprisLoopState.None: return "../../assets/repeat-off.png"; + case MprisLoopState.Playlist: return "../../assets/repeat.png"; + case MprisLoopState.Track: return "../../assets/repeat-once.png"; } + return "../../assets/repeat-off.png"; // fallback + } + + iconSource: getLoopIcon() onClicked: { let target = MprisLoopState.None; switch (MprisController.loopState) { @@ -388,7 +399,8 @@ PopupWindow { implicitWidth: 32 implicitHeight: 32 enabled: MprisController.canGoPrevious - image: "../../assets/fastforward.png" + //image: "../../assets/fastforward.png" + iconSource: "../../assets/fastforward.png" mirror: true onClicked: MprisController.previous() } @@ -397,7 +409,8 @@ PopupWindow { implicitWidth: 42 implicitHeight: 42 enabled: MprisController.canTogglePlaying - image: `../../assets/${MprisController.isPlaying ? "pause" : "play"}.png` + //image: `../../assets/${MprisController.isPlaying ? "pause" : "play"}.png` + iconSource: `../../assets/${MprisController.isPlaying ? "pause" : "play"}.png` onClicked: MprisController.togglePlaying() } @@ -407,7 +420,8 @@ PopupWindow { implicitWidth: 32 implicitHeight: 32 enabled: MprisController.canGoNext - image: "../../assets/fastforward.png" + //image: "../../assets/fastforward.png" + iconSource: "../../assets/fastforward.png" onClicked: MprisController.next() } @@ -417,7 +431,8 @@ PopupWindow { implicitWidth: 24 implicitHeight: 24 enabled: MprisController.shuffleSupported - image: `../../assets/${MprisController.hasShuffle ? "shuffle" : "noshuffle"}.png` + //image: `../../assets/${MprisController.hasShuffle ? "shuffle" : "noshuffle"}.png` + iconSource: `../../assets/${MprisController.hasShuffle ? "shuffle" : "noshuffle"}.png` onClicked: MprisController.setShuffle(!MprisController.hasShuffle) } } diff --git a/other/quickshell/notifs/Display.qml b/other/quickshell/notifs/Display.qml index d4bdf7d..7366afb 100644 --- a/other/quickshell/notifs/Display.qml +++ b/other/quickshell/notifs/Display.qml @@ -45,7 +45,7 @@ Item { anchors.left: parent.left anchors.right: parent.right - Text { + /*Text { // we sanitize in case there is some null notification Layout.maximumWidth: bannerRect.width text: root.notif.summary + (root.notif.body ? "\n=======" : "") font.family: "BigBlueTermPlusNerdFont" @@ -63,7 +63,24 @@ Item { font.pointSize: 14 font.bold: false color: "#9292B6" - } + }*/ + Text { + text: root.notif ? root.notif.summary + (root.notif.body ? "\n" : "") : "" + font.family: "BigBlueTermPlusNerdFont" + wrapMode: Text.Wrap + font.pointSize: 18 + font.bold: true + color: "#9292B6" + } + + Text { + text: root.notif ? root.notif.body : "" + font.family: "BigBlueTermPlusNerdFont" + wrapMode: Text.Wrap + font.pointSize: 14 + font.bold: false + color: "#9292B6" + } } } } diff --git a/other/quickshell/notifs/Notif.qml b/other/quickshell/notifs/Notif.qml index 59a5b79..4cd3d1b 100644 --- a/other/quickshell/notifs/Notif.qml +++ b/other/quickshell/notifs/Notif.qml @@ -117,7 +117,8 @@ Item { visible: false Process { id: screamCmd - command: ["play", "--no-show-progress", "assets/wilhelm-scream.ogg"] + command: ["mplayer", "../assets/wilhelm-scream.ogg"] + //command: ["play", "--no-show-progress", "assets/wilhelm-scream.ogg"] } onVisibleChanged: () => { if (visible) { @@ -177,7 +178,8 @@ Item { Process { id: playSoundCmd - command: ["play", "--no-show-progress", "assets/trumpet.wav"] + command: ["mplayer", "../assets/trumpet.wav"] + //command: ["play", "--no-show-progress", "assets/trumpet.wav"] } Component.onCompleted: playSoundCmd.startDetached() } diff --git a/other/quickshell/notifs/Overlay.qml b/other/quickshell/notifs/Overlay.qml index dc2bbe6..3a86adc 100644 --- a/other/quickshell/notifs/Overlay.qml +++ b/other/quickshell/notifs/Overlay.qml @@ -28,10 +28,15 @@ PanelWindow { onNotification: notif => { notif.tracked = true; - root.notifs = [...root.notifs, notif]; - } + //root.notifs = [...root.notifs, notif]; // sometimes sent as null + if (notif) { + notif.tracked = true; + root.notifs = [...root.notifs, notif]; + } + } } + visible: stack.children.length != 0 mask: Region { item: stack @@ -79,11 +84,13 @@ PanelWindow { notif: modelData onDismissed: () => { + if (notif) { //handles sometimes WARN scene: @notifs/Overlay.qml[82:-1]: TypeError: Cannot read property 'dismiss' of null modelData.dismiss(); // Remove from list const index = root.notifs.indexOf(notif); if (index > -1) - root.notifs.splice(index, 1); + root.notifs.splice(index, 1); + } } } } diff --git a/other/quickshell/shell.qml b/other/quickshell/shell.qml index 1924892..0a720c9 100644 --- a/other/quickshell/shell.qml +++ b/other/quickshell/shell.qml @@ -2,12 +2,12 @@ import Quickshell import QtQuick import "bar" as Bar import "notifs" as Notifs -import "launcher" as Launcher +//import "launcher" as Launcher import "screenshot" as Screenshot -import "lock" as Lock +//import "lock" as Lock ShellRoot { - Bg {} + //Bg {} Bar.Bar { id: bar @@ -18,8 +18,8 @@ ShellRoot { } Component.onCompleted: () => { - Launcher.Controller.init(); + //Launcher.Controller.init(); Screenshot.Controller.init(); - Lock.Controller.init(); + //Lock.Controller.init(); } } diff --git a/todo b/todo index 0409d7e..ab7ccd0 100644 --- a/todo +++ b/todo @@ -20,3 +20,35 @@ maybe configure a bit ripgrep? majuscules things to do? deadnix and aljandra to clean up the repo + + + +with quickshell: + see all thoses waarnings and errors + set keybinds. for screenshot + fix screenshot (copy, write, etc.) + fix battery icon + fix player control icons + remove unnecessary stuff + + maybe modify some of the images (like the notification body) + do a full bar (no ugly empty space at top) + add brightness slider + maybe change sound icon by volume level + maybe incorpore the fast fourier transform code + + add some modules to see system stats + + maybe write some notification center + + battery dashboard https://www.reddit.com/r/hyprland/comments/1rkiajd/a_beautiful_battery_system_dashboard_on_hyprland/ + + some meteo center with dates, etc + + show name of the app + + make the connection tray prettier? Maybe with a full rewrite + + maybe some kind of overview? + + see what people did with quickshell and take inspiration