From 57d9f9a72e7dd9b86839f853b169c5beb8488a8f Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Wed, 8 May 2024 16:01:19 -0700 Subject: [PATCH] Add dpms button to lockscreen --- modules/hyprland/hyprland.conf | 1 + .../quickshell/lockscreen/Lockscreen.qml | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/modules/hyprland/hyprland.conf b/modules/hyprland/hyprland.conf index 566ce4c..578181f 100644 --- a/modules/hyprland/hyprland.conf +++ b/modules/hyprland/hyprland.conf @@ -64,6 +64,7 @@ misc { disable_splash_rendering = true vrr = 1 no_direct_scanout = false + key_press_enables_dpms = true } binds { diff --git a/modules/user/modules/quickshell/lockscreen/Lockscreen.qml b/modules/user/modules/quickshell/lockscreen/Lockscreen.qml index b21cb18..4b258d0 100644 --- a/modules/user/modules/quickshell/lockscreen/Lockscreen.qml +++ b/modules/user/modules/quickshell/lockscreen/Lockscreen.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Controls.Basic +import Quickshell.Io Item { required property AuthContext context @@ -101,4 +102,30 @@ Item { } } } + + Button { + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.bottom + bottomMargin: 20 + } + + contentItem: Text { + text: "Turn off Monitors" + color: "#aaeeffff" + } + + onClicked: dpms.running = true + + background: Rectangle { + color: "#20ffffff" + border.color: "#30ffffff" + radius: height / 2 + } + + Process { + id: dpms + command: [ "hyprctl", "dispatch", "dpms" ] + } + } }