asta.nix/windows/Bar/components/Volume.tsx
Chris Toph 8746fa0a6e Adds brightness control & biome config
• Updates IDE settings for improved file nesting and exclusions
• Introduces biome configuration file for consistent project formatting
• Implements brightness service and UI component for monitor brightness control
• Refactors layout and code formatting for consistency across components
2025-05-10 19:28:47 -04:00

13 lines
440 B
TypeScript

import { bind } from 'astal'
import Wp from 'gi://AstalWp'
export default function VolumeStatus() {
const speaker = Wp.get_default()?.audio.defaultSpeaker!
return (
<box onScroll={(_, __, dy) => (dy < 0 ? (speaker.volume += 0.01) : (speaker.volume += -0.01))} spacing={2}>
<image iconName={bind(speaker, 'volumeIcon')} />
<label label={bind(speaker, 'volume').as((p) => `${Math.floor(p * 100)}%`)} />
</box>
)
}