forked from Shinonome/dots-hyprland
use hyprland global keybind dispatch for window toggling
This commit is contained in:
@@ -130,11 +130,7 @@ Scope {
|
||||
toggled: false
|
||||
buttonIcon: "power_settings_new"
|
||||
onClicked: {
|
||||
openSessionMenu.running = true
|
||||
}
|
||||
Process {
|
||||
id: openSessionMenu
|
||||
command: ["qs", "ipc", "call", "session", "open"]
|
||||
Hyprland.dispatch("global quickshell:sessionOpen")
|
||||
}
|
||||
StyledToolTip {
|
||||
content: qsTr("Session")
|
||||
@@ -245,5 +241,33 @@ Scope {
|
||||
}
|
||||
}
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "sidebarRightOpen"
|
||||
description: "Opens right sidebar on press"
|
||||
|
||||
onPressed: {
|
||||
for (let i = 0; i < sidebarVariants.instances.length; i++) {
|
||||
let panelWindow = sidebarVariants.instances[i];
|
||||
if (panelWindow.modelData.name == Hyprland.focusedMonitor.name) {
|
||||
panelWindow.visible = true;
|
||||
if(panelWindow.visible) Notifications.timeoutAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "sidebarRightClose"
|
||||
description: "Closes right sidebar on press"
|
||||
|
||||
onPressed: {
|
||||
for (let i = 0; i < sidebarVariants.instances.length; i++) {
|
||||
let panelWindow = sidebarVariants.instances[i];
|
||||
if (panelWindow.modelData.name == Hyprland.focusedMonitor.name) {
|
||||
panelWindow.visible = false;
|
||||
if(panelWindow.visible) Notifications.timeoutAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import "root:/modules/common/widgets"
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Hyprland
|
||||
|
||||
QuickToggleButton {
|
||||
toggled: Bluetooth.bluetoothEnabled
|
||||
@@ -17,17 +18,15 @@ QuickToggleButton {
|
||||
toggleBluetooth.running = true
|
||||
}
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
configureBluetooth.running = true
|
||||
Hyprland.dispatch(`exec ${ConfigOptions.apps.bluetooth}`)
|
||||
Hyprland.dispatch("global quickshell:sidebarRightClose")
|
||||
|
||||
}
|
||||
}
|
||||
hoverEnabled: false
|
||||
propagateComposedEvents: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
Process {
|
||||
id: configureBluetooth
|
||||
command: ["bash", "-c", `${ConfigOptions.apps.bluetooth} & qs ipc call sidebarRight close`]
|
||||
}
|
||||
Process {
|
||||
id: toggleBluetooth
|
||||
command: ["bash", "-c", `bluetoothctl power ${Bluetooth.bluetoothEnabled ? "off" : "on"}`]
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user