[OPEN] Hardware microphone mute keybinding in awesome wm lua

Post Reply
MagnusCaesar
recruit crewman
Posts: 1
Joined: Mon Aug 16, 2021 9:01 am

[OPEN] Hardware microphone mute keybinding in awesome wm lua

Post by MagnusCaesar »

Hello everyone,
Here is my issue:

As I have a microphone-mute button and want to use that too, can someone help me out with the code required to make it work?
I tried copy-pasting some of the code arcolinux's default rc.lua file, but I can't seem to be able to find the syntax in the awesome documentation for muting the microphone

Code: Select all

    awful.key({ }, "XF86AudioMicMute",
        function ()
            os.execute(string.format("amixer -q set %s toggle", beautiful.???.togglechannel or beautiful.???.channel))
            beautiful.???.update()
        end),
The "???" is just a placeholder for the part I'm probably missing, the key is recognized, but I do not know how to make it mute my computer's mic

By default the rc.lua given by the arcolinux devs include keybindings to increase and decrease speaker volume/mute the speaker given below:

Code: Select all

    awful.key({ }, "XF86AudioRaiseVolume",
        function ()
            os.execute(string.format("amixer -q set %s 1%%+", beautiful.volume.channel))
            beautiful.volume.update()
        end),
    --awful.key({ modkey1 }, "Down",
    awful.key({ }, "XF86AudioLowerVolume",
        function ()
            os.execute(string.format("amixer -q set %s 1%%-", beautiful.volume.channel))
            beautiful.volume.update()
        end),
    awful.key({ }, "XF86AudioMute",
        function ()
            os.execute(string.format("amixer -q set %s toggle", beautiful.volume.togglechannel or beautiful.volume.channel))
            beautiful.volume.update()
        end),

If there's an alternative way to make the key mute the mic, do enlighten me, thanks.

User avatar
erikdubois
Captain
Posts: 4422
Joined: Tue Nov 07, 2017 3:45 pm
Location: Belgium
Contact:

Re: [OPEN] Hardware microphone mute keybinding in awesome wm lua

Post by erikdubois »

if there are Awesome specialists around ... you are cleared to respond
Learn, have fun and enjoy.
But first use the power of the Arch Wiki
use the tutorials on https://www.youtube.com/erikdubois
then use the power of google
then use the power of our moderators.

Post Reply

Return to “BYOI ArcoLinuxB Awesome”