17 lines
521 B
TypeScript
Raw Normal View History

2024-12-27 15:42:51 +03:00
import { bind } from "astal"
2025-03-27 23:03:55 +03:00
import { execAsync } from "astal/process"
2024-12-27 15:42:51 +03:00
import Wp from "gi://AstalWp"
export default function Audio() {
const speaker = Wp.get_default()?.audio.defaultSpeaker!
2025-03-27 23:03:55 +03:00
return <button
className="AudioSlider"
onClicked={() => { execAsync("ghostty --title=pulsemixer -e pulsemixer") }}>
<box>
<icon icon={bind(speaker, "volumeIcon")} />
<label label={bind(speaker, "volume").as(v => `${Math.floor(v*100)}%`)} />
</box>
</button>
2024-12-27 15:42:51 +03:00
}