Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volume-widget issue: volume-widget/volume.lua:243: bad argument #2 to 'format' (number expected, got nil) #449

Closed
raisinbl opened this issue Jul 21, 2024 · 3 comments · Fixed by #456

Comments

@raisinbl
Copy link

I follow default installation for volume widget and got this

024-07-21 13:03:58 E: awesome: Error during a protected call: ...nfig/awesome/awesome-wm-widgets/volume-widget/volume.lua:243: bad argument #2 to 'format' (number expected, got nil)
stack traceback:
	[C]: in function 'string.format'
	...nfig/awesome/awesome-wm-widgets/volume-widget/volume.lua:243: in upvalue 'callback'
	/usr/share/awesome/lib/awful/widget/watch.lua:77: in function </usr/share/awesome/lib/awful/widget/watch.lua:76>
	(...tail calls...)
	/usr/share/awesome/lib/awful/spawn.lua:481: in function </usr/share/awesome/lib/awful/spawn.lua:475>
	[C]: in function 'xpcall'
	/usr/share/awesome/lib/gears/protected_call.lua:36: in function </usr/share/awesome/lib/gears/protected_call.lua:35>
	(...tail calls...)
	/usr/share/awesome/lib/awful/spawn.lua:577: in upvalue 'done'
	/usr/share/awesome/lib/awful/spawn.lua:592: in function </usr/share/awesome/lib/awful/spawn.lua:584>
@raisinbl raisinbl changed the title volume-widget: volume-widget issue: volume-widget/volume.lua:243: bad argument #2 to 'format' (number expected, got nil) Jul 21, 2024
@huyld
Copy link

huyld commented Sep 29, 2024

I had this issue as well.
From the README file:

Note that the widget uses following command to get the current volume: amixer -c 1 -D pulse sget Master, so please make sure that it works for you

In my case the card should be 0 instead of 1. Hence I need to pass the correct card:

        volume_widget{
            widget_type = 'arc',
            card = 0
        },

@utix
Copy link
Contributor

utix commented Oct 10, 2024

imho default should be 0 not 1, majority of user has one card not 2
@Luka5W why do you set default to 1?

@Luka5W
Copy link
Contributor

Luka5W commented Oct 10, 2024

Good question. I have no clue.

I think I was just looking at the example section in the amixer(1) man page and thought they were counting from 1 instead of 0, or using 1 as the default for some reason. maybe lua has traumatized me a bit ^^

anyhow, sorry for that, my fault.

#456 seems right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants