Browse Source

Updated to brightness signal

sisyphus
JezerM 4 years ago
parent
commit
cc6db0a9d4
  1. 3
      themes/gruvbox/js/brightness.js
  2. 10
      themes/gruvbox/js/debug.js
  3. 9
      themes/gruvbox/js/index.js

3
themes/gruvbox/js/brightness.js vendored

@ -20,9 +20,6 @@ class Brightness {
_setTimer() { _setTimer() {
if (!lightdm.can_access_brightness) return if (!lightdm.can_access_brightness) return
this._updateData() this._updateData()
setInterval(() => {
this._updateData()
}, 1000) // Every second
} }

10
themes/gruvbox/js/debug.js vendored

@ -12,6 +12,12 @@ class Debug {
return false return false
} }
window.greeter_config = {
greeter: {
debug_mode: true,
}
}
window.lightdm = { window.lightdm = {
is_authenticated: false, is_authenticated: false,
authentication_user: null, authentication_user: null,
@ -85,15 +91,19 @@ class Debug {
}, },
shutdown: () => { shutdown: () => {
console.log("System is shutting down...") console.log("System is shutting down...")
setTimeout(() => location.reload(), 2000)
}, },
restart: () => { restart: () => {
console.log("System is rebooting...") console.log("System is rebooting...")
setTimeout(() => location.reload(), 2000)
}, },
hibernate: () => { hibernate: () => {
console.log("System is hibernating") console.log("System is hibernating")
setTimeout(() => location.reload(), 2000)
}, },
suspend: () => { suspend: () => {
console.log("System is suspending") console.log("System is suspending")
setTimeout(() => location.reload(), 2000)
}, },
batteryData: { batteryData: {
name: "Battery 0", name: "Battery 0",

9
themes/gruvbox/js/index.js vendored

@ -19,12 +19,17 @@ async function wait(ms) {
} }
async function initGreeter() { async function initGreeter() {
if (greeter_config.greeter.debug_mode) {
debug = new Debug()
}
if (lightdm.authentication_complete) { if (lightdm.authentication_complete) {
lightdm.authentication_complete.connect(() => authentication_done()) lightdm.authentication_complete.connect(() => authentication_done())
} }
if (greeter_config.greeter.debug_mode) { if (lightdm.brightness_update) {
debug = new Debug() lightdm.brightness_update.connect(() => brightness._updateData())
} }
accounts = new Accounts() accounts = new Accounts()

Loading…
Cancel
Save