feat(ags binto): add OSD
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
2a9ea9a4e9
commit
b95ea7dde0
4 changed files with 50 additions and 7 deletions
|
@ -3,10 +3,11 @@ import Pointers from './services/pointers.ts';
|
||||||
import AppLauncher from './ts/applauncher/main.ts';
|
import AppLauncher from './ts/applauncher/main.ts';
|
||||||
import Bar from './ts/bar/binto.ts';
|
import Bar from './ts/bar/binto.ts';
|
||||||
import { NotifPopups, NotifCenter } from './ts/notifications/binto.ts';
|
import { NotifPopups, NotifCenter } from './ts/notifications/binto.ts';
|
||||||
|
import OSD from './ts/osd/main.ts';
|
||||||
import Powermenu from './ts/powermenu.ts';
|
import Powermenu from './ts/powermenu.ts';
|
||||||
|
|
||||||
|
|
||||||
// TODO: add OSD, workspace indicator and current window indicator
|
// TODO: add workspace indicator and current window indicator
|
||||||
App.config({
|
App.config({
|
||||||
icons: './icons',
|
icons: './icons',
|
||||||
|
|
||||||
|
@ -21,5 +22,6 @@ App.config({
|
||||||
|
|
||||||
Bar(),
|
Bar(),
|
||||||
NotifPopups(),
|
NotifPopups(),
|
||||||
|
OSD(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
40
modules/ags/config/scss/binto-widgets/osd.scss
Normal file
40
modules/ags/config/scss/binto-widgets/osd.scss
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
.osd {
|
||||||
|
padding: 12px 20px;
|
||||||
|
background: rgba(40, 42, 54, 0.8);
|
||||||
|
border: 2px solid $contrast-bg;
|
||||||
|
|
||||||
|
label {
|
||||||
|
min-width: 170px;
|
||||||
|
}
|
||||||
|
|
||||||
|
progressbar:disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
progressbar {
|
||||||
|
min-height: 6px;
|
||||||
|
min-width: 170px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
trough {
|
||||||
|
background: #363847;
|
||||||
|
min-height: inherit;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
progress {
|
||||||
|
background: #79659f;
|
||||||
|
min-height: inherit;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
image {
|
||||||
|
font-size: 2rem;
|
||||||
|
color: white;
|
||||||
|
margin-left: -0.4rem;
|
||||||
|
margin-right: 0.8rem;
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,4 +13,5 @@ undershoot {
|
||||||
@import './binto-widgets/bar';
|
@import './binto-widgets/bar';
|
||||||
@import './binto-widgets/notification';
|
@import './binto-widgets/notification';
|
||||||
@import './binto-widgets/notification-center';
|
@import './binto-widgets/notification-center';
|
||||||
|
@import './binto-widgets/osd';
|
||||||
@import './binto-widgets/powermenu';
|
@import './binto-widgets/powermenu';
|
||||||
|
|
|
@ -121,10 +121,8 @@ class Brightness extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
#monitorKbdState() {
|
#monitorKbdState() {
|
||||||
Variable(0, {
|
const interval = setInterval(() => {
|
||||||
poll: [
|
execAsync(`brightnessctl -d ${KBD} g`).then(
|
||||||
INTERVAL,
|
|
||||||
`brightnessctl -d ${KBD} g`,
|
|
||||||
(out) => {
|
(out) => {
|
||||||
if (parseInt(out) !== this.#kbd) {
|
if (parseInt(out) !== this.#kbd) {
|
||||||
this.#kbd = parseInt(out);
|
this.#kbd = parseInt(out);
|
||||||
|
@ -133,8 +131,10 @@ class Brightness extends Service {
|
||||||
return this.#kbd;
|
return this.#kbd;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
],
|
).catch(() => {
|
||||||
|
interval.destroy();
|
||||||
});
|
});
|
||||||
|
}, INTERVAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue