ags: sync

- remove laggy keyframe on init
- show volume on mute
- more tree compositor compatibility
This commit is contained in:
end-4 2024-01-14 02:39:34 +07:00
parent 1d0b1e8546
commit fa0dacb496
5 changed files with 66 additions and 56 deletions

View file

@ -32,9 +32,7 @@ $bar_subgroup_bg: $surfaceVariant;
}
.bar-group-pad {
// padding: 0rem 1.023rem;
padding: 0.205rem;
// padding-left: 0.341rem;
}
.bar-group-pad-less {

View file

@ -1,25 +1,3 @@
@keyframes flyin-top {
from {
margin-top: -2.795rem;
}
to {
margin-top: 0rem;
}
}
@keyframes flyin-bottom {
from {
margin-top: 4.841rem;
margin-bottom: -4.841rem;
}
to {
margin-bottom: 0rem;
margin-top: 0rem;
}
}
.test {
background-image: linear-gradient(
45deg, #f4d609 0%, #f4d609 10%, #212121 10%, #212121 20%, #f4d609 20%, #f4d609 30%, #212121 30%,

View file

@ -100,6 +100,28 @@ $elevation_margin: 0.476rem;
margin: $elevation_margin;
}
@keyframes flyin-top {
from {
margin-top: -2.795rem;
}
to {
margin-top: 0rem;
}
}
@keyframes flyin-bottom {
from {
margin-top: 4.841rem;
margin-bottom: -4.841rem;
}
to {
margin-bottom: 0rem;
margin-top: 0rem;
}
}
@mixin menu_decel {
transition: 300ms cubic-bezier(0.1, 1, 0, 1);
}

View file

@ -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));
},
}),
]

View file

@ -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