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

volumearc widet doesn't change color #31

Closed
floli opened this issue Feb 19, 2018 · 4 comments
Closed

volumearc widet doesn't change color #31

floli opened this issue Feb 19, 2018 · 4 comments

Comments

@floli
Copy link
Contributor

floli commented Feb 19, 2018

Hello,
I added the volumearc widget, control using the mouse wheel works, also mute / unmute on left click. However, the color does not change when muted. The pattern matching doesn't seem to be a problem:

> soff = [[Simple mixer control 'Master',0
>>   Capabilities: pvolume pswitch pswitch-joined                                                                                                                                                                                          
>>   Playback channels: Front Left - Front Right                                                                                                                                                                                           
>>   Limits: Playback 0 - 65536                                                                                                                                                                                                            
>>   Mono:                                                                                                                                                                                                                                 
>>   Front Left: Playback 22939 [35%] [off]                                                                                                                                                                                                
>>   Front Right: Playback 22939 [35%] [off]                                                                                                                                                                                               
>> ]]                                                                                                                                                                                                                                      
> son = [[Simple mixer control 'Master',0
>>   Capabilities: pvolume pswitch pswitch-joined                                                                                                                                                                                          
>>   Playback channels: Front Left - Front Right                                                                                                                                                                                           
>>   Limits: Playback 0 - 65536                                                                                                                                                                                                            
>>   Mono:                                                                                                                                                                                                                                 
>>   Front Left: Playback 22939 [35%] [on]                                                                                                                                                                                                 
>>   Front Right: Playback 22939 [35%] [on]                                                                                                                                                                                                
>> ]]                                                                                                                                                                                                                                      
> string.match(soff, "%[(o%D%D?)%]")                                                                                                                                                                                                 
off
> string.match(son, "%[(o%D%D?)%]")
on

The son and soff strings are the output of amixer -D pulse sget Master.

When am I supposed to find the definition of beautiful.widget_red? grep -R "widget_red" /usr turned up no relevant hits.

Disclaimer: I am both a lua and awesome newbie, so that there may be some trivial problem on my side involved.

@streetturtle
Copy link
Owner

Hi!
In this widget I used Awesome's theme capabilities. The idea is basically to put some variables inside your theme file (which by default should be /.config/awesome/themes/default/theme.lua).
So to make it work you can either

  • add theme.widget_red=#ff0000 (or the color you like) in your theme.lua, or
  • change it directly in the widget's code:
if mute == "off" then
    widget.colors = "#ff0000"
else
    widget.colors = "#00ff00"
end

@floli
Copy link
Contributor Author

floli commented Feb 20, 2018

But shouldn't this stuff be defined after

beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")

?

@streetturtle
Copy link
Owner

Mm... not sure if I understood your question.
The variables used in widget (widget_red or widget_main_color) are custom - they don't exist in fresh Awesome installation. So if you add those variables in your theme.lua then they will be initialized by the line you pasted.

@floli
Copy link
Contributor Author

floli commented Feb 23, 2018

Ah, I see. I thought that beautiful.widget_red is supposed to be defined by default/theme.lua or one of the other themes, so there is a default /red/, defined by the theme, i.e. a color that draws attention and has a high contrast to the background color.

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

No branches or pull requests

2 participants