Fixing markdown...
This commit is contained in:
parent
3a917fe892
commit
4849730abd
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
```
|
||||
|
||||
--]]
|
||||
|
||||
|
|
|
@ -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()
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue