diff --git a/recipes.mdwn b/recipes.mdwn index e41fbd3..c088b54 100644 --- a/recipes.mdwn +++ b/recipes.mdwn @@ -22,7 +22,7 @@ to improve your Awesome setup. * [Battery Indicator (UPower)](https://github.com/stefano-m/awesome-power_widget) * [[Google Play Music Desktop Player|recipes/gpmdp]] * [Set of simple widgets](https://github.com/streetturtle/awesome-wm-widgets) - widgets for battery, cpu, brightness, volume, email, etc. -* [Microphone state](../recipes/mic) +* [[Microphone state|recipes/mic]] ## Libraries diff --git a/recipes/mic.lua b/recipes/mic.lua index a277f3c..2336fc7 100644 --- a/recipes/mic.lua +++ b/recipes/mic.lua @@ -5,51 +5,55 @@ # Microphone state widget/watcher + This widget can be used to display the current microphone status. ## Requirements + - `amixer` - this command is used to get and toggle microphone state ## Usage + - Download [mic.lua](https://awesomewm.org/recipes/mic.lua) file and put it into awesome's folder (like `~/.config/awesome/widgets/mic.lua`) + - Add widget to `theme.lua`: - ```lua - local widgets = { - mic = require("widgets/mic"), - } - theme.mic = widgets.mic({ - timeout = 10, - settings = function(self) - if self.state == "muted" then - self.widget:set_image(theme.widget_micMuted) - else - self.widget:set_image(theme.widget_micUnmuted) - end - end - }) - local widget_mic = wibox.widget { theme.mic.widget, layout = wibox.layout.align.horizontal } - ``` +```lua +local widgets = { + mic = require("widgets/mic"), +} +theme.mic = widgets.mic({ + timeout = 10, + settings = function(self) + if self.state == "muted" then + self.widget:set_image(theme.widget_micMuted) + else + self.widget:set_image(theme.widget_micUnmuted) + end + end +}) +local widget_mic = wibox.widget { theme.mic.widget, layout = wibox.layout.align.horizontal } +``` - Create a shortcut to toggle microphone state (add to `rc.lua`): - ```lua - -- Toggle microphone state - awful.key({ modkey, "Shift" }, "m", - function () - beautiful.mic:toggle() - end, - {description = "Toggle microphone (amixer)", group = "Hotkeys"} - ), - ``` +```lua +-- Toggle microphone state +awful.key({ modkey, "Shift" }, "m", + function () + beautiful.mic:toggle() + end, + {description = "Toggle microphone (amixer)", group = "Hotkeys"} +), +``` - You can also add a command to mute the microphone state on boot. Add this to your `rc.lua`: - ```lua - -- Mute microphone on boot - beautiful.mic:mute() - ``` +```lua +-- Mute microphone on boot +beautiful.mic:mute() +``` --]] diff --git a/recipes/mic.mdwn b/recipes/mic.mdwn index a381e9e..4847ef3 100644 --- a/recipes/mic.mdwn +++ b/recipes/mic.mdwn @@ -1,46 +1,50 @@ # Microphone state widget/watcher + This widget can be used to display the current microphone status. ## Requirements + - `amixer` - this command is used to get and toggle microphone state ## Usage + - Download [mic.lua](https://awesomewm.org/recipes/mic.lua) file and put it into awesome's folder (like `~/.config/awesome/widgets/mic.lua`) + - Add widget to `theme.lua`: - ```lua - local widgets = { - mic = require("widgets/mic"), - } - theme.mic = widgets.mic({ - timeout = 10, - settings = function(self) - if self.state == "muted" then - self.widget:set_image(theme.widget_micMuted) - else - self.widget:set_image(theme.widget_micUnmuted) - end - end - }) - local widget_mic = wibox.widget { theme.mic.widget, layout = wibox.layout.align.horizontal } - ``` +```lua +local widgets = { + mic = require("widgets/mic"), +} +theme.mic = widgets.mic({ + timeout = 10, + settings = function(self) + if self.state == "muted" then + self.widget:set_image(theme.widget_micMuted) + else + self.widget:set_image(theme.widget_micUnmuted) + end + end +}) +local widget_mic = wibox.widget { theme.mic.widget, layout = wibox.layout.align.horizontal } +``` - Create a shortcut to toggle microphone state (add to `rc.lua`): - ```lua - -- Toggle microphone state - awful.key({ modkey, "Shift" }, "m", - function () - beautiful.mic:toggle() - end, - {description = "Toggle microphone (amixer)", group = "Hotkeys"} - ), - ``` +```lua +-- Toggle microphone state +awful.key({ modkey, "Shift" }, "m", + function () + beautiful.mic:toggle() + end, + {description = "Toggle microphone (amixer)", group = "Hotkeys"} +), +``` - You can also add a command to mute the microphone state on boot. Add this to your `rc.lua`: - ```lua - -- Mute microphone on boot - beautiful.mic:mute() - ``` +```lua +-- Mute microphone on boot +beautiful.mic:mute() +```