From 09194fca3251f030770caca098733fdbb778d0e7 Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Tue, 3 Jun 2025 21:24:46 +0300 Subject: [PATCH 1/3] Added conditions for displaying icons for OSD --- ags/window/OSD.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ags/window/OSD.ts b/ags/window/OSD.ts index 5a5b8ae..df43d8d 100644 --- a/ags/window/OSD.ts +++ b/ags/window/OSD.ts @@ -46,7 +46,8 @@ export const OSD = (mon: number) => { children: [ new Widget.Icon({ className: "icon", - icon: bind(Wireplumber.getDefault().getDefaultSink(), "volumeIcon") + icon: bind(Wireplumber.getDefault().getDefaultSink(), "volumeIcon").as(icon => + !Wireplumber.getDefault().isMutedSink() && Wireplumber.getDefault().getSinkVolume() > 0 ? icon : "audio-volume-muted-symbolic"), } as Widget.IconProps), new Widget.Box({ className: "volume", From 26e50f3cbdb3cb65145acf702de70f8faf3e8bc9 Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Tue, 3 Jun 2025 22:38:42 +0300 Subject: [PATCH 2/3] Changed icons for Sink and Source --- ags/widget/bar/Status.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ags/widget/bar/Status.ts b/ags/widget/bar/Status.ts index 367218a..ea11722 100644 --- a/ags/widget/bar/Status.ts +++ b/ags/widget/bar/Status.ts @@ -22,14 +22,14 @@ export function Status(): Gtk.Widget { volumeStatus({ className: "sink", endpoint: Wireplumber.getDefault().getDefaultSink(), - icon: bind(Wireplumber.getDefault().getDefaultSink(), "mute").as((muted) => - !muted ? "󰕾" : "󰖁") + icon: bind(Wireplumber.getDefault().getDefaultSink(), "volumeIcon").as(icon => + !Wireplumber.getDefault().isMutedSink() && Wireplumber.getDefault().getSinkVolume() > 0 ? icon : "audio-volume-muted-symbolic"), }), volumeStatus({ className: "source", endpoint: Wireplumber.getDefault().getDefaultSource(), - icon: bind(Wireplumber.getDefault().getDefaultSource(), "mute").as((muted) => - !muted ? "󰍬" : "󰍭") + icon: bind(Wireplumber.getDefault().getDefaultSource(), "volumeIcon").as(icon => + !Wireplumber.getDefault().isMutedSource() && Wireplumber.getDefault().getSourceVolume() > 0 ? icon : "microphone-sensitivity-muted-symbolic"), }), StatusIcons() ] From 38dbccb2959cc094bdc5dd114739d8d368ffd35f Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Tue, 3 Jun 2025 22:46:39 +0300 Subject: [PATCH 3/3] Update Icons for Sliders --- ags/widget/control-center/Sliders.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ags/widget/control-center/Sliders.ts b/ags/widget/control-center/Sliders.ts index a2cc393..7170a8d 100644 --- a/ags/widget/control-center/Sliders.ts +++ b/ags/widget/control-center/Sliders.ts @@ -18,8 +18,14 @@ export function Sliders() { children: bind(Wireplumber.getWireplumber(), "defaultSpeaker").as((sink) => [ new Widget.Button({ className: "nf", - label: bind(sink, "mute").as((muted) => !muted ? "󰕾" : "󰖁"), - onClick: () => Wireplumber.getDefault().toggleMuteSink() + onClick: () => Wireplumber.getDefault().toggleMuteSink(), + children: [ + new Widget.Icon ({ + icon: bind(sink, "volumeIcon").as((icon) => + !Wireplumber.getDefault().isMutedSink() && Wireplumber.getDefault().getSinkVolume() > 0 ? icon : "audio-volume-muted-symbolic"), + css: "margin-right: 10px;" + } as Widget.IconProps), + ] } as Widget.ButtonProps), new Widget.Slider({ drawValue: false, @@ -43,8 +49,14 @@ export function Sliders() { children: bind(Wireplumber.getWireplumber(), "defaultMicrophone").as((source) => [ new Widget.Button({ className: "nf", - label: bind(source, "mute").as((muted) => !muted ? "󰍬" : "󰍭"), - onClick: () => Wireplumber.getDefault().toggleMuteSource() + onClick: () => Wireplumber.getDefault().toggleMuteSource(), + children: [ + new Widget.Icon ({ + icon: bind(source, "volumeIcon").as((icon) => + !Wireplumber.getDefault().isMutedSource() && Wireplumber.getDefault().getSourceVolume() > 0 ? icon : "microphone-sensitivity-muted-symbolic"), + css: "margin-right: 10px;" + } as Widget.IconProps), + ] } as Widget.ButtonProps), new Widget.Slider({ drawValue: false,