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() {
if (!lightdm.can_access_brightness) return
this._updateData()
setInterval(() => {
this._updateData()
}, 1000) // Every second
}

10
themes/gruvbox/js/debug.js vendored

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

9
themes/gruvbox/js/index.js vendored

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

Loading…
Cancel
Save