forked from Shinonome/dots-hyprland
ags: sync
- remove laggy keyframe on init - show volume on mute - more tree compositor compatibility
This commit is contained in:
@@ -114,11 +114,14 @@ const distroAndVersion = Box({
|
||||
Label({
|
||||
className: 'bg-distro-name',
|
||||
xalign: 0,
|
||||
label: '<version>',
|
||||
label: 'An environment idk',
|
||||
setup: (label) => {
|
||||
execAsync([`bash`, `-c`, `hyprctl version | grep -oP "Tag: v\\K\\d+\\.\\d+\\.\\d+"`]).then(distro => {
|
||||
label.label = `Hyprland ${distro}`;
|
||||
}).catch(print);
|
||||
// hyprctl will return unsuccessfully if Hyprland isn't running
|
||||
execAsync([`bash`, `-c`, `hyprctl version | grep -oP "Tag: v\\K\\d+\\.\\d+\\.\\d+"`]).then(version => {
|
||||
label.label = `Hyprland ${version}`;
|
||||
}).catch(() => execAsync([`bash`, `-c`, `sway -v | cut -d'-' -f1 | sed 's/sway version /v/'`]).then(version => {
|
||||
label.label = `Sway ${version}`;
|
||||
}).catch(print));
|
||||
},
|
||||
}),
|
||||
]
|
||||
|
||||
@@ -6,34 +6,43 @@ import { MarginRevealer } from '../../lib/advancedwidgets.js';
|
||||
import Brightness from '../../services/brightness.js';
|
||||
import Indicator from '../../services/indicator.js';
|
||||
|
||||
const OsdValue = (name, labelSetup, progressSetup, props = {}) => Box({ // Volume
|
||||
...props,
|
||||
vertical: true,
|
||||
className: 'osd-bg osd-value',
|
||||
hexpand: true,
|
||||
children: [
|
||||
Box({
|
||||
vexpand: true,
|
||||
children: [
|
||||
Label({
|
||||
xalign: 0, yalign: 0, hexpand: true,
|
||||
className: 'osd-label',
|
||||
label: `${name}`,
|
||||
}),
|
||||
Label({
|
||||
hexpand: false, className: 'osd-value-txt',
|
||||
setup: labelSetup,
|
||||
}),
|
||||
]
|
||||
}),
|
||||
ProgressBar({
|
||||
className: 'osd-progress',
|
||||
hexpand: true,
|
||||
vertical: false,
|
||||
setup: progressSetup,
|
||||
})
|
||||
],
|
||||
});
|
||||
const OsdValue = (name, labelSetup, progressSetup, props = {}) => {
|
||||
const valueName = Label({
|
||||
xalign: 0, yalign: 0, hexpand: true,
|
||||
className: 'osd-label',
|
||||
label: `${name}`,
|
||||
});
|
||||
const valueNumber =Label({
|
||||
hexpand: false, className: 'osd-value-txt',
|
||||
setup: labelSetup,
|
||||
});
|
||||
return Box({ // Volume
|
||||
...props,
|
||||
vertical: true,
|
||||
hexpand: true,
|
||||
className: 'osd-bg osd-value',
|
||||
attribute: {
|
||||
'disable': () => {
|
||||
valueNumber.label = '';
|
||||
}
|
||||
},
|
||||
children: [
|
||||
Box({
|
||||
vexpand: true,
|
||||
children: [
|
||||
valueName,
|
||||
valueNumber,
|
||||
]
|
||||
}),
|
||||
ProgressBar({
|
||||
className: 'osd-progress',
|
||||
hexpand: true,
|
||||
vertical: false,
|
||||
setup: progressSetup,
|
||||
})
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
const brightnessIndicator = OsdValue('Brightness',
|
||||
(self) => self
|
||||
|
||||
Reference in New Issue
Block a user