Skip to content

Commit 8aa0bf4

Browse files
committed
feat: add kscreen-doctor to screen off detection command
1 parent 2dbf5fb commit 8aa0bf4

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

package/contents/config/main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
</entry>
5959
<entry name="ScreenStateCmd" type="String">
6060
<label>Command/script to get the screen state should return 0 for Off and anything else for On state</label>
61-
<default>cat /sys/class/backlight/intel_backlight/actual_brightness</default>
61+
<default>cat /sys/class/backlight/intel_backlight/actual_brightness 2> /dev/null || kscreen-doctor --dpms show 2> /dev/null | head -n1 | awk '{print $NF}'</default>
6262
</entry>
6363
<entry name="CheckWindowsActiveScreen" type="Bool">
6464
<label>Whether or not check for windows from all screens instead of just the active one.</label>

package/contents/ui/config.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ ColumnLayout {
4848
property bool isLoading: false
4949
property alias cfg_ScreenOffPausesVideo: screenOffPausesVideoCheckbox.checked
5050
property alias cfg_ScreenStateCmd: screenStateCmdTextField.text
51+
property string cfg_ScreenStateCmdDefault
5152
property alias showWarningMessage: showWarning.checked
5253
property alias cfg_CheckWindowsActiveScreen: activeScreenOnlyCheckbx.checked
5354
property alias cfg_DebugEnabled: debugEnabledCheckbox.checked
@@ -791,7 +792,6 @@ ColumnLayout {
791792
CheckBox {
792793
id: screenOffPausesVideoCheckbox
793794
Kirigami.FormData.label: i18nd("plasma_wallpaper_luisbocanegra.smart.video.wallpaper.reborn", "Pause on screen off:")
794-
text: i18nd("plasma_wallpaper_luisbocanegra.smart.video.wallpaper.reborn", "Requires setting up command below!")
795795
visible: root.currentTab === 1
796796
}
797797

@@ -800,13 +800,13 @@ ColumnLayout {
800800
visible: screenOffPausesVideoCheckbox.checked && root.currentTab === 1
801801
TextField {
802802
id: screenStateCmdTextField
803-
placeholderText: i18nd("plasma_wallpaper_luisbocanegra.smart.video.wallpaper.reborn", "cat /sys/class/backlight/intel_backlight/actual_brightness")
803+
placeholderText: root.cfg_ScreenStateCmdDefault
804804
text: root.cfg_ScreenStateCmd
805805
Layout.maximumWidth: 300
806806
}
807807
Button {
808808
icon.name: "dialog-information-symbolic"
809-
ToolTip.text: i18nd("plasma_wallpaper_luisbocanegra.smart.video.wallpaper.reborn", "The command/script must return '0' (zero) or 'off' when the screen is Off")
809+
ToolTip.text: i18nd("plasma_wallpaper_luisbocanegra.smart.video.wallpaper.reborn", "The command/script must return '0' (zero) or 'off' when the screen is off")
810810
highlighted: true
811811
hoverEnabled: true
812812
flat: true

0 commit comments

Comments
 (0)