fix(ags osd): only show speaker osd when using keys
This commit is contained in:
parent
1efe609696
commit
e01d1721a6
2 changed files with 11 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
import Audio from 'resource:///com/github/Aylur/ags/service/audio.js';
|
||||
import Variable from 'resource:///com/github/Aylur/ags/variable.js';
|
||||
|
||||
import { Label } from 'resource:///com/github/Aylur/ags/widget.js';
|
||||
import OSD from './ctor.js';
|
||||
|
@ -10,12 +11,17 @@ import { MicIcon } from '../misc/audio-icons.js';
|
|||
const AUDIO_MAX = 1.5;
|
||||
|
||||
|
||||
const ShowSpeaker = Variable(true);
|
||||
|
||||
globalThis.showSpeaker = () => {
|
||||
ShowSpeaker.value = !ShowSpeaker.value;
|
||||
};
|
||||
|
||||
export const SpeakerOSD = (stack) => OSD({
|
||||
stack,
|
||||
icon: { binds: [['icon', SpeakerIcon, 'value']] },
|
||||
info: {
|
||||
mod: Audio,
|
||||
signal: 'speaker-changed',
|
||||
mod: ShowSpeaker,
|
||||
logic: (self) => {
|
||||
if (!Audio.speaker) {
|
||||
return;
|
||||
|
|
|
@ -182,13 +182,13 @@ in {
|
|||
",Print, exec, grim -g \"$(slurp)\" - | swappy -f -"
|
||||
"$mainMod SHIFT, C, exec, wl-color-picker"
|
||||
|
||||
",XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle"
|
||||
",XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle & ags -r 'showSpeaker()' &"
|
||||
",XF86AudioMicMute, exec, pactl set-source-mute @DEFAULT_SOURCE@ toggle"
|
||||
];
|
||||
|
||||
binde = [
|
||||
",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
|
||||
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+ & ags -r 'showSpeaker()' &"
|
||||
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- & ags -r 'showSpeaker()' &"
|
||||
];
|
||||
|
||||
# Mouse Binds
|
||||
|
|
Loading…
Reference in a new issue