forked from Shinonome/dots-hyprland
use hyprland global keybind dispatch for window toggling
This commit is contained in:
@@ -5,6 +5,7 @@ import QtQuick
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Hyprland
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import Quickshell.Services.Mpris
|
import Quickshell.Services.Mpris
|
||||||
|
|
||||||
@@ -15,27 +16,6 @@ Scope {
|
|||||||
readonly property int barCenterSideModuleWidth: Appearance.sizes.barCenterSideModuleWidth
|
readonly property int barCenterSideModuleWidth: Appearance.sizes.barCenterSideModuleWidth
|
||||||
readonly property int osdHideMouseMoveThreshold: 20
|
readonly property int osdHideMouseMoveThreshold: 20
|
||||||
|
|
||||||
Process {
|
|
||||||
id: openSidebarRight
|
|
||||||
command: ["qs", "ipc", "call", "sidebarRight", "open"]
|
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: openSidebarLeft
|
|
||||||
command: ["qs", "ipc", "call", "sidebarLeft", "open"]
|
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: hideOsdBrightness
|
|
||||||
command: ["qs", "ipc", "call", "osdBrightness", "hide"]
|
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: hideOsdVolume
|
|
||||||
command: ["qs", "ipc", "call", "osdVolume", "hide"]
|
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: toggleOverview
|
|
||||||
command: ["qs", "ipc", "call", "overview", "toggle"]
|
|
||||||
}
|
|
||||||
|
|
||||||
Variants { // For each monitor
|
Variants { // For each monitor
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
|
|
||||||
@@ -203,7 +183,7 @@ Scope {
|
|||||||
}
|
}
|
||||||
onPressed: (event) => {
|
onPressed: (event) => {
|
||||||
if (event.button === Qt.LeftButton) {
|
if (event.button === Qt.LeftButton) {
|
||||||
openSidebarLeft.running = true
|
Hyprland.dispatch('global quickshell:sidebarLeftOpen')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Scroll to change brightness
|
// Scroll to change brightness
|
||||||
@@ -225,7 +205,7 @@ Scope {
|
|||||||
const dx = mouse.x - barLeftSideMouseArea.lastScrollX;
|
const dx = mouse.x - barLeftSideMouseArea.lastScrollX;
|
||||||
const dy = mouse.y - barLeftSideMouseArea.lastScrollY;
|
const dy = mouse.y - barLeftSideMouseArea.lastScrollY;
|
||||||
if (Math.sqrt(dx*dx + dy*dy) > osdHideMouseMoveThreshold) {
|
if (Math.sqrt(dx*dx + dy*dy) > osdHideMouseMoveThreshold) {
|
||||||
hideOsdBrightness.running = true;
|
Hyprland.dispatch('global quickshell:osdBrightnessHide')
|
||||||
barLeftSideMouseArea.trackingScroll = false;
|
barLeftSideMouseArea.trackingScroll = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -239,7 +219,7 @@ Scope {
|
|||||||
|
|
||||||
onPressed: (event) => {
|
onPressed: (event) => {
|
||||||
if (event.button === Qt.RightButton) {
|
if (event.button === Qt.RightButton) {
|
||||||
toggleOverview.running = true;
|
Hyprland.dispatch('global quickshell:overviewToggle')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,7 +244,7 @@ Scope {
|
|||||||
}
|
}
|
||||||
onPressed: (event) => {
|
onPressed: (event) => {
|
||||||
if (event.button === Qt.LeftButton) {
|
if (event.button === Qt.LeftButton) {
|
||||||
openSidebarRight.running = true
|
Hyprland.dispatch('global quickshell:sidebarRightOpen')
|
||||||
}
|
}
|
||||||
else if (event.button === Qt.RightButton) {
|
else if (event.button === Qt.RightButton) {
|
||||||
MprisController.activePlayer.next()
|
MprisController.activePlayer.next()
|
||||||
@@ -291,7 +271,7 @@ Scope {
|
|||||||
const dx = mouse.x - barRightSideMouseArea.lastScrollX;
|
const dx = mouse.x - barRightSideMouseArea.lastScrollX;
|
||||||
const dy = mouse.y - barRightSideMouseArea.lastScrollY;
|
const dy = mouse.y - barRightSideMouseArea.lastScrollY;
|
||||||
if (Math.sqrt(dx*dx + dy*dy) > osdHideMouseMoveThreshold) {
|
if (Math.sqrt(dx*dx + dy*dy) > osdHideMouseMoveThreshold) {
|
||||||
hideOsdVolume.running = true;
|
Hyprland.dispatch('global quickshell:osdVolumeHide')
|
||||||
barRightSideMouseArea.trackingScroll = false;
|
barRightSideMouseArea.trackingScroll = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import QtQuick.Layouts
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
|
import Quickshell.Hyprland
|
||||||
import Quickshell.Services.Notifications
|
import Quickshell.Services.Notifications
|
||||||
import "./notification_utils.js" as NotificationUtils
|
import "./notification_utils.js" as NotificationUtils
|
||||||
|
|
||||||
@@ -23,11 +24,6 @@ Item {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
clip: !popup
|
clip: !popup
|
||||||
|
|
||||||
Process {
|
|
||||||
id: closeSidebarProcess
|
|
||||||
command: ["qs", "ipc", "call", "sidebarRight", "close"]
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: copyNotificationBody
|
id: copyNotificationBody
|
||||||
command: ["bash", "-c", `wl-copy "${notificationObject.body}"`]
|
command: ["bash", "-c", `wl-copy "${notificationObject.body}"`]
|
||||||
@@ -456,7 +452,7 @@ Item {
|
|||||||
: notificationObject.body.replace(/<img/g, "\n <img").split("\n")[0]
|
: notificationObject.body.replace(/<img/g, "\n <img").split("\n")[0]
|
||||||
onLinkActivated: {
|
onLinkActivated: {
|
||||||
Qt.openUrlExternally(link)
|
Qt.openUrlExternally(link)
|
||||||
closeSidebarProcess.running = true
|
Hyprland.dispatch("global quickshell:sidebarRightClose")
|
||||||
}
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
import Quickshell.Hyprland
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
|
|
||||||
Scope {
|
Scope {
|
||||||
@@ -122,4 +123,21 @@ Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GlobalShortcut {
|
||||||
|
name: "osdBrightnessTrigger"
|
||||||
|
description: "Triggers brightness OSD on press"
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
root.triggerOsd()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GlobalShortcut {
|
||||||
|
name: "osdBrightnessHide"
|
||||||
|
description: "Hides brightness OSD on press"
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
root.showOsdValues = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import QtQuick.Layouts
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
|
||||||
Scope {
|
Scope {
|
||||||
id: root
|
id: root
|
||||||
@@ -121,5 +122,21 @@ Scope {
|
|||||||
showOsdValues = !showOsdValues
|
showOsdValues = !showOsdValues
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
GlobalShortcut {
|
||||||
|
name: "osdVolumeTrigger"
|
||||||
|
description: "Triggers volume OSD on press"
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
root.triggerOsd()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GlobalShortcut {
|
||||||
|
name: "osdVolumeHide"
|
||||||
|
description: "Hides volume OSD on press"
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
root.showOsdValues = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,15 +21,16 @@ Scope {
|
|||||||
property var modelData
|
property var modelData
|
||||||
property string searchingText: ""
|
property string searchingText: ""
|
||||||
screen: modelData
|
screen: modelData
|
||||||
visible: GlobalStates.overviewOpen
|
// visible: GlobalStates.overviewOpen
|
||||||
|
visible: true
|
||||||
|
|
||||||
WlrLayershell.namespace: "quickshell:overview"
|
WlrLayershell.namespace: "quickshell:overview"
|
||||||
WlrLayershell.layer: WlrLayer.Overlay
|
WlrLayershell.layer: WlrLayer.Overlay
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
|
// WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
item: columnLayout
|
item: GlobalStates.overviewOpen ? columnLayout : null
|
||||||
}
|
}
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
@@ -69,6 +70,7 @@ Scope {
|
|||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: columnLayout
|
id: columnLayout
|
||||||
|
visible: GlobalStates.overviewOpen
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
Keys.onPressed: (event) => {
|
Keys.onPressed: (event) => {
|
||||||
@@ -125,6 +127,14 @@ Scope {
|
|||||||
GlobalStates.overviewOpen = !GlobalStates.overviewOpen
|
GlobalStates.overviewOpen = !GlobalStates.overviewOpen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
GlobalShortcut {
|
||||||
|
name: "overviewClose"
|
||||||
|
description: "Closes overview"
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
GlobalStates.overviewOpen = false
|
||||||
|
}
|
||||||
|
}
|
||||||
GlobalShortcut {
|
GlobalShortcut {
|
||||||
name: "overviewToggleRelease"
|
name: "overviewToggleRelease"
|
||||||
description: "Toggles overview on release"
|
description: "Toggles overview on release"
|
||||||
|
|||||||
@@ -42,11 +42,6 @@ Item {
|
|||||||
property Component windowComponent: OverviewWindow {}
|
property Component windowComponent: OverviewWindow {}
|
||||||
property list<OverviewWindow> windowWidgets: []
|
property list<OverviewWindow> windowWidgets: []
|
||||||
|
|
||||||
Process {
|
|
||||||
id: closeOverview
|
|
||||||
command: ["bash", "-c", "qs ipc call overview close &"] // Somehow has to be async to work?
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: overviewBackground
|
id: overviewBackground
|
||||||
|
|
||||||
@@ -91,7 +86,7 @@ Item {
|
|||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (root.draggingTargetWorkspace === -1) {
|
if (root.draggingTargetWorkspace === -1) {
|
||||||
closeOverview.running = true
|
Hyprland.dispatch(`global quickshell:overviewClose`)
|
||||||
Hyprland.dispatch(`workspace ${workspaceValue}`)
|
Hyprland.dispatch(`workspace ${workspaceValue}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -191,7 +186,7 @@ Item {
|
|||||||
if (!windowData) return;
|
if (!windowData) return;
|
||||||
|
|
||||||
if (event.button === Qt.LeftButton) {
|
if (event.button === Qt.LeftButton) {
|
||||||
closeOverview.running = true
|
Hyprland.dispatch(`global quickshell:overviewClose`)
|
||||||
Hyprland.dispatch(`workspace ${windowData.workspace.id}`)
|
Hyprland.dispatch(`workspace ${windowData.workspace.id}`)
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
} else if (event.button === Qt.MiddleButton) {
|
} else if (event.button === Qt.MiddleButton) {
|
||||||
|
|||||||
@@ -71,11 +71,6 @@ Rectangle { // Window
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
|
||||||
id: closeOverview
|
|
||||||
command: ["bash", "-c", "qs ipc call overview close &"] // Somehow has to by async to work?
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import QtQuick.Layouts
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: root
|
id: root
|
||||||
@@ -35,7 +36,7 @@ Button {
|
|||||||
PointingHandInteraction {}
|
PointingHandInteraction {}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.itemExecute()
|
root.itemExecute()
|
||||||
closeOverview.running = true
|
Hyprland.dispatch("global quickshell:overviewClose")
|
||||||
}
|
}
|
||||||
Keys.onPressed: (event) => {
|
Keys.onPressed: (event) => {
|
||||||
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
|
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
|
||||||
@@ -116,9 +117,4 @@ Button {
|
|||||||
text: root.itemClickActionName
|
text: root.itemClickActionName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
|
||||||
id: closeOverview
|
|
||||||
command: ["bash", "-c", "qs ipc call overview close &"] // Somehow has to be async to work?
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ Scope {
|
|||||||
focus: sessionRoot.visible
|
focus: sessionRoot.visible
|
||||||
buttonIcon: "lock"
|
buttonIcon: "lock"
|
||||||
buttonText: qsTr("Lock")
|
buttonText: qsTr("Lock")
|
||||||
onClicked: { lock.running = true; sessionRoot.visible = false }
|
onClicked: { Hyprland.dispatch("exec loginctl lock-session"); sessionRoot.visible = false }
|
||||||
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
||||||
KeyNavigation.right: sessionSleep
|
KeyNavigation.right: sessionSleep
|
||||||
KeyNavigation.down: sessionHibernate
|
KeyNavigation.down: sessionHibernate
|
||||||
@@ -120,7 +120,7 @@ Scope {
|
|||||||
id: sessionSleep
|
id: sessionSleep
|
||||||
buttonIcon: "dark_mode"
|
buttonIcon: "dark_mode"
|
||||||
buttonText: qsTr("Sleep")
|
buttonText: qsTr("Sleep")
|
||||||
onClicked: { sleep.running = true; sessionRoot.visible = false }
|
onClicked: { Hyprland.dispatch("exec systemctl suspend || loginctl suspend"); sessionRoot.visible = false }
|
||||||
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
||||||
KeyNavigation.left: sessionLock
|
KeyNavigation.left: sessionLock
|
||||||
KeyNavigation.right: sessionLogout
|
KeyNavigation.right: sessionLogout
|
||||||
@@ -130,7 +130,7 @@ Scope {
|
|||||||
id: sessionLogout
|
id: sessionLogout
|
||||||
buttonIcon: "logout"
|
buttonIcon: "logout"
|
||||||
buttonText: qsTr("Logout")
|
buttonText: qsTr("Logout")
|
||||||
onClicked: { logout.running = true; sessionRoot.visible = false }
|
onClicked: { Hyprland.dispatch("exec pkill Hyprland"); sessionRoot.visible = false }
|
||||||
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
||||||
KeyNavigation.left: sessionSleep
|
KeyNavigation.left: sessionSleep
|
||||||
KeyNavigation.right: sessionTaskManager
|
KeyNavigation.right: sessionTaskManager
|
||||||
@@ -140,7 +140,7 @@ Scope {
|
|||||||
id: sessionTaskManager
|
id: sessionTaskManager
|
||||||
buttonIcon: "browse_activity"
|
buttonIcon: "browse_activity"
|
||||||
buttonText: qsTr("Task Manager")
|
buttonText: qsTr("Task Manager")
|
||||||
onClicked: { taskManager.running = true; sessionRoot.visible = false }
|
onClicked: { Hyprland.dispatch("exec gnome-system-monitor & disown"); sessionRoot.visible = false }
|
||||||
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
||||||
KeyNavigation.left: sessionLogout
|
KeyNavigation.left: sessionLogout
|
||||||
KeyNavigation.down: sessionFirmwareReboot
|
KeyNavigation.down: sessionFirmwareReboot
|
||||||
@@ -153,7 +153,7 @@ Scope {
|
|||||||
id: sessionHibernate
|
id: sessionHibernate
|
||||||
buttonIcon: "downloading"
|
buttonIcon: "downloading"
|
||||||
buttonText: qsTr("Hibernate")
|
buttonText: qsTr("Hibernate")
|
||||||
onClicked: { hibernate.running = true; sessionRoot.visible = false }
|
onClicked: { Hyprland.dispatch("exec systemctl hibernate || loginctl hibernate"); sessionRoot.visible = false }
|
||||||
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
||||||
KeyNavigation.up: sessionLock
|
KeyNavigation.up: sessionLock
|
||||||
KeyNavigation.right: sessionShutdown
|
KeyNavigation.right: sessionShutdown
|
||||||
@@ -162,7 +162,7 @@ Scope {
|
|||||||
id: sessionShutdown
|
id: sessionShutdown
|
||||||
buttonIcon: "power_settings_new"
|
buttonIcon: "power_settings_new"
|
||||||
buttonText: qsTr("Shutdown")
|
buttonText: qsTr("Shutdown")
|
||||||
onClicked: { shutdown.running = true; sessionRoot.visible = false }
|
onClicked: { Hyprland.dispatch("exec systemctl poweroff || loginctl poweroff"); sessionRoot.visible = false }
|
||||||
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
||||||
KeyNavigation.left: sessionHibernate
|
KeyNavigation.left: sessionHibernate
|
||||||
KeyNavigation.right: sessionReboot
|
KeyNavigation.right: sessionReboot
|
||||||
@@ -172,7 +172,7 @@ Scope {
|
|||||||
id: sessionReboot
|
id: sessionReboot
|
||||||
buttonIcon: "restart_alt"
|
buttonIcon: "restart_alt"
|
||||||
buttonText: qsTr("Reboot")
|
buttonText: qsTr("Reboot")
|
||||||
onClicked: { reboot.running = true; sessionRoot.visible = false }
|
onClicked: { Hyprland.dispatch("exec reboot || loginctl reboot"); sessionRoot.visible = false }
|
||||||
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
||||||
KeyNavigation.left: sessionShutdown
|
KeyNavigation.left: sessionShutdown
|
||||||
KeyNavigation.right: sessionFirmwareReboot
|
KeyNavigation.right: sessionFirmwareReboot
|
||||||
@@ -182,7 +182,7 @@ Scope {
|
|||||||
id: sessionFirmwareReboot
|
id: sessionFirmwareReboot
|
||||||
buttonIcon: "settings_applications"
|
buttonIcon: "settings_applications"
|
||||||
buttonText: qsTr("Reboot to firmware settings")
|
buttonText: qsTr("Reboot to firmware settings")
|
||||||
onClicked: { firmwareReboot.running = true; sessionRoot.visible = false }
|
onClicked: { Hyprland.dispatch("exec systemctl reboot --firmware-setup || loginctl reboot --firmware-setup"); sessionRoot.visible = false }
|
||||||
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
|
||||||
KeyNavigation.up: sessionTaskManager
|
KeyNavigation.up: sessionTaskManager
|
||||||
KeyNavigation.left: sessionReboot
|
KeyNavigation.left: sessionReboot
|
||||||
@@ -216,39 +216,6 @@ Scope {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
|
||||||
id: lock
|
|
||||||
command: ["bash", "-c", "loginctl lock-session"]
|
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: sleep
|
|
||||||
command: ["bash", "-c", "systemctl suspend || loginctl suspend"]
|
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: logout
|
|
||||||
command: ["bash", "-c", "pkill Hyprland"] // loginctl terminate-session hangs SDDM
|
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: hibernate
|
|
||||||
command: ["bash", "-c", "systemctl hibernate || loginctl hibernate"]
|
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: shutdown
|
|
||||||
command: ["bash", "-c", "systemctl poweroff || loginctl poweroff"]
|
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: reboot
|
|
||||||
command: ["bash", "-c", "systemctl reboot || loginctl reboot"]
|
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: firmwareReboot
|
|
||||||
command: ["bash", "-c", "systemctl reboot --firmware-setup || loginctl reboot --firmware-setup"]
|
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: taskManager
|
|
||||||
command: ["bash", "-c", "gnome-system-monitor & disown"]
|
|
||||||
}
|
|
||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
target: "session"
|
target: "session"
|
||||||
|
|
||||||
@@ -293,5 +260,18 @@ Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
GlobalShortcut {
|
||||||
|
name: "sessionOpen"
|
||||||
|
description: "Opens session screen on press"
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
for (let i = 0; i < sessionVariants.instances.length; i++) {
|
||||||
|
let panelWindow = sessionVariants.instances[i];
|
||||||
|
if (panelWindow.modelData.name == Hyprland.focusedMonitor.name) {
|
||||||
|
panelWindow.visible = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,4 +203,19 @@ Scope { // Scope
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GlobalShortcut {
|
||||||
|
name: "sidebarLeftOpen"
|
||||||
|
description: "Opens left 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,11 +130,7 @@ Scope {
|
|||||||
toggled: false
|
toggled: false
|
||||||
buttonIcon: "power_settings_new"
|
buttonIcon: "power_settings_new"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
openSessionMenu.running = true
|
Hyprland.dispatch("global quickshell:sessionOpen")
|
||||||
}
|
|
||||||
Process {
|
|
||||||
id: openSessionMenu
|
|
||||||
command: ["qs", "ipc", "call", "session", "open"]
|
|
||||||
}
|
}
|
||||||
StyledToolTip {
|
StyledToolTip {
|
||||||
content: qsTr("Session")
|
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 QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
|
||||||
QuickToggleButton {
|
QuickToggleButton {
|
||||||
toggled: Bluetooth.bluetoothEnabled
|
toggled: Bluetooth.bluetoothEnabled
|
||||||
@@ -17,17 +18,15 @@ QuickToggleButton {
|
|||||||
toggleBluetooth.running = true
|
toggleBluetooth.running = true
|
||||||
}
|
}
|
||||||
if (mouse.button === Qt.RightButton) {
|
if (mouse.button === Qt.RightButton) {
|
||||||
configureBluetooth.running = true
|
Hyprland.dispatch(`exec ${ConfigOptions.apps.bluetooth}`)
|
||||||
|
Hyprland.dispatch("global quickshell:sidebarRightClose")
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hoverEnabled: false
|
hoverEnabled: false
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
}
|
}
|
||||||
Process {
|
|
||||||
id: configureBluetooth
|
|
||||||
command: ["bash", "-c", `${ConfigOptions.apps.bluetooth} & qs ipc call sidebarRight close`]
|
|
||||||
}
|
|
||||||
Process {
|
Process {
|
||||||
id: toggleBluetooth
|
id: toggleBluetooth
|
||||||
command: ["bash", "-c", `bluetoothctl power ${Bluetooth.bluetoothEnabled ? "off" : "on"}`]
|
command: ["bash", "-c", `bluetoothctl power ${Bluetooth.bluetoothEnabled ? "off" : "on"}`]
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ import "root:/modules/common"
|
|||||||
import "root:/modules/common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import "root:/services"
|
import "root:/services"
|
||||||
import "../"
|
import "../"
|
||||||
import Quickshell.Io
|
|
||||||
import Quickshell
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
|
||||||
QuickToggleButton {
|
QuickToggleButton {
|
||||||
toggled: Network.networkName.length > 0 && Network.networkName != "lo"
|
toggled: Network.networkName.length > 0 && Network.networkName != "lo"
|
||||||
@@ -23,17 +24,14 @@ QuickToggleButton {
|
|||||||
toggleNetwork.running = true
|
toggleNetwork.running = true
|
||||||
}
|
}
|
||||||
if (mouse.button === Qt.RightButton) {
|
if (mouse.button === Qt.RightButton) {
|
||||||
configureNetwork.running = true
|
Hyprland.dispatch(`exec ${ConfigOptions.apps.network}`)
|
||||||
|
Hyprland.dispatch("global quickshell:sidebarRightClose")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hoverEnabled: false
|
hoverEnabled: false
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
}
|
}
|
||||||
Process {
|
|
||||||
id: configureNetwork
|
|
||||||
command: ["bash", "-c", `${ConfigOptions.apps.network} & qs ipc call sidebarRight close`]
|
|
||||||
}
|
|
||||||
Process {
|
Process {
|
||||||
id: toggleNetwork
|
id: toggleNetwork
|
||||||
command: ["bash", "-c", "nmcli radio wifi | grep -q enabled && nmcli radio wifi off || nmcli radio wifi on"]
|
command: ["bash", "-c", "nmcli radio wifi | grep -q enabled && nmcli radio wifi off || nmcli radio wifi on"]
|
||||||
|
|||||||
Reference in New Issue
Block a user