diff options
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml')
| -rw-r--r-- | accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml b/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml index 8318df50..52103c6f 100644 --- a/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml +++ b/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml | |||
| @@ -4,6 +4,7 @@ import QtQml | |||
| 4 | import Quickshell | 4 | import Quickshell |
| 5 | import Quickshell.Io | 5 | import Quickshell.Io |
| 6 | import Custom as Custom | 6 | import Custom as Custom |
| 7 | import qs.Services | ||
| 7 | 8 | ||
| 8 | Singleton { | 9 | Singleton { |
| 9 | id: root | 10 | id: root |
| @@ -72,4 +73,24 @@ Singleton { | |||
| 72 | watchChanges: true | 73 | watchChanges: true |
| 73 | onFileChanged: reload() | 74 | onFileChanged: reload() |
| 74 | } | 75 | } |
| 76 | |||
| 77 | |||
| 78 | Timer { | ||
| 79 | id: startupDelay | ||
| 80 | interval: 500 | ||
| 81 | running: true | ||
| 82 | repeat: false | ||
| 83 | } | ||
| 84 | property bool onlyInternal: true | ||
| 85 | Connections { | ||
| 86 | target: NiriService | ||
| 87 | onOutputsChanged: root.onlyInternal = Object.keys(NiriService.outputs).every(oname => oname == "eDP-1") | ||
| 88 | } | ||
| 89 | onOnlyInternalChanged: { | ||
| 90 | if (startupDelay.running) | ||
| 91 | return; | ||
| 92 | |||
| 93 | if (!root.onlyInternal) | ||
| 94 | root.currBrightness = 1 | ||
| 95 | } | ||
| 75 | } | 96 | } |
