Fix some more bugs related to the new icon implementation

This commit is contained in:
Rene
2022-08-03 04:19:42 +02:00
parent 2422b9a07f
commit 535c763a30
40 changed files with 152 additions and 263 deletions

View File

@@ -88,6 +88,7 @@ return function()
border_color = Theme_config.application_launcher.application.border_color,
border_width = Theme_config.application_launcher.application.border_width,
bg = Theme_config.application_launcher.application.bg,
fg = Theme_config.application_launcher.application.fg,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, dpi(8))
end,
@@ -108,6 +109,7 @@ return function()
)
)
)
Hover_signal(app_widget)
table.insert(list, app_widget)
end
end
@@ -151,8 +153,6 @@ return function()
end
)
awesome.emit_signal("update::selected")
Hover_signal(application, Theme_config.application_launcher.application.bg,
Theme_config.application_launcher.application.fg, application.border_color)
end
end
@@ -221,10 +221,13 @@ return function()
local selected_widget = application_grid:get_widgets_at(curser.y, curser.x)[1]
if selected_widget.terminal then
awful.spawn(User_config.terminal .. " -e " .. selected_widget.exec)
awful.spawn(User_config.terminal ..
" -e " ..
selected_widget.exec:gsub("%%F", ""):gsub("%%u", ""):gsub("%%U", ""):gsub("%%f", ""):gsub("%%i", ""):gsub("%%c"
, ""):gsub("%%k", ""))
else
print(selected_widget.exec)
awful.spawn.with_shell(selected_widget.exec)
awful.spawn.with_shell(selected_widget.exec:gsub("%%F", ""):gsub("%%u", ""):gsub("%%U", ""):gsub("%%f", ""):gsub("%%i"
, ""):gsub("%%c", ""):gsub("%%k", ""))
end
end
)

View File

