swaync and ags configs
This commit is contained in:
1 parent
46f85b743f
commit
72a97ff1b6
9 files changed
+1254
-7
No files matched your search
@@ -0,0 +1,50 @@
|
||||
const audio = await ServiceWorker.import('audio')
|
||||
|
||||
/** @param {'speaker' | 'microphone'} type */
|
||||
const vol = () => {
|
||||
const VolumeSlider = (type = 'speaker') => Widget.Slider({
|
||||
hexpand: true,
|
||||
drawValue: false,
|
||||
onChange: ({value}) => audio[type].volume = value,
|
||||
value: audio[type].bind('volume')
|
||||
})
|
||||
|
||||
const speakerSlider = VolumeSlider('speaker')
|
||||
const micSlider = VolumeSlider('microphone')
|
||||
return Widget.Window({
|
||||
child: [speakerSlider, micSlider]
|
||||
})
|
||||
}
|
||||
|
||||
// const audio = await Service.import('audio')
|
||||
|
||||
// const vol = () => {
|
||||
// const volumeIndicator = Widget.Button({
|
||||
// on_clicked: () => audio.speaker.is_muted = !audio.speaker.is_muted,
|
||||
// child: Widget.Icon().hook(audio.speaker, self => {
|
||||
// const vol = audio.speaker.volume * 100;
|
||||
// const icon = [
|
||||
// [101, 'overamplified'],
|
||||
// [67, 'high'],
|
||||
// [34, 'medium'],
|
||||
// [1, 'low'],
|
||||
// [0, 'muted'],
|
||||
// ].find(([threshold]) => threshold <= vol)?.[1];
|
||||
|
||||
// self.icon = `audio-volume-${icon}-symbolic`;
|
||||
// self.tooltip_text = `Volume ${Math.floor(vol)}%`;
|
||||
// }),
|
||||
// })
|
||||
// return Widget.Window({
|
||||
// child: volumeIndicator
|
||||
// })
|
||||
// }
|
||||
|
||||
App.config({
|
||||
style: "./style.css",
|
||||
windows: [
|
||||
vol()
|
||||
// speakerSlider,
|
||||
// micSlider
|
||||
],
|
||||
})
|
||||
Reference in new issue
Block a user