fixed a lot of quickshell problems

This commit is contained in:
Tomas Rivera
2026-03-10 18:38:32 +01:00
parent b9e3f35abe
commit 25dc8507b8
16 changed files with 145 additions and 32 deletions
+2 -2
View File
@@ -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;
}
}*/
}
+2 -2
View File
@@ -91,7 +91,7 @@ PanelWindow {
spacing: 12
Launcher {}
//Launcher {}
Workspaces {
bar: root
@@ -154,7 +154,7 @@ PanelWindow {
bar: root
}
Theme {}
//Theme {}
Power {
id: power
+36 -1
View File
@@ -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 }
}
}
}
+1 -1
View File
@@ -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
+2 -1
View File
@@ -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
+1 -1
View File
@@ -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
+6 -3
View File
@@ -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()
+20 -5
View File
@@ -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)
}
}
+19 -2
View File
@@ -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"
}
}
}
}
+4 -2
View File
@@ -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()
}
+10 -3
View File
@@ -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);
}
}
}
}
+5 -5
View File
@@ -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();
}
}