initial commit
This commit is contained in:
commit
9fde6d4fc6
27 changed files with 1110 additions and 0 deletions
31
modules/IdleInhibitor.qml
Normal file
31
modules/IdleInhibitor.qml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import "." as M
|
||||
|
||||
Text {
|
||||
id: root
|
||||
|
||||
property bool active: false
|
||||
|
||||
text: root.active ? "" : ""
|
||||
color: M.Theme.base05
|
||||
font.pixelSize: M.Theme.fontSize + 1
|
||||
font.family: M.Theme.fontFamily
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
Process {
|
||||
id: toggle
|
||||
command: ["sh", "-c", root.active
|
||||
? "pkill -x systemd-inhibit || true"
|
||||
: "systemd-inhibit --what=idle --who=nova-shell --why=user sleep infinity &"]
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
root.active = !root.active;
|
||||
toggle.running = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue