diff --git a/.config/quickshell/modules/bar/UtilButtons.qml b/.config/quickshell/modules/bar/UtilButtons.qml index 64f24a0c..168e3e03 100644 --- a/.config/quickshell/modules/bar/UtilButtons.qml +++ b/.config/quickshell/modules/bar/UtilButtons.qml @@ -4,6 +4,7 @@ import QtQuick import QtQuick.Layouts import Quickshell import Quickshell.Io +import Quickshell.Hyprland Rectangle { Layout.alignment: Qt.AlignVCenter @@ -12,18 +13,6 @@ Rectangle { color: Appearance.colors.colLayer1 radius: Appearance.rounding.small - Process { - id: screenSnip - - command: ["grimblast", "copy", "area"] - } - - Process { - id: pickColor - - command: ["hyprpicker", "-a"] - } - RowLayout { id: rowLayout @@ -32,7 +21,7 @@ Rectangle { SmallCircleButton { Layout.alignment: Qt.AlignVCenter - onClicked: screenSnip.running = true + onClicked: Hyprland.dispatch("exec grimblast copy area") MaterialSymbol { anchors.centerIn: parent @@ -45,7 +34,7 @@ Rectangle { SmallCircleButton { Layout.alignment: Qt.AlignVCenter - onClicked: pickColor.running = true + onClicked: Hyprland.dispatch("exec hyprpicker -a") MaterialSymbol { anchors.centerIn: parent diff --git a/.config/quickshell/modules/common/widgets/NotificationWidget.qml b/.config/quickshell/modules/common/widgets/NotificationWidget.qml index 7dfcfd21..f912c9ce 100644 --- a/.config/quickshell/modules/common/widgets/NotificationWidget.qml +++ b/.config/quickshell/modules/common/widgets/NotificationWidget.qml @@ -24,11 +24,6 @@ Item { Layout.fillWidth: true clip: !popup - Process { - id: copyNotificationBody - command: ["bash", "-c", `wl-copy "${notificationObject.body}"`] - } - implicitHeight: ready ? notificationColumnLayout.implicitHeight + notificationListSpacing : 0 Behavior on implicitHeight { enabled: enableAnimation @@ -125,7 +120,7 @@ Item { } onPressAndHold: (mouse) => { if (mouse.button === Qt.LeftButton) { - copyNotificationBody.running = true + Hyprland.dispatch(`exec wl-copy '${notificationObject.body}'`) notificationSummaryText.text = `${notificationObject.summary} (copied)` } } @@ -531,7 +526,7 @@ Item { (contentItem.implicitWidth + leftPadding + rightPadding) onClicked: { - copyNotificationBody.running = true + Hyprland.dispatch(`exec wl-copy '${notificationObject.body}'`) copyIcon.text = "inventory" copyIconTimer.stop() copyIconTimer.start() diff --git a/.config/quickshell/modules/overview/SearchWidget.qml b/.config/quickshell/modules/overview/SearchWidget.qml index ab694f6f..5cd2338d 100644 --- a/.config/quickshell/modules/overview/SearchWidget.qml +++ b/.config/quickshell/modules/overview/SearchWidget.qml @@ -9,6 +9,7 @@ import QtQuick.Controls import QtQuick.Layouts import Quickshell import Quickshell.Io +import Quickshell.Hyprland Item { // Wrapper id: root @@ -85,16 +86,6 @@ Item { // Wrapper } } - Process { - id: copyText - property list baseCommand: ["wl-copy"] - function copyTextToClipboard(text) { - copyText.running = false - copyText.command = baseCommand.concat(text) - copyText.running = true - } - } - Process { id: webSearch property list baseCommand: ["xdg-open"] @@ -338,7 +329,7 @@ Item { // Wrapper fontType: "monospace", materialSymbol: 'calculate', execute: () => { - copyText.copyTextToClipboard(root.mathResult); + Hyprland.dispatch(`exec wl-copy '${root.mathResult}'`) } }); // Run command diff --git a/.config/quickshell/modules/sidebarRight/quickToggles/GameMode.qml b/.config/quickshell/modules/sidebarRight/quickToggles/GameMode.qml index 4818f0c4..1cd56acc 100644 --- a/.config/quickshell/modules/sidebarRight/quickToggles/GameMode.qml +++ b/.config/quickshell/modules/sidebarRight/quickToggles/GameMode.qml @@ -1,29 +1,25 @@ import "root:/modules/common" import "root:/modules/common/widgets" import "../" -import Quickshell.Io import Quickshell +import Quickshell.Io +import Quickshell.Hyprland QuickToggleButton { property bool enabled: false buttonIcon: "gamepad" toggled: enabled + onClicked: { enabled = !enabled if (enabled) { - gameModeOn.running = true + // gameModeOn.running = true + Hyprland.dispatch(`exec hyprctl --batch "keyword animations:enabled 0; keyword decoration:shadow:enabled 0; keyword decoration:blur:enabled 0; keyword general:gaps_in 0; keyword general:gaps_out 0; keyword general:border_size 1; keyword decoration:rounding 0; keyword general:allow_tearing 1"`) } else { - gameModeOff.running = true + Hyprland.dispatch("exec hyprctl reload") } } - Process { - id: gameModeOn - command: ['bash', '-c', `hyprctl --batch "keyword animations:enabled 0; keyword decoration:shadow:enabled 0; keyword decoration:blur:enabled 0; keyword general:gaps_in 0; keyword general:gaps_out 0; keyword general:border_size 1; keyword decoration:rounding 0; keyword general:allow_tearing 1"`] - } - Process { - id: gameModeOff - command: ['bash', '-c', `hyprctl reload`] - } + StyledToolTip { content: qsTr("Game mode") } diff --git a/.config/quickshell/services/Brightness.qml b/.config/quickshell/services/Brightness.qml index 742b5c5a..5911c5eb 100644 --- a/.config/quickshell/services/Brightness.qml +++ b/.config/quickshell/services/Brightness.qml @@ -1,7 +1,8 @@ -import Quickshell -import Quickshell.Io pragma Singleton pragma ComponentBehavior: Bound +import Quickshell +import Quickshell.Io +import Quickshell.Hyprland Singleton { id: root @@ -88,5 +89,4 @@ Singleton { root.increment = -1 } } - } diff --git a/.config/quickshell/services/Network.qml b/.config/quickshell/services/Network.qml index 1a840258..e790c39b 100644 --- a/.config/quickshell/services/Network.qml +++ b/.config/quickshell/services/Network.qml @@ -34,7 +34,6 @@ Singleton { stdout: SplitParser { onRead: data => { root.networkName = data - // console.log("Network: " + data); } } } @@ -46,7 +45,6 @@ Singleton { stdout: SplitParser { onRead: data => { root.networkStrength = parseInt(data); - // console.log("Network Strength: " + data); } } }