feat: keep awake bar widget

This commit is contained in:
Kainoa Kanter 2025-09-04 12:15:19 -07:00
parent 5f1f3dce4a
commit dcf146a097
No known key found for this signature in database
GPG key ID: 8703CACD01000000
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,24 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import qs.Commons
import qs.Services
import qs.Widgets
NIconButton {
id: root
property ShellScreen screen
property real scaling: 1.0
sizeRatio: 0.8
icon: "coffee"
tooltipText: IdleInhibitorService.isInhibited ? "Disable keep awake" : "Enable keep awake"
colorBg: Color.mSurfaceVariant
colorFg: IdleInhibitorService.isInhibited ? Color.mPrimary : Color.mOnSurface
colorBorder: Color.transparent
onClicked: {
IdleInhibitorService.manualToggle()
}
}

View file

@ -18,6 +18,7 @@ Singleton {
"Clock": clockComponent,
"CustomButton": customButtonComponent,
"DarkModeToggle": darkModeToggle,
"KeepAwake": keepAwakeComponent,
"KeyboardLayout": keyboardLayoutComponent,
"MediaMini": mediaMiniComponent,
"Microphone": microphoneComponent,
@ -72,6 +73,9 @@ Singleton {
property Component keyboardLayoutComponent: Component {
KeyboardLayout {}
}
property Component keepAwakeComponent: Component {
KeepAwake {}
}
property Component mediaMiniComponent: Component {
MediaMini {}
}