mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
unified SessionService to support elogind equivalents of systemd
commands
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
pragma ComponentBehavior
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
||||
@@ -9,7 +9,6 @@ import qs.Common
|
||||
import qs.Modals
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
pragma ComponentBehavior
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -966,8 +965,7 @@ Item {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
powerDialog.close()
|
||||
Quickshell.execDetached(
|
||||
["systemctl", "poweroff"])
|
||||
SessionService.poweroff()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1077,7 +1075,7 @@ Item {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
rebootDialog.close()
|
||||
Quickshell.execDetached(["systemctl", "reboot"])
|
||||
SessionService.reboot()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
pragma ComponentBehavior
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
pragma ComponentBehavior
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
|
||||
@@ -12,7 +12,7 @@ DankOSD {
|
||||
enableMouseInteraction: false
|
||||
|
||||
Connections {
|
||||
target: IdleInhibitorService
|
||||
target: SessionService
|
||||
function onInhibitorChanged() {
|
||||
root.show()
|
||||
}
|
||||
@@ -20,8 +20,8 @@ DankOSD {
|
||||
|
||||
content: DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: IdleInhibitorService.idleInhibited ? "motion_sensor_active" : "motion_sensor_idle"
|
||||
name: SessionService.idleInhibited ? "motion_sensor_active" : "motion_sensor_idle"
|
||||
size: Theme.iconSize
|
||||
color: IdleInhibitorService.idleInhibited ? Theme.primary : Theme.outline
|
||||
color: SessionService.idleInhibited ? Theme.primary : Theme.outline
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
pragma ComponentBehavior
|
||||
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Widgets
|
||||
|
||||
@@ -16,14 +16,14 @@ Rectangle {
|
||||
height: 30
|
||||
radius: Theme.cornerRadius
|
||||
color: {
|
||||
const baseColor = mouseArea.containsMouse ? Theme.primaryPressed : (IdleInhibitorService.idleInhibited ? Theme.primaryHover : Theme.secondaryHover)
|
||||
const baseColor = mouseArea.containsMouse ? Theme.primaryPressed : (SessionService.idleInhibited ? Theme.primaryHover : Theme.secondaryHover)
|
||||
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b,
|
||||
baseColor.a * Theme.widgetTransparency)
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: IdleInhibitorService.idleInhibited ? "motion_sensor_active" : "motion_sensor_idle"
|
||||
name: SessionService.idleInhibited ? "motion_sensor_active" : "motion_sensor_idle"
|
||||
size: Theme.iconSize - 6
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
@@ -36,7 +36,7 @@ Rectangle {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
onClicked: {
|
||||
IdleInhibitorService.toggleIdleInhibit()
|
||||
SessionService.toggleIdleInhibit()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user