From 277162f4d4af2b4854f5a493a5fd6e16908e6f2b Mon Sep 17 00:00:00 2001 From: asalde_le1 <57564314+asaldele1@users.noreply.github.com> Date: Sun, 1 Jun 2025 06:46:54 +0300 Subject: [PATCH 1/2] Enable sound unmuting and show the muted sound icon --- .../ags/modules/indicators/indicatorvalues.js | 19 ++++++++++++++----- .config/hypr/hyprland/keybinds.conf | 8 ++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.config/ags/modules/indicators/indicatorvalues.js b/.config/ags/modules/indicators/indicatorvalues.js index f8d08bfc..a4aef288 100644 --- a/.config/ags/modules/indicators/indicatorvalues.js +++ b/.config/ags/modules/indicators/indicatorvalues.js @@ -8,7 +8,7 @@ import Indicator from '../../services/indicator.js'; import { MaterialIcon } from '../.commonwidgets/materialicon.js'; const OsdValue = ({ - name, icon, nameSetup = undefined, labelSetup, progressSetup, + name, icon, nameSetup = undefined, labelSetup, progressSetup, iconSetup, extraClassName = '', extraProgressClassName = '', ...rest }) => { @@ -31,7 +31,7 @@ const OsdValue = ({ } }, children: [ - MaterialIcon(icon, 'hugeass', {vpack: 'center'}), + MaterialIcon(icon, 'hugeass', {vpack: 'center', setup: iconSetup}), Box({ vertical: true, className: 'spacing-v-5', @@ -74,7 +74,6 @@ export default (monitor = 0) => { const volumeIndicator = OsdValue({ name: 'Volume', - icon: 'volume_up', extraClassName: 'osd-volume', extraProgressClassName: 'osd-volume-progress', attribute: { headphones: undefined , device: undefined}, @@ -93,7 +92,9 @@ export default (monitor = 0) => { }), labelSetup: (self) => self.hook(Audio, (label) => { const newDevice = (Audio.speaker?.name); - const updateValue = Math.round(Audio.speaker?.volume * 100); + const updateValue = Audio.speaker?.stream?.isMuted + ? 0 + : Math.round(Audio.speaker?.volume * 100); if (!isNaN(updateValue)) { if (newDevice === volumeIndicator.attribute.device && updateValue != label.label) { Indicator.popup(1); @@ -103,12 +104,20 @@ export default (monitor = 0) => { label.label = `${updateValue}`; }), progressSetup: (self) => self.hook(Audio, (progress) => { - const updateValue = Audio.speaker?.volume; + const updateValue = Audio.speaker?.stream?.isMuted + ? 0 + : Audio.speaker?.volume; if (!isNaN(updateValue)) { if (updateValue > 1) progress.value = 1; else progress.value = updateValue; } }), + iconSetup: (self) => self.hook(Audio, (progress) => { + self.label = + Audio.speaker?.stream?.isMuted || !Audio.speaker.volume + ? 'volume_off' + : 'volume_up'; + }), }); return MarginRevealer({ transition: 'slide_down', diff --git a/.config/hypr/hyprland/keybinds.conf b/.config/hypr/hyprland/keybinds.conf index 5d3b89ec..0416e481 100644 --- a/.config/hypr/hyprland/keybinds.conf +++ b/.config/hypr/hyprland/keybinds.conf @@ -3,10 +3,10 @@ bindl = Alt ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle # [hidden] bindl = Super ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle # [hidden] -bindl = ,XF86AudioMute, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0% # [hidden] -bindl = Super+Shift,M, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0% # [hidden] -bindle=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ # [hidden] -bindle=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- # [hidden] +bindl = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle # [hidden] +bindl = Super+Shift,M, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle # [hidden] +bindle=, XF86AudioRaiseVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 && wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ # [hidden] +bindle=, XF86AudioLowerVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 && wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- # [hidden] # Uncomment these if you can't get AGS to work #bindle=, XF86MonBrightnessUp, exec, brightnessctl set '12.75+' From 623fd80a54b32e549ef92dc19aafd9f52560eeaf Mon Sep 17 00:00:00 2001 From: asalde_le1 <57564314+asaldele1@users.noreply.github.com> Date: Sun, 1 Jun 2025 06:51:57 +0300 Subject: [PATCH 2/2] Add a keybind for the microphone toggle button --- .config/hypr/hyprland/keybinds.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/hypr/hyprland/keybinds.conf b/.config/hypr/hyprland/keybinds.conf index 0416e481..6b28095b 100644 --- a/.config/hypr/hyprland/keybinds.conf +++ b/.config/hypr/hyprland/keybinds.conf @@ -3,6 +3,7 @@ bindl = Alt ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle # [hidden] bindl = Super ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle # [hidden] +bindl = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle # [hidden] bindl = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle # [hidden] bindl = Super+Shift,M, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle # [hidden] bindle=, XF86AudioRaiseVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 && wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ # [hidden]