Fixing markdown...

This commit is contained in:
bzgec 2021-04-02 11:38:54 +02:00
parent 3a917fe892
commit 4849730abd
3 changed files with 67 additions and 59 deletions

View File

@ -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

View File

@ -5,21 +5,25 @@
# 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 = {
```lua
local widgets = {
mic = require("widgets/mic"),
}
theme.mic = widgets.mic({
}
theme.mic = widgets.mic({
timeout = 10,
settings = function(self)
if self.state == "muted" then
@ -28,28 +32,28 @@ This widget can be used to display the current microphone status.
self.widget:set_image(theme.widget_micUnmuted)
end
end
})
local widget_mic = wibox.widget { theme.mic.widget, layout = wibox.layout.align.horizontal }
```
})
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",
```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()
```
--]]

View File

@ -1,19 +1,23 @@
# 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 = {
```lua
local widgets = {
mic = require("widgets/mic"),
}
theme.mic = widgets.mic({
}
theme.mic = widgets.mic({
timeout = 10,
settings = function(self)
if self.state == "muted" then
@ -22,25 +26,25 @@ This widget can be used to display the current microphone status.
self.widget:set_image(theme.widget_micUnmuted)
end
end
})
local widget_mic = wibox.widget { theme.mic.widget, layout = wibox.layout.align.horizontal }
```
})
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",
```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()
```