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 { .bar-group-pad {
// padding: 0rem 1.023rem;
padding: 0.205rem; padding: 0.205rem;
// padding-left: 0.341rem;
} }
.bar-group-pad-less { .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 { .test {
background-image: linear-gradient( background-image: linear-gradient(
45deg, #f4d609 0%, #f4d609 10%, #212121 10%, #212121 20%, #f4d609 20%, #f4d609 30%, #212121 30%, 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; 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 { @mixin menu_decel {
transition: 300ms cubic-bezier(0.1, 1, 0, 1); transition: 300ms cubic-bezier(0.1, 1, 0, 1);
} }

View file

@ -114,11 +114,14 @@ const distroAndVersion = Box({
Label({ Label({
className: 'bg-distro-name', className: 'bg-distro-name',
xalign: 0, xalign: 0,
label: '<version>', label: 'An environment idk',
setup: (label) => { setup: (label) => {
execAsync([`bash`, `-c`, `hyprctl version | grep -oP "Tag: v\\K\\d+\\.\\d+\\.\\d+"`]).then(distro => { // hyprctl will return unsuccessfully if Hyprland isn't running
label.label = `Hyprland ${distro}`; execAsync([`bash`, `-c`, `hyprctl version | grep -oP "Tag: v\\K\\d+\\.\\d+\\.\\d+"`]).then(version => {
}).catch(print); 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 Brightness from '../../services/brightness.js';
import Indicator from '../../services/indicator.js'; import Indicator from '../../services/indicator.js';
const OsdValue = (name, labelSetup, progressSetup, props = {}) => Box({ // Volume const OsdValue = (name, labelSetup, progressSetup, props = {}) => {
...props, const valueName = Label({
vertical: true, xalign: 0, yalign: 0, hexpand: true,
className: 'osd-bg osd-value', className: 'osd-label',
hexpand: true, label: `${name}`,
children: [ });
Box({ const valueNumber =Label({
vexpand: true, hexpand: false, className: 'osd-value-txt',
children: [ setup: labelSetup,
Label({ });
xalign: 0, yalign: 0, hexpand: true, return Box({ // Volume
className: 'osd-label', ...props,
label: `${name}`, vertical: true,
}), hexpand: true,
Label({ className: 'osd-bg osd-value',
hexpand: false, className: 'osd-value-txt', attribute: {
setup: labelSetup, 'disable': () => {
}), valueNumber.label = '󰖭';
] }
}), },
ProgressBar({ children: [
className: 'osd-progress', Box({
hexpand: true, vexpand: true,
vertical: false, children: [
setup: progressSetup, valueName,
}) valueNumber,
], ]
}); }),
ProgressBar({
className: 'osd-progress',
hexpand: true,
vertical: false,
setup: progressSetup,
})
],
});
}
const brightnessIndicator = OsdValue('Brightness', const brightnessIndicator = OsdValue('Brightness',
(self) => self (self) => self