From e7cb591cc32cea6d31949ab3309f02fc866eb988 Mon Sep 17 00:00:00 2001 From: Yessiest Date: Sun, 3 Apr 2022 19:18:03 +0400 Subject: [PATCH] Pre-beta-ish-release rush --- core/binds/clientkeys.lua | 9 +- core/signals.lua | 5 + core/titlebar.lua | 80 ++++-- core/widgets/menu.lua | 12 +- libs/awmtk.lua | 8 + presets/carbon-gnome/{ => core}/layout.lua | 1 - presets/carbon-gnome/{ => core}/titlebar.lua | 0 presets/carbon-gnome/{ => core}/vars.lua | 0 presets/carbon-xfce/{ => core}/layout.lua | 0 presets/carbon-xfce/{ => core}/titlebar.lua | 0 presets/carbon-xfce/{ => core}/vars.lua | 0 presets/ubuntu-11.10/core/layout.lua | 5 - presets/ubuntu-11.10/core/titlebar.lua | 80 ++++-- presets/ubuntu-20.04/core/layout.lua | 5 - presets/ubuntu-20.04/core/titlebar.lua | 80 ++++-- rc.lua | 1 - themes/carbon/icons/fallback-application.svg | 228 ++++++++++++++++++ themes/carbon/theme.lua | 5 + themes/generic.lua | 25 ++ themes/icons.lua | 91 +++---- themes/unity/icons/fallback-application.svg | 228 ++++++++++++++++++ themes/unity/icons/warning.svg | 136 +++++++++++ themes/unity/theme.lua | 45 ++-- themes/unity2/icons/fallback-application.svg | 228 ++++++++++++++++++ themes/unity2/icons/warning.svg | 136 +++++++++++ themes/unity2/theme.lua | 5 + .../icons/fallback-application.svg | 228 ++++++++++++++++++ themes/unity_simplified/icons/warning.svg | 136 +++++++++++ themes/unity_simplified/theme.lua | 6 + widgets/mailbox.lua | 9 +- widgets/pager.lua | 2 +- widgets/volume.lua | 26 +- widgets/wallpapers.lua | 46 +++- widgets/window-debug.lua | 3 + 34 files changed, 1684 insertions(+), 185 deletions(-) rename presets/carbon-gnome/{ => core}/layout.lua (98%) rename presets/carbon-gnome/{ => core}/titlebar.lua (100%) rename presets/carbon-gnome/{ => core}/vars.lua (100%) rename presets/carbon-xfce/{ => core}/layout.lua (100%) rename presets/carbon-xfce/{ => core}/titlebar.lua (100%) rename presets/carbon-xfce/{ => core}/vars.lua (100%) create mode 100644 themes/carbon/icons/fallback-application.svg create mode 100644 themes/generic.lua create mode 100644 themes/unity/icons/fallback-application.svg create mode 100644 themes/unity/icons/warning.svg create mode 100644 themes/unity2/icons/fallback-application.svg create mode 100644 themes/unity2/icons/warning.svg create mode 100644 themes/unity_simplified/icons/fallback-application.svg create mode 100644 themes/unity_simplified/icons/warning.svg diff --git a/core/binds/clientkeys.lua b/core/binds/clientkeys.lua index 0fc947e..6308783 100644 --- a/core/binds/clientkeys.lua +++ b/core/binds/clientkeys.lua @@ -42,6 +42,11 @@ local clientkeys = gears.table.join( c.maximized_horizontal = not c.maximized_horizontal c:raise() end , - {description = "(un)maximize horizontally", group = "client"}) -) + {description = "(un)maximize horizontally", group = "client"}), + awful.key({ global.modkey }, "v", + function (c) + c.menu_button:emit_signal("button::press") + end, + {description = "show client context menu", group = "client"}) +) return clientkeys diff --git a/core/signals.lua b/core/signals.lua index a29a6c6..86e27c8 100644 --- a/core/signals.lua +++ b/core/signals.lua @@ -7,6 +7,11 @@ client.connect_signal("manage", function (c) -- Set the windows at the slave, -- i.e. put it at the end of others instead of setting it master. -- if not awesome.startup then awful.client.setslave(c) end + -- Set fallback icon + if not c.icon then + print(c.icon_name) + c.icon = beautiful.fallback_icon._native + end if awesome.startup and not c.size_hints.user_position diff --git a/core/titlebar.lua b/core/titlebar.lua index af98678..45662df 100644 --- a/core/titlebar.lua +++ b/core/titlebar.lua @@ -43,6 +43,47 @@ awful.screen.connect_for_each_screen(function(s) toggle_tags }) end) +local controls_widget = wibox.widget { + forced_width = 72, + forced_height = 24, + layout = wibox.layout.fixed.horizontal, +} +-- To conserve memory we keep one menu at a time +local menu_widget = menu({ + before = { + controls_widget + }, + after = { + require("widgets.client-volume")({}) + }, + items = { + { "Move to tag" , + move_screentags + }, + { "Toggle on tag", + toggle_screentags + }, + { "Stop task", + function() + awful.spawn("kill "..tostring(c.pid)) + end + }, + { "Kill task", + function() + awful.spawn("kill -s KILL "..tostring(c.pid)) + end + }, + { "Debug info", + { + before = { + require("widgets.window-debug")() + } + } + } + }, + vertical = true +}) + return function(c) local buttons = gears.table.join( awful.button({ }, 1, function() @@ -54,35 +95,26 @@ return function(c) awful.mouse.client.resize(c) end) ) - c.menu = menu({ - before = { - { - awful.titlebar.widget.floatingbutton (c), - awful.titlebar.widget.stickybutton (c), - awful.titlebar.widget.ontopbutton (c), - forced_width = 72, - forced_height = 24, - layout = wibox.layout.fixed.horizontal, - } - }, - items = { - { "Move to tag" , - move_screentags - }, - { "Toggle on tag", - toggle_screentags - } - }, - vertical = true - }) c.menu_button = awful.titlebar.widget.iconwidget(c) + -- A little trick we do to conserve memory and cpu usage on regenerating + -- buttons is we pop up a menu in the location of the icon + -- and insert buttons into the controls widget layout. + c.hidden_floatingbutton = awful.titlebar.widget.floatingbutton(c) + c.hidden_stickybutton = awful.titlebar.widget.stickybutton(c) + c.hidden_ontopbutton = awful.titlebar.widget.ontopbutton(c) c.menu_button:connect_signal("button::press", function() - c.menu.toggle() + menu_widget.toggle() + if controls_widget then + controls_widget:reset() + controls_widget:add(c.hidden_floatingbutton) + controls_widget:add(c.hidden_stickybutton) + controls_widget:add(c.hidden_ontopbutton) + end c:emit_signal("request::activate", "titlebar", {raise = true}) end) c:connect_signal("unfocus",function() - if c.menu.visible then - c.menu.toggle(0,0) + if menu_widget.visible then + menu_widget.toggle(0,0) end end) return awful.titlebar(c) : setup { diff --git a/core/widgets/menu.lua b/core/widgets/menu.lua index cb4b088..2e12839 100644 --- a/core/widgets/menu.lua +++ b/core/widgets/menu.lua @@ -36,8 +36,8 @@ table.insert(after_table,{ resize = true },{ bg = style.powercontrol_button_bg_focus, - forced_width = 24, - forced_height = 24 + forced_width = style.powercontrol_button_width, + forced_height = style.powercontrol_button_height },{ function() awful.spawn("loginctl poweroff") @@ -49,8 +49,8 @@ table.insert(after_table,{ resize = true, },{ bg = style.powercontrol_button_bg_focus, - forced_width = 24, - forced_height = 24 + forced_width = style.powercontrol_button_width, + forced_height = style.powercontrol_button_height },{ function() awful.spawn("loginctl suspend") @@ -62,8 +62,8 @@ table.insert(after_table,{ resize = true, },{ bg = style.powercontrol_button_bg_focus, - forced_width = 24, - forced_height = 24 + forced_width = style.powercontrol_button_width, + forced_height = style.powercontrol_button_height },{ function() awesome.emit_signal("lock_screen") diff --git a/libs/awmtk.lua b/libs/awmtk.lua index 66da82d..0966e67 100644 --- a/libs/awmtk.lua +++ b/libs/awmtk.lua @@ -256,6 +256,14 @@ defaults.icon_inner_margin = beautiful.icon_inner_margin or 0 defaults.container_spacing = defaults.container_spacing or 2 defaults.container_spacing_vertical = defaults.container_spacing_vertical or defaults.container_spacing defaults.container_spacing_horizontal = defaults.container_spacing_horizontal or defaults.container_spacing +--add button size defaults +defaults.button_size = 20 +defaults.button_height = defaults.button_size +defaults.button_width = defaults.button_size +--add icon size defaults +defaults.icon_size = 20 +defaults.icon_height = defaults.icon_size +defaults.icon_width = defaults.icon_size -- Templates for quick widget generation defaults.button_widget = defaults.button_widget or function(style) return { diff --git a/presets/carbon-gnome/layout.lua b/presets/carbon-gnome/core/layout.lua similarity index 98% rename from presets/carbon-gnome/layout.lua rename to presets/carbon-gnome/core/layout.lua index faf5f8f..b038f8e 100644 --- a/presets/carbon-gnome/layout.lua +++ b/presets/carbon-gnome/core/layout.lua @@ -87,7 +87,6 @@ awful.screen.connect_for_each_screen(function(s) --require("widgets.polylauncher")({vertical = false}), --s.mytaglist, s.mypromptbox, - require("widgets.wintitle")({}), spacing = 3 }, -- Middle widget diff --git a/presets/carbon-gnome/titlebar.lua b/presets/carbon-gnome/core/titlebar.lua similarity index 100% rename from presets/carbon-gnome/titlebar.lua rename to presets/carbon-gnome/core/titlebar.lua diff --git a/presets/carbon-gnome/vars.lua b/presets/carbon-gnome/core/vars.lua similarity index 100% rename from presets/carbon-gnome/vars.lua rename to presets/carbon-gnome/core/vars.lua diff --git a/presets/carbon-xfce/layout.lua b/presets/carbon-xfce/core/layout.lua similarity index 100% rename from presets/carbon-xfce/layout.lua rename to presets/carbon-xfce/core/layout.lua diff --git a/presets/carbon-xfce/titlebar.lua b/presets/carbon-xfce/core/titlebar.lua similarity index 100% rename from presets/carbon-xfce/titlebar.lua rename to presets/carbon-xfce/core/titlebar.lua diff --git a/presets/carbon-xfce/vars.lua b/presets/carbon-xfce/core/vars.lua similarity index 100% rename from presets/carbon-xfce/vars.lua rename to presets/carbon-xfce/core/vars.lua diff --git a/presets/ubuntu-11.10/core/layout.lua b/presets/ubuntu-11.10/core/layout.lua index 61de031..64e23a4 100644 --- a/presets/ubuntu-11.10/core/layout.lua +++ b/presets/ubuntu-11.10/core/layout.lua @@ -87,11 +87,6 @@ awful.screen.connect_for_each_screen(function(s) --require("widgets.polylauncher")({vertical = false}), --s.mytaglist, s.mypromptbox, - require("widgets.current_window")({ - style = { - icon_bg_normal = beautiful.topbar_bg - } - }), spacing = 3 }, -- Middle widget diff --git a/presets/ubuntu-11.10/core/titlebar.lua b/presets/ubuntu-11.10/core/titlebar.lua index af98678..45662df 100644 --- a/presets/ubuntu-11.10/core/titlebar.lua +++ b/presets/ubuntu-11.10/core/titlebar.lua @@ -43,6 +43,47 @@ awful.screen.connect_for_each_screen(function(s) toggle_tags }) end) +local controls_widget = wibox.widget { + forced_width = 72, + forced_height = 24, + layout = wibox.layout.fixed.horizontal, +} +-- To conserve memory we keep one menu at a time +local menu_widget = menu({ + before = { + controls_widget + }, + after = { + require("widgets.client-volume")({}) + }, + items = { + { "Move to tag" , + move_screentags + }, + { "Toggle on tag", + toggle_screentags + }, + { "Stop task", + function() + awful.spawn("kill "..tostring(c.pid)) + end + }, + { "Kill task", + function() + awful.spawn("kill -s KILL "..tostring(c.pid)) + end + }, + { "Debug info", + { + before = { + require("widgets.window-debug")() + } + } + } + }, + vertical = true +}) + return function(c) local buttons = gears.table.join( awful.button({ }, 1, function() @@ -54,35 +95,26 @@ return function(c) awful.mouse.client.resize(c) end) ) - c.menu = menu({ - before = { - { - awful.titlebar.widget.floatingbutton (c), - awful.titlebar.widget.stickybutton (c), - awful.titlebar.widget.ontopbutton (c), - forced_width = 72, - forced_height = 24, - layout = wibox.layout.fixed.horizontal, - } - }, - items = { - { "Move to tag" , - move_screentags - }, - { "Toggle on tag", - toggle_screentags - } - }, - vertical = true - }) c.menu_button = awful.titlebar.widget.iconwidget(c) + -- A little trick we do to conserve memory and cpu usage on regenerating + -- buttons is we pop up a menu in the location of the icon + -- and insert buttons into the controls widget layout. + c.hidden_floatingbutton = awful.titlebar.widget.floatingbutton(c) + c.hidden_stickybutton = awful.titlebar.widget.stickybutton(c) + c.hidden_ontopbutton = awful.titlebar.widget.ontopbutton(c) c.menu_button:connect_signal("button::press", function() - c.menu.toggle() + menu_widget.toggle() + if controls_widget then + controls_widget:reset() + controls_widget:add(c.hidden_floatingbutton) + controls_widget:add(c.hidden_stickybutton) + controls_widget:add(c.hidden_ontopbutton) + end c:emit_signal("request::activate", "titlebar", {raise = true}) end) c:connect_signal("unfocus",function() - if c.menu.visible then - c.menu.toggle(0,0) + if menu_widget.visible then + menu_widget.toggle(0,0) end end) return awful.titlebar(c) : setup { diff --git a/presets/ubuntu-20.04/core/layout.lua b/presets/ubuntu-20.04/core/layout.lua index 6f90671..825f249 100644 --- a/presets/ubuntu-20.04/core/layout.lua +++ b/presets/ubuntu-20.04/core/layout.lua @@ -78,11 +78,6 @@ awful.screen.connect_for_each_screen(function(s) --require("widgets.polylauncher")({vertical = false}), --s.mytaglist, s.mypromptbox, - require("widgets.current_window")({ - style = { - icon_bg_normal = beautiful.topbar_bg - } - }), spacing = 3 }, -- Middle widget diff --git a/presets/ubuntu-20.04/core/titlebar.lua b/presets/ubuntu-20.04/core/titlebar.lua index 6eb210c..1824330 100644 --- a/presets/ubuntu-20.04/core/titlebar.lua +++ b/presets/ubuntu-20.04/core/titlebar.lua @@ -43,6 +43,47 @@ awful.screen.connect_for_each_screen(function(s) toggle_tags }) end) +local controls_widget = wibox.widget { + forced_width = 72, + forced_height = 24, + layout = wibox.layout.fixed.horizontal, +} +-- To conserve memory we keep one menu at a time +local menu_widget = menu({ + before = { + controls_widget + }, + after = { + require("widgets.client-volume")({}) + }, + items = { + { "Move to tag" , + move_screentags + }, + { "Toggle on tag", + toggle_screentags + }, + { "Stop task", + function() + awful.spawn("kill "..tostring(c.pid)) + end + }, + { "Kill task", + function() + awful.spawn("kill -s KILL "..tostring(c.pid)) + end + }, + { "Debug info", + { + before = { + require("widgets.window-debug")() + } + } + } + }, + vertical = true +}) + return function(c) local buttons = gears.table.join( awful.button({ }, 1, function() @@ -54,35 +95,26 @@ return function(c) awful.mouse.client.resize(c) end) ) - c.menu = menu({ - before = { - { - awful.titlebar.widget.floatingbutton (c), - awful.titlebar.widget.stickybutton (c), - awful.titlebar.widget.ontopbutton (c), - forced_width = 72, - forced_height = 24, - layout = wibox.layout.fixed.horizontal, - } - }, - items = { - { "Move to tag" , - move_screentags - }, - { "Toggle on tag", - toggle_screentags - } - }, - vertical = true - }) c.menu_button = awful.titlebar.widget.iconwidget(c) + -- A little trick we do to conserve memory and cpu usage on regenerating + -- buttons is we pop up a menu in the location of the icon + -- and insert buttons into the controls widget layout. + c.hidden_floatingbutton = awful.titlebar.widget.floatingbutton(c) + c.hidden_stickybutton = awful.titlebar.widget.stickybutton(c) + c.hidden_ontopbutton = awful.titlebar.widget.ontopbutton(c) c.menu_button:connect_signal("button::press", function() - c.menu.toggle() + menu_widget.toggle() + if controls_widget then + controls_widget:reset() + controls_widget:add(c.hidden_floatingbutton) + controls_widget:add(c.hidden_stickybutton) + controls_widget:add(c.hidden_ontopbutton) + end c:emit_signal("request::activate", "titlebar", {raise = true}) end) c:connect_signal("unfocus",function() - if c.menu.visible then - c.menu.toggle(0,0) + if menu_widget.visible then + menu_widget.toggle(0,0) end end) return awful.titlebar(c) : setup { diff --git a/rc.lua b/rc.lua index ca08770..04ec5df 100644 --- a/rc.lua +++ b/rc.lua @@ -28,7 +28,6 @@ require("awful.hotkeys_popup.keys") require("core.error") require("core.vars") require("core.style") -require("themes.icons") require("core.binds") require("core.layout") require("core.rules") diff --git a/themes/carbon/icons/fallback-application.svg b/themes/carbon/icons/fallback-application.svg new file mode 100644 index 0000000..1ccb52f --- /dev/null +++ b/themes/carbon/icons/fallback-application.svg @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/carbon/theme.lua b/themes/carbon/theme.lua index a293cf5..8bcbb27 100644 --- a/themes/carbon/theme.lua +++ b/themes/carbon/theme.lua @@ -47,6 +47,9 @@ theme.border_width = dpi(1) theme.border_normal = theme.bg_normal theme.border_focus = theme.bg_focus theme.border_marked = theme.bg_marked +-- include generic boilerplate +theme = require("themes.generic")(theme) + -- }}} -- All of the previous variables are still avaialable. @@ -404,6 +407,8 @@ theme.layout_cornersw = global.themes_dir..theme.name.."/layouts/cornersww.png" theme.layout_cornerse = global.themes_dir..theme.name.."/layouts/cornersew.png" theme_assets.recolor_layout(theme, theme.fg_normal) +theme = require("themes.icons")(theme) + -- Generate Awesome icon: theme.awesome_icon = theme_assets.awesome_icon( theme.menu_height, theme.bg_focus, theme.fg_focus diff --git a/themes/generic.lua b/themes/generic.lua new file mode 100644 index 0000000..96b28fd --- /dev/null +++ b/themes/generic.lua @@ -0,0 +1,25 @@ +--Shared code for include generic sizes for things +local dpi = require("beautiful.xresources").apply_dpi +return function(theme) + -- Notification size + theme.notification_width = dpi(250) + theme.notification_height = dpi(80) + theme.mailbox_container_width = dpi(260) + theme.mailbox_button_height = dpi(50) + + -- Wallpaper widget sizes + theme.wallpapers_button_height = dpi(60) + theme.wallpapers_button_width = dpi(100) + theme.wallpapers_pager_container_spacing_vertical = dpi(5) + theme.wallpapers_pager_container_spacing_horizontal = dpi(5) + theme.wallpapers_pager_button_size = dpi(15) + + -- Menus + theme.menu_button_height = 20 + theme.menu_button_width = 140 + + -- Power management icons + theme.powercontrol_button_height = 25 + theme.powercontrol_button_width = 25 + return theme +end diff --git a/themes/icons.lua b/themes/icons.lua index f53c1a7..ea6b44e 100644 --- a/themes/icons.lua +++ b/themes/icons.lua @@ -1,55 +1,60 @@ +-- Shared code for including icons -- Icons definitions for custom widgets local beautiful = require("beautiful") local beautiful_assets = require("beautiful").theme_assets local gears = require("gears") -function beautiful.recolor_icon_group(tbl,regex,color) +function beautiful.recolor_icon_group(tbl,write_to,regex,color) for k,v in pairs(tbl) do if k:match(regex) then - beautiful[k] = gears.color.recolor_image(v,color) + write_to[k] = gears.color.recolor_image(v,color) end end end --- Define dir to icons global.themes_dir = global.themes_dir or (os.getenv("HOME").."/.config/awesome/themes/") -beautiful.name = beautiful.name or "default" -beautiful.icon_dir = beautiful.icon_dir or global.themes_dir..beautiful.name.."/icons/" -local temp = {} --- Powermenu icons -temp.powercontrol_icon_shutdown = beautiful.icon_dir.."shutdown.svg" -temp.powercontrol_icon_suspend = beautiful.icon_dir.."suspend.svg" -temp.powercontrol_icon_lock = beautiful.icon_dir.."lock.svg" -beautiful.recolor_icon_group(temp,"^powercontrol_.+",beautiful.fg_normal) +return function(theme) + local temp = {} + -- Define dir to icons + theme.icon_dir = theme.icon_dir or global.themes_dir..theme.name.."/icons/" + -- Powermenu icons + temp.powercontrol_icon_shutdown = theme.icon_dir.."shutdown.svg" + temp.powercontrol_icon_suspend = theme.icon_dir.."suspend.svg" + temp.powercontrol_icon_lock = theme.icon_dir.."lock.svg" + beautiful.recolor_icon_group(temp,theme,"^powercontrol_.+",theme.fg_normal) + -- Volume icons + temp.volume_icon_high = theme.icon_dir.."volume-high.svg" + temp.volume_icon_medium = theme.icon_dir.."volume-medium.svg" + temp.volume_icon_low = theme.icon_dir.."volume-low.svg" + temp.volume_icon_muted = theme.icon_dir.."volume-muted.svg" + beautiful.recolor_icon_group(temp,theme,"^volume_.+",theme.fg_normal) + + -- Battery icons + temp.battery_caution_charging_symbolic = theme.icon_dir.."battery-caution-charging-symbolic.svg" + temp.battery_caution_symbolic = theme.icon_dir.."battery-caution-symbolic.svg" + temp.battery_empty_charging_symbolic = theme.icon_dir.."battery-empty-charging-symbolic.svg" + temp.battery_empty_symbolic = theme.icon_dir.."battery-empty-symbolic.svg" + temp.battery_full_charged_symbolic = theme.icon_dir.."battery-full-charged-symbolic.svg" + temp.battery_full_charging_symbolic = theme.icon_dir.."battery-full-charging-symbolic.svg" + temp.battery_full_symbolic = theme.icon_dir.."battery-full-symbolic.svg" + temp.battery_good_charging_symbolic = theme.icon_dir.."battery-good-charging-symbolic.svg" + temp.battery_good_symbolic = theme.icon_dir.."battery-good-symbolic.svg" + temp.battery_low_charging_symbolic = theme.icon_dir.."battery-low-charging-symbolic.svg" + temp.battery_low_symbolic = theme.icon_dir.."battery-low-symbolic.svg" + temp.battery_missing_symbolic = theme.icon_dir.."battery-missing-symbolic.svg" + beautiful.recolor_icon_group(temp,theme,"^battery_.+",theme.fg_normal) + + -- Widget icons + theme.wallpapers_icon = gears.color.recolor_image(theme.icon_dir.."wallpaper.svg",theme.fg_normal) + theme.mailbox_icon = gears.color.recolor_image(theme.icon_dir.."mail.svg",theme.fg_normal) + theme.username_logout_icon = gears.color.recolor_image(theme.icon_dir.."system-log-out-symbolic.svg",theme.fg_normal) + theme.drawer_open_icon = gears.color.recolor_image(theme.icon_dir.."drawer-open.svg",theme.fg_normal) + theme.drawer_closed_icon = gears.color.recolor_image(theme.icon_dir.."drawer-closed.svg",theme.fg_normal) + + -- Generic icons + theme.warning_icon = gears.color.recolor_image(theme.icon_dir.."warning.svg",theme.fg_normal) + + -- Fallback application icon + theme.fallback_icon = gears.color.recolor_image(theme.icon_dir.."fallback-application.svg",theme.fg_normal) --- Volume icons -temp.volume_icon_high = beautiful.icon_dir.."volume-high.svg" -temp.volume_icon_medium = beautiful.icon_dir.."volume-medium.svg" -temp.volume_icon_low = beautiful.icon_dir.."volume-low.svg" -temp.volume_icon_muted = beautiful.icon_dir.."volume-muted.svg" -beautiful.recolor_icon_group(temp,"^volume_.+",beautiful.fg_normal) - --- Battery icons -temp.battery_caution_charging_symbolic = beautiful.icon_dir.."battery-caution-charging-symbolic.svg" -temp.battery_caution_symbolic = beautiful.icon_dir.."battery-caution-symbolic.svg" -temp.battery_empty_charging_symbolic = beautiful.icon_dir.."battery-empty-charging-symbolic.svg" -temp.battery_empty_symbolic = beautiful.icon_dir.."battery-empty-symbolic.svg" -temp.battery_full_charged_symbolic = beautiful.icon_dir.."battery-full-charged-symbolic.svg" -temp.battery_full_charging_symbolic = beautiful.icon_dir.."battery-full-charging-symbolic.svg" -temp.battery_full_symbolic = beautiful.icon_dir.."battery-full-symbolic.svg" -temp.battery_good_charging_symbolic = beautiful.icon_dir.."battery-good-charging-symbolic.svg" -temp.battery_good_symbolic = beautiful.icon_dir.."battery-good-symbolic.svg" -temp.battery_low_charging_symbolic = beautiful.icon_dir.."battery-low-charging-symbolic.svg" -temp.battery_low_symbolic = beautiful.icon_dir.."battery-low-symbolic.svg" -temp.battery_missing_symbolic = beautiful.icon_dir.."battery-missing-symbolic.svg" -beautiful.recolor_icon_group(temp,"^battery_.+",beautiful.fg_normal) - --- Widget icons -beautiful.wallpapers_icon = gears.color.recolor_image(beautiful.icon_dir.."wallpaper.svg",beautiful.fg_normal) -beautiful.mailbox_icon = gears.color.recolor_image(beautiful.icon_dir.."mail.svg",beautiful.fg_normal) -beautiful.username_logout_icon = gears.color.recolor_image(beautiful.icon_dir.."system-log-out-symbolic.svg",beautiful.fg_normal) -beautiful.drawer_open_icon = gears.color.recolor_image(beautiful.icon_dir.."drawer-open.svg",beautiful.fg_normal) -beautiful.drawer_closed_icon = gears.color.recolor_image(beautiful.icon_dir.."drawer-closed.svg",beautiful.fg_normal) --- Generic icons -print(beautiful.icon_dir.."warning.svg") -beautiful.warning_icon = gears.color.recolor_image(beautiful.icon_dir.."warning.svg",beautiful.fg_normal) - + return theme +end diff --git a/themes/unity/icons/fallback-application.svg b/themes/unity/icons/fallback-application.svg new file mode 100644 index 0000000..1ccb52f --- /dev/null +++ b/themes/unity/icons/fallback-application.svg @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/unity/icons/warning.svg b/themes/unity/icons/warning.svg new file mode 100644 index 0000000..3db37e7 --- /dev/null +++ b/themes/unity/icons/warning.svg @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/unity/theme.lua b/themes/unity/theme.lua index 87b6c00..5072624 100644 --- a/themes/unity/theme.lua +++ b/themes/unity/theme.lua @@ -7,14 +7,6 @@ local theme = {} theme.name = "unity" theme.font = "Ubuntu Regular 10" -theme.icon_rounding = 5 -theme.volume_slider_width = 60 -theme.username_container_spacing_horizontal = 3 -theme.macbar_rounding = 5 -theme.macbar_height = 45 -theme.menu_button_inner_margin = 2 -theme.container_rounding = 4 -theme.button_rounding = 4 theme.bg_normal = "#19191D" theme.bg_focus = "#3E3E3E" theme.bg_urgent = "#2E2E2E" @@ -32,14 +24,22 @@ theme.border_normal = theme.bg_focus theme.border_focus = theme.bg_focus theme.border_marked = theme.bg_marked +-- style +theme.button_rounding = dpi(4) +theme.icon_rounding = dpi(4) +theme.container_rounding = dpi(4) + -- unitybar theme.unitybar_width = dpi(60) theme.unitybar_bg = "#0D0D0966" -theme.unitybar_border_width = 1 +theme.unitybar_border_width = dpi(1) theme.unitybar_border_color = "#26262666" -theme.unitybar_inner_margin = 3 +theme.unitybar_inner_margin = dpi(3) local bsize = theme.unitybar_width - (theme.unitybar_inner_margin*2) +-- boilerplate +theme = require("themes.generic")(theme) + theme.tasklist_button_shape_border_width = dpi(1) theme.tasklist_button_shape_border_color = { type = "radial", @@ -105,17 +105,8 @@ theme.launcher_button_bg_normal = { { 1, "#FFFFFF22"} } } --- overriding the default one when --- defined, the sets are: --- taglist_[bg|fg]_[focus|urgent|occupied|empty|volatile] --- tasklist_[bg|fg]_[focus|urgent] --- titlebar_[bg|fg]_[normal|focus] --- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] --- mouse_finder_[color|timeout|animate_timeout|radius|factor] --- prompt_[fg|bg|fg_cursor|bg_cursor|font] --- hotkeys_[bg|fg|border_width|border_color|shape|opacity|modifiers_fg|label_bg|label_fg|group_margin|font|description_font] --- Example: ---theme.taglist_bg_focus = "#ff0000" + + theme.hotkeys_border_color = "#262626" theme.hotkeys_opacity = 1 @@ -140,16 +131,15 @@ theme.topbar_bg = { stops = { { 0, "#3C3B37"} , { 1 , "#545249"} } } -theme.titlebar_rounding = 6 -theme.bg_systray = "#3A3A36" -theme.prompt_bg = theme.topbar_bg -theme.wintitle_icon_bg_normal = theme.topbar_bg +theme.lockscreen_bar_bg = theme.topbar_bg theme.wallpapers_icon_bg_normal = theme.topbar_bg theme.mailbox_icon_bg_normal = theme.topbar_bg theme.volume_icon_bg_normal = theme.topbar_bg +theme.drawer_icon_bg_normal = theme.topbar_bg theme.battery_icon_bg_normal = theme.topbar_bg theme.username_icon_bg_normal = theme.topbar_bg -theme.drawer_icon_bg_normal = theme.topbar_bg +theme.titlebar_rounding = dpi(6) +theme.bg_systray = "#3A3A36" -- Generate taglist squares: local taglist_square_size = dpi(4) theme.taglist_squares_sel = theme_assets.taglist_squares_sel( @@ -226,6 +216,9 @@ theme.layout_cornersw = global.themes_dir..theme.name.."/layouts/cornersww.png" theme.layout_cornerse = global.themes_dir..theme.name.."/layouts/cornersew.png" theme_assets.recolor_layout(theme, theme.fg_normal) +-- Include boilerplate icons and variables +theme = require("themes.icons")(theme) + -- Generate Awesome icon: theme.awesome_icon = theme_assets.awesome_icon( theme.menu_height, theme.bg_focus, theme.fg_focus diff --git a/themes/unity2/icons/fallback-application.svg b/themes/unity2/icons/fallback-application.svg new file mode 100644 index 0000000..1ccb52f --- /dev/null +++ b/themes/unity2/icons/fallback-application.svg @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/unity2/icons/warning.svg b/themes/unity2/icons/warning.svg new file mode 100644 index 0000000..3db37e7 --- /dev/null +++ b/themes/unity2/icons/warning.svg @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/unity2/theme.lua b/themes/unity2/theme.lua index 29cb243..c6c0659 100644 --- a/themes/unity2/theme.lua +++ b/themes/unity2/theme.lua @@ -45,6 +45,8 @@ theme.mailbox_button_bg_focus = "#464646" theme.powercontrol_button_bg_focus = "#464646" theme.taglist_bg_focus = "#464646" +theme = require("themes.generic")(theme) + -- There are other variable sets -- overriding the default one when @@ -149,6 +151,9 @@ theme.layout_cornersw = global.themes_dir..theme.name.."/layouts/cornersww.png" theme.layout_cornerse = global.themes_dir..theme.name.."/layouts/cornersew.png" theme_assets.recolor_layout(theme, theme.fg_normal) +-- Include boilerplate icons +theme = require("themes.icons")(theme) + -- Generate Awesome icon: theme.awesome_icon = theme_assets.awesome_icon( theme.menu_height, theme.bg_focus, theme.fg_focus diff --git a/themes/unity_simplified/icons/fallback-application.svg b/themes/unity_simplified/icons/fallback-application.svg new file mode 100644 index 0000000..1ccb52f --- /dev/null +++ b/themes/unity_simplified/icons/fallback-application.svg @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/unity_simplified/icons/warning.svg b/themes/unity_simplified/icons/warning.svg new file mode 100644 index 0000000..3db37e7 --- /dev/null +++ b/themes/unity_simplified/icons/warning.svg @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/unity_simplified/theme.lua b/themes/unity_simplified/theme.lua index 72ea0e3..db5a6cf 100644 --- a/themes/unity_simplified/theme.lua +++ b/themes/unity_simplified/theme.lua @@ -40,6 +40,9 @@ theme.unitybar_border_color = "#26262666" theme.unitybar_inner_margin = 3 local bsize = theme.unitybar_width - (theme.unitybar_inner_margin*2) +-- generic +theme = require('themes.generic')(theme) + theme.tasklist_button_shape_border_width = dpi(1) theme.tasklist_button_shape_border_color = { type = "linear", @@ -226,6 +229,9 @@ theme.layout_cornersw = global.themes_dir..theme.name.."/layouts/cornersww.png" theme.layout_cornerse = global.themes_dir..theme.name.."/layouts/cornersew.png" theme_assets.recolor_layout(theme, theme.fg_normal) +-- Include boilerplate icons +theme = require("themes.icons")(theme) + -- Generate Awesome icon: theme.awesome_icon = theme_assets.awesome_icon( theme.menu_height, theme.bg_focus, theme.fg_focus diff --git a/widgets/mailbox.lua b/widgets/mailbox.lua index 8ad5d2b..2579f24 100644 --- a/widgets/mailbox.lua +++ b/widgets/mailbox.lua @@ -11,7 +11,6 @@ return function(args) -- Set up style variables style = awmtk.style(awmtk.defaults,args.style or {},"mailbox_") style.mailbox_container_width = style.mailbox_container_width or 260 - style.mailbox_button_height = style.mailbox_button_heihgt or 40 args.mail_limit = args.mail_limit or 8 -- Create a notifications list local notifications_list = wibox.widget { @@ -59,7 +58,6 @@ return function(args) (update_args.icon and { image = update_args.icon, resize = true, - forced_height = style.mailbox_button_height, widget = wibox.widget.imagebox }), { @@ -67,13 +65,13 @@ return function(args) (update_args.title or "").. "\n"..(update_args.text or ""), widget = wibox.widget.textbox, - forced_height = style.mailbox_button_height }, layout = wibox.layout.fixed.horizontal },{ bg = style.mailbox_button_bg_focus, shape = style.mailbox_container_shape, - border_width = style.mailbox_button_border_width + border_width = style.mailbox_button_border_width, + forced_height = style.mailbox_button_height },{ function() clip = io.open("/tmp/clip","w") @@ -84,6 +82,9 @@ return function(args) end } )) + if #notifications_list.children > args.mail_limit then + notifications_list:remove(#notifications_list.children) + end for s in screen do s.notify_widget.bg = style.mailbox_button_bg_focus end diff --git a/widgets/pager.lua b/widgets/pager.lua index 955ead5..a0bcd4d 100644 --- a/widgets/pager.lua +++ b/widgets/pager.lua @@ -21,7 +21,7 @@ return function(widget,list,max_elements) end end function new_pager:next() - if #list > self.index*self.max then + if #list >= self.index*self.max then self.index = self.index + 1 new_pager:update() end diff --git a/widgets/volume.lua b/widgets/volume.lua index b905fbd..08ca33e 100644 --- a/widgets/volume.lua +++ b/widgets/volume.lua @@ -33,7 +33,7 @@ return function(args) get = "amixer -D "..device.." sget " } local list = { - layout = wibox.layout.fixed.horizontal + layout = wibox.layout.fixed.vertical } for k,v in pairs(controls) do local widget = wibox.widget({ @@ -44,23 +44,19 @@ return function(args) font = style.volume_font }, { - { - widget = wibox.widget.slider, - id = "widget_slider", - handle_width = style.volume_handle_width or 6, - bar_height = style.volumer_bar_width or 5, - bar_color = style.volume_bar_color or "#55CC60", - bar_shape = style.bar_shape, - handler_shape = style.handle_shape, - value = 100, - }, - widget = wibox.container.rotate, - direction = "east" + widget = wibox.widget.slider, + id = "widget_slider", + handle_width = style.volume_handle_width or 6, + bar_height = style.volumer_bar_width or 5, + bar_color = style.volume_bar_color or "#55CC60", + bar_shape = style.bar_shape, + handler_shape = style.handle_shape, + value = 100, }, layout = wibox.layout.fixed.vertical, spacing = style.volume_container_spacing_horizontal, - forced_width = style.volume_slider_width or 40, - forced_height = style.volume_slider_height or 120 + forced_width = style.volume_slider_width or 180, + forced_height = style.volume_slider_height or 40 }) local slider = widget:get_children_by_id("widget_slider")[1] awful.spawn.easy_async_with_shell(commands.get..v,function(out) diff --git a/widgets/wallpapers.lua b/widgets/wallpapers.lua index 2723c00..d6ccfbc 100644 --- a/widgets/wallpapers.lua +++ b/widgets/wallpapers.lua @@ -74,16 +74,52 @@ local function worker(args) homogeneous = true, expand = true, orientation = "vertical", - spacing = 5 + spacing = style.wallpapers_container_spacing_vertical } - local pager = pager(copy_list,{},20) + local pager = pager(copy_list,{},((args.rows and args.columns) and args.rows*args.columns) or 20) for k,v in pairs(image_list) do local new_widget = new_wallpaper_button(v,args["screen"]) table.insert(pager.list,new_widget) end pager:update() + --create local substyle for pager buttons + local style = awmtk.style(awmtk.defaults,args.style or {},"wallpapers_pager_") local popup = awful.popup(style.container( - pager.page, + { + pager.page, + { + style.button({ + layout = wibox.layout.fixed.vertical + },{ + forced_width = style.wallpapers_pager_button_size, + forced_height = style.wallpapers_pager_button_size, + shape = gears.shape.isosceles_triangle, + bg = style.wallpapers_pager_button_bg_focus + },{ + function() + pager:prev() + end + }), + style.button({ + layout = wibox.layout.fixed.vertical + },{ + forced_width = style.wallpapers_pager_button_size, + forced_height = style.wallpapers_pager_button_size, + shape = function(cr,width,height) + gears.shape.transform(gears.shape.isosceles_triangle):rotate_at(width/2, height/2, math.pi)(cr,width,height) + end, + bg = style.wallpapers_pager_button_bg_focus + },{ + function() + pager:next() + end + }), + layout = wibox.layout.fixed.vertical, + spacing = style.wallpapers_pager_container_spacing_vertical + }, + layout = wibox.layout.fixed.horizontal, + spacing = style.wallpapers_pager_container_spacing_horizontal + }, { visible = false, ontop = true @@ -93,7 +129,9 @@ local function worker(args) image = style["wallpapers_icon"], resize = true, widget = wibox.widget.imagebox - },{},{ + },{ + bg = style.wallpapers_icon_bg_normal + },{ function() if popup.visible then popup.visible = not popup.visible diff --git a/widgets/window-debug.lua b/widgets/window-debug.lua index 759477e..dbf1507 100644 --- a/widgets/window-debug.lua +++ b/widgets/window-debug.lua @@ -8,6 +8,9 @@ local function ellipsize(t) end end local function generate_text(c) + if not global.debug then + return "Debug mode is disabled!\nAdd \"global.debug = true\"\nto core/vars.lua to enable it." + end local markup = "" for k,v in pairs(infotab) do markup = markup..tostring(v)..": "..ellipsize(tostring(c[v])).."\n"