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

Fix widget.wibox.slider example #3923

Merged
merged 1 commit into from
Jun 6, 2024
Merged

Conversation

Cyan903
Copy link
Contributor

@Cyan903 Cyan903 commented Jun 5, 2024

The provided example for widget.wibox.slider does not work due to naughty.notify requiring the message to be a string.

local widget = wibox.widget {
    bar_shape           = gears.shape.rounded_rect,
    bar_height          = 3,
    bar_color           = beautiful.border_color,
    handle_color        = beautiful.bg_normal,
    handle_shape        = gears.shape.circle,
    handle_border_color = beautiful.border_color,
    handle_border_width = 1,
    value               = 25,
    widget              = wibox.widget.slider,
}

-- Connect to `property::value` to use the value on change
widget:connect_signal("property::value", function(_, new_value)
    naughty.notify { title = "Slider changed", message = new_value }
end)

new_value returns a number in this case. Running this code will throw an error in lib/naughty/widget/_markup.lua:

text = text:gsub(pattern, subs)

@Elv13 Elv13 merged commit ad0290b into awesomeWM:master Jun 6, 2024
9 checks passed
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 this pull request may close these issues.

4 participants