-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pulseaudio -> pulse; scallback merged into cmd (read wiki)
- Loading branch information
Luke Bonham
committed
Oct 5, 2017
1 parent
c2b1864
commit b14a2c8
Showing
10 changed files
with
105 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "lain.wiki"] | ||
path = wiki | ||
url = https://github.com/copycat-killer/lain.wiki.git | ||
url = https://github.com/lcpz/lain.wiki.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,33 @@ | ||
# If you have a question | ||
# Please, read me! | ||
|
||
Take the following steps: | ||
|
||
1. [Google it](https://encrypted.google.com) | ||
2. Search [Awesome doc](https://awesomewm.org/doc) | ||
3. Ask [community](https://awesomewm.org/community) | ||
|
||
and, if you still don't have an answer, you can ask here. | ||
|
||
**Please be warned:** if your question is __unrelated__ to this repository, a reply is only an act of kindness. | ||
So that I can help you quickly and without having to redirect you here. | ||
|
||
# If you have an issue | ||
|
||
**Please read the [wiki](https://github.com/copycat-killer/lain/wiki) and search the [Issues section](https://github.com/copycat-killer/lain/issues) first.** | ||
**Please read the [wiki](https://github.com/lcpz/lain/wiki) and search the [Issues section](https://github.com/lcpz/lain/issues) first.** | ||
|
||
If you can't find a solution there, then go ahead and provide: | ||
|
||
* output of `awesome -v` and `lua -v` | ||
* expected behavior and actual behavior | ||
* steps to reproduce the problem | ||
* X error log | ||
|
||
# How to provide X error log | ||
|
||
There are two ways: | ||
|
||
* (Physically) Restart X like this: | ||
```shell | ||
startx -- -keeptty -nolisten tcp > $HOME/.xorg.log 2>&1 | ||
``` | ||
the error log will be output into `$HOME/.xorg.log`. | ||
|
||
* (Virtually) Use [Xephyr](https://wikipedia.org/wiki/Xephyr): | ||
```shell | ||
# set screen size as you like | ||
Xephyr :1 -screen 1280x800 2> stdout.txt & DISPLAY=:1 awesome | ||
``` | ||
the error log will be output in the file `stdout.txt`. | ||
|
||
Before reporting, read the log and see if you can solve it yourself. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--[[ | ||
Licensed under GNU General Public License v2 | ||
* (c) 2016, Luke Bonham | ||
--]] | ||
|
||
local helpers = require("lain.helpers") | ||
local shell = require("awful.util").shell | ||
local wibox = require("wibox") | ||
local string = { gmatch = string.gmatch, | ||
match = string.match, | ||
format = string.format } | ||
local type = type | ||
|
||
-- PulseAudio volume | ||
-- lain.widget.pulse | ||
|
||
local function factory(args) | ||
local pulse = { widget = wibox.widget.textbox(), device = "N/A" } | ||
local args = args or {} | ||
local timeout = args.timeout or 5 | ||
local settings = args.settings or function() end | ||
|
||
pulse.devicetype = args.devicetype or "sink" | ||
pulse.cmd = args.cmd or "pacmd list-" .. pulse.devicetype .. "s | sed -n -e '/*/,$!d' -e '/index/p' -e '/base volume/d' -e '/volume:/p' -e '/muted:/p' -e '/device\\.string/p'" | ||
|
||
function pulse.update() | ||
helpers.async({ shell, "-c", type(pulse.cmd) == "string" and pulse.cmd or pulse.cmd() }, | ||
function(s) | ||
volume_now = { | ||
index = string.match(s, "index: (%S+)") or "N/A", | ||
device = string.match(s, "device.string = \"(%S+)\"") or "N/A", | ||
muted = string.match(s, "muted: (%S+)") or "N/A" | ||
} | ||
|
||
pulse.device = volume_now.index | ||
|
||
local ch = 1 | ||
volume_now.channel = {} | ||
for v in string.gmatch(s, ":.-(%d+)%%") do | ||
volume_now.channel[ch] = v | ||
ch = ch + 1 | ||
end | ||
|
||
volume_now.left = volume_now.channel[1] or "N/A" | ||
volume_now.right = volume_now.channel[2] or "N/A" | ||
|
||
widget = pulse.widget | ||
settings() | ||
end) | ||
end | ||
|
||
helpers.newtimer("pulse", timeout, pulse.update) | ||
|
||
return pulse | ||
end | ||
|
||
return factory |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule wiki
updated
from c221a2 to 8b9791