@@ -227,7 +227,6 @@ return function()
searchbar:buttons(gears.table.join(
awful.button({}, 1, function()
if not awful.keygrabber.is_running then
keygrabber_start()
searchbar.s_background.border_color = Theme_config.application_launcher.searchbar.border_active
searchbar.s_background.fg = Theme_config.application_launcher.searchbar.fg
search_text:set_markup(promt_text_with_cursor("", 1))

View File

@@ -145,8 +145,7 @@ return function(s)
end
)
end
Hover_signal(device_widget, Theme_config.bluetooth_controller.device_bg_hover,
Theme_config.bluetooth_controller.device_fg_hover)
Hover_signal(device_widget)
return device_widget
end

View File

@@ -54,6 +54,7 @@ return function(screen, programs)
gears.shape.rounded_rect(cr, width, height, dpi(10))
end,
bg = Theme_config.dock.element_bg,
fg = "#000000",
widget = wibox.container.background,
id = "background"
},
@@ -69,7 +70,7 @@ return function(screen, programs)
end
end
Hover_signal(dock_element.background, Theme_config.dock.element_focused_hover_bg)
Hover_signal(dock_element.background, Theme_config.dock.element_focused_bg .. "dd")
dock_element:connect_signal(
"button::press",

View File

@@ -368,8 +368,7 @@ return function(s)
end
)
Hover_signal(clear_all_widget.margin3.background4, Theme_config.notification_center.clear_all_button.bg,
Theme_config.notification_center.clear_all_button.fg)
Hover_signal(clear_all_widget.margin3.background4)
--#endregion
end

View File

@@ -82,6 +82,7 @@ function nl.create_notification(n)
},
id = "background",
fg = Theme_config.notification_center.notification_list.close_color,
bg = Theme_config.notification_center.notification_list.close_bg,
widget = wibox.container.background
},
strategy = "exact",
@@ -233,8 +234,7 @@ function nl.create_notification(n)
end
)
Hover_signal(close_widget.const.background, nil,
Theme_config.notification_center.notification_list.close_color)
Hover_signal(close_widget.const.background)
notification:connect_signal(
"mouse::enter",

View File

@@ -394,8 +394,6 @@ return function(s)
function(stdout)
-- Only fetch info if the track changed or if the title/artist is empty
if skip_check or (not stdout:match(trackid)) or (not stdout:match(artist)) or (not stdout:match(title)) then
update_loop()
update_shuffle()
-- Get the song title
awful.spawn.easy_async_with_shell(
"playerctl metadata xesam:title",

View File

@@ -149,11 +149,11 @@ return function(s)
local lock_button = button("Lock", icondir .. "lock.svg", Theme_config.powermenu.lock_button_bg, lock_command)
-- Signals to change color on hover
Hover_signal(shutdown_button.background, Theme_config.powermenu.shutdown_button_bg, Theme_config.powermenu.button_fg)
Hover_signal(reboot_button.background, Theme_config.powermenu.reboot_button_bg, Theme_config.powermenu.button_fg)
Hover_signal(suspend_button.background, Theme_config.powermenu.suspend_button_bg, Theme_config.powermenu.button_fg)
Hover_signal(logout_button.background, Theme_config.powermenu.logout_button_bg, Theme_config.powermenu.button_fg)
Hover_signal(lock_button.background, Theme_config.powermenu.lock_button_bg, Theme_config.powermenu.button_fg)
Hover_signal(shutdown_button.background)
Hover_signal(reboot_button.background)
Hover_signal(suspend_button.background)
Hover_signal(logout_button.background)
Hover_signal(lock_button.background)
-- The powermenu widget
local powermenu = wibox.widget {

View File

@@ -132,9 +132,9 @@ local create_titlebar = function(c, size)
layout = wibox.layout.align.vertical,
id = "main"
}
Hover_signal(titlebar.main.margin.spacing.closebutton, Theme_config.titlebar.close_button_bg)
Hover_signal(titlebar.main.margin.spacing.maximizebutton, Theme_config.titlebar.minimize_button_bg)
Hover_signal(titlebar.main.margin.spacing.minimizebutton, Theme_config.titlebar.maximize_button_bg)
Hover_signal(titlebar.main.margin.spacing.closebutton)
Hover_signal(titlebar.main.margin.spacing.maximizebutton)
Hover_signal(titlebar.main.margin.spacing.minimizebutton)
end
local create_titlebar_dialog_modal = function(c, size)
@@ -187,8 +187,8 @@ local create_titlebar_dialog_modal = function(c, size)
layout = wibox.layout.align.vertical,
id = "main"
}
Hover_signal(titlebar.main.margin.spacing.closebutton, Theme_config.titlebar.close_button_bg)
Hover_signal(titlebar.main.margin.spacing.minimizebutton, Theme_config.titlebar.minimize_button_bg)
Hover_signal(titlebar.main.margin.spacing.closebutton)
Hover_signal(titlebar.main.margin.spacing.minimizebutton)
end
client.connect_signal(

View File

@@ -51,11 +51,13 @@ return function(s)
if sink == true then
device:connect_signal(
"button::press",
function()
if node then
awful.spawn("./.config/awesome/src/scripts/vol.sh set_sink " .. node)
function(_, _, _, key)
if key == 1 then
if node then
awful.spawn("./.config/awesome/src/scripts/vol.sh set_sink " .. node)
awesome.emit_signal("update::bg_sink", node)
end
end
awesome.emit_signal("update::bg_sink", node)
end
)
awesome.connect_signal(
@@ -92,14 +94,17 @@ return function(s)
end
)
awesome.emit_signal("update::bg_sink", node)
Hover_signal(device)
else
device:connect_signal(
"button::press",
function()
if node then
awful.spawn("./.config/awesome/src/scripts/mic.sh set_source " .. node)
function(_, _, _, key)
if key == 1 then
if node then
awful.spawn("./.config/awesome/src/scripts/mic.sh set_source " .. node)
awesome.emit_signal("update::bg_source", node)
end
end
awesome.emit_signal("update::bg_source", node)
end
)
awesome.connect_signal(
@@ -136,6 +141,7 @@ return function(s)
end
)
awesome.emit_signal("update::bg_source", node)
Hover_signal(device)
end
return device
end
@@ -320,7 +326,7 @@ return function(s)
gears.shape.rounded_rect(cr, width, height, dpi(5))
end,
bar_height = dpi(5),
bar_color = Theme_config.device_border_color,
bar_color = Theme_config.volume_controller.border_color,
bar_active_color = Theme_config.volume_controller.volume_fg,
handle_color = Theme_config.volume_controller.volume_fg,
handle_shape = gears.shape.circle,
@@ -409,31 +415,33 @@ return function(s)
-- Click event for the audio dropdown
audio_selector_margin:connect_signal(
"button::press",
function()
local rubato_timer = rubato.timed {
duration = 0.4,
intro = 0.1,
outro = 0.1,
pos = volume_list.forced_height,
easing = rubato.linear,
subscribed = function(v)
volume_list.forced_height = v
function(_, _, _, key)
if key == 1 then
local rubato_timer = rubato.timed {
duration = 0.4,
intro = 0.1,
outro = 0.1,
pos = volume_list.forced_height,
easing = rubato.linear,
subscribed = function(v)
volume_list.forced_height = v
end
}
if volume_list.forced_height == 0 then
rubato_timer.target = dpi(200)
audio_bg.shape = function(cr, width, height)
gears.shape.partially_rounded_rect(cr, width, height, true, true, false, false, dpi(4))
end
audio_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-up.svg",
Theme_config.volume_controller.device_headphones_selected_icon_color))
else
rubato_timer.target = 0
audio_bg.shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, dpi(4))
end
audio_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-down.svg",
Theme_config.volume_controller.device_headphones_selected_icon_color))
end
}
if volume_list.forced_height == 0 then
rubato_timer.target = dpi(200)
audio_bg.shape = function(cr, width, height)
gears.shape.partially_rounded_rect(cr, width, height, true, true, false, false, dpi(4))
end
audio_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-up.svg",
Theme_config.volume_controller.device_headphones_selected_icon_color))
else
rubato_timer.target = 0
audio_bg.shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, dpi(4))
end
audio_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-down.svg",
Theme_config.volume_controller.device_headphones_selected_icon_color))
end
end
)
@@ -447,31 +455,33 @@ return function(s)
-- Click event for the microphone dropdown
mic_selector_margin:connect_signal(
"button::press",
function()
local rubato_timer = rubato.timed {
duration = 0.4,
intro = 0.1,
outro = 0.1,
pos = mic_list.forced_height,
easing = rubato.linear,
subscribed = function(v)
mic_list.forced_height = v
function(_, _, _, key)
if key == 1 then
local rubato_timer = rubato.timed {
duration = 0.4,
intro = 0.1,
outro = 0.1,
pos = mic_list.forced_height,
easing = rubato.linear,
subscribed = function(v)
mic_list.forced_height = v
end
}
if mic_list.forced_height == 0 then
rubato_timer.target = dpi(200)
mic_selector_margin.mic_bg.shape = function(cr, width, height)
gears.shape.partially_rounded_rect(cr, width, height, true, true, false, false, dpi(4))
end
mic_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-up.svg",
Theme_config.volume_controller.device_microphone_selected_icon_color))
else
rubato_timer.target = 0
mic_bg.shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, dpi(4))
end
mic_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-down.svg",
Theme_config.volume_controller.device_microphone_selected_icon_color))
end
}
if mic_list.forced_height == 0 then
rubato_timer.target = dpi(200)
mic_selector_margin.mic_bg.shape = function(cr, width, height)
gears.shape.partially_rounded_rect(cr, width, height, true, true, false, false, dpi(4))
end
mic_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-up.svg",
Theme_config.volume_controller.device_microphone_selected_icon_color))
else
rubato_timer.target = 0
mic_bg.shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, dpi(4))
end
mic_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-down.svg",
Theme_config.volume_controller.device_microphone_selected_icon_color))
end
end
)
@@ -482,7 +492,7 @@ return function(s)
audio_slider_margin:connect_signal(
"property::value",
function()
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ " .. tonumber(audio_slider_margin.value) .. "%")
awful.spawn.with_shell("pactl set-sink-volume @DEFAULT_SINK@ " .. tonumber(audio_slider_margin.value) .. "%")
end
)