Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local volumeImage = wibox.widget {
- image = path_to_icons.."audio-volume-high-symbolic.svg",
- resize = false,
- widget = wibox.widget.imagebox,
- };
- local volumeLevel = awful.widget.watch(
- 'bash -c "amixer -D pulse sget Master | awk \'END{print $5;}\' | sed \'s/[][%?]//g\'"',
- 10,
- function (widget, stdout)
- local level = tonumber(stdout);
- if level > 80 then
- volumeImage:set_image(path_to_icons.."audio-volume-high-symbolic.svg");
- widget:set_text(level);
- elseif level > 40 then
- volumeImage:set_image(path_to_icons.."audio-volume-medium-symbolic.svg");
- widget:set_text(level);
- else
- volumeImage:set_image(path_to_icons.."audio-volume-low-symbolic.svg");
- widget:set_text(level);
- end
- end
- )
- local volume = {
- {
- volumeImage;
- widget = wibox.container.margin,
- top = 7,
- },
- {
- volumeLevel;
- widget = wibox.container.margin,
- top = 2,
- },
- {
- percentSymbol,
- widget = wibox.container.margin,
- top = 2,
- },
- spacing = 3;
- layout = wibox.layout.fixed.horizontal;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement