[AGS] Bar: BT, Audio, SysInfo, Brightness
This commit is contained in:
@@ -12,7 +12,7 @@ export default class Brightness extends GObject.Object {
|
||||
static get_default() {
|
||||
if (!this.instance)
|
||||
this.instance = new Brightness()
|
||||
|
||||
|
||||
return this.instance
|
||||
}
|
||||
|
||||
@@ -20,6 +20,10 @@ export default class Brightness extends GObject.Object {
|
||||
#kbd = get(`--device ${kbd} get`)
|
||||
#screenMax = get("max")
|
||||
#screen = get("get") / (get("max") || 1)
|
||||
#screenAvailable = false
|
||||
|
||||
@property(Boolean)
|
||||
get screenAvailable() { return this.#screenAvailable }
|
||||
|
||||
@property(Number)
|
||||
get kbd() { return this.#kbd }
|
||||
@@ -67,5 +71,12 @@ export default class Brightness extends GObject.Object {
|
||||
this.#kbd = Number(v) / this.#kbdMax
|
||||
this.notify("kbd")
|
||||
})
|
||||
|
||||
// Check if there is a screen available
|
||||
try {
|
||||
get( 'g -c backlight' );
|
||||
} catch ( _ ) {
|
||||
this.#screenAvailable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user