use hyprland global keybind dispatch for window toggling

This commit is contained in:
end-4
2025-04-27 23:06:22 +02:00
parent 4548000077
commit 9b0d769598
13 changed files with 134 additions and 111 deletions
@@ -2,9 +2,10 @@ import "root:/modules/common"
import "root:/modules/common/widgets"
import "root:/services"
import "../"
import Quickshell.Io
import Quickshell
import QtQuick
import Quickshell
import Quickshell.Io
import Quickshell.Hyprland
QuickToggleButton {
toggled: Network.networkName.length > 0 && Network.networkName != "lo"
@@ -23,17 +24,14 @@ QuickToggleButton {
toggleNetwork.running = true
}
if (mouse.button === Qt.RightButton) {
configureNetwork.running = true
Hyprland.dispatch(`exec ${ConfigOptions.apps.network}`)
Hyprland.dispatch("global quickshell:sidebarRightClose")
}
}
hoverEnabled: false
propagateComposedEvents: true
cursorShape: Qt.PointingHandCursor
}
Process {
id: configureNetwork
command: ["bash", "-c", `${ConfigOptions.apps.network} & qs ipc call sidebarRight close`]
}
Process {
id: toggleNetwork
command: ["bash", "-c", "nmcli radio wifi | grep -q enabled && nmcli radio wifi off || nmcli radio wifi on"]