From 98d06fd4e848de306d03f4a98f4a1936af60b1a2 Mon Sep 17 00:00:00 2001 From: copycat-killer Date: Sun, 29 Jan 2017 18:23:52 +0100 Subject: [PATCH] holo: fixed main menu launcher --- rc.lua.template | 7 ++++--- themes/holo/theme.lua | 24 +++++++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/rc.lua.template b/rc.lua.template index 6eae48f..e03ddd8 100644 --- a/rc.lua.template +++ b/rc.lua.template @@ -166,7 +166,8 @@ local myawesomemenu = { { "restart", awesome.restart }, { "quit", function() awesome.quit() end } } -local mymainmenu = freedesktop.menu.build({ +awful.util.mymainmenu = freedesktop.menu.build({ + icon_size = beautiful.menu_icon_size or 16, before = { { "Awesome", myawesomemenu, beautiful.awesome_icon }, -- other triads can be put here @@ -198,7 +199,7 @@ awful.screen.connect_for_each_screen(function(s) beautiful.at_screen_connect(s) -- {{{ Mouse bindings root.buttons(awful.util.table.join( - awful.button({ }, 3, function () mymainmenu:toggle() end), + awful.button({ }, 3, function () awful.util.mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev) )) @@ -262,7 +263,7 @@ globalkeys = awful.util.table.join( awful.client.focus.bydirection("right") if client.focus then client.focus:raise() end end), - awful.key({ modkey, }, "w", function () mymainmenu:show() end, + awful.key({ modkey, }, "w", function () awful.util.mymainmenu:show() end, {description = "show main menu", group = "awesome"}), -- Layout manipulation diff --git a/themes/holo/theme.lua b/themes/holo/theme.lua index a27bc51..f799ed3 100644 --- a/themes/holo/theme.lua +++ b/themes/holo/theme.lua @@ -6,12 +6,12 @@ --]] -local gears = require("gears") -local lain = require("lain") -local awful = require("awful") -local wibox = require("wibox") -local string = string -local os = { getenv = os.getenv } +local gears = require("gears") +local lain = require("lain") +local awful = require("awful") +local wibox = require("wibox") +local string = string +local os = { getenv = os.getenv } local theme = {} theme.default_dir = require("awful.util").get_themes_dir() .. "default" @@ -33,8 +33,9 @@ theme.tasklist_bg_normal = "#222222" theme.tasklist_fg_focus = "#4CB7DB" theme.menu_height = 20 theme.menu_width = 160 -theme.awesome_icon = theme.icon_dir .. "/awesome_icon.png" -theme.awesome_icon_white = theme.icon_dir .. "/awesome_icon_white.png" +theme.menu_icon_size = 32 +theme.awesome_icon = theme.icon_dir .. "/awesome_icon_white.png" +theme.awesome_icon_launcher = theme.icon_dir .. "/awesome_icon.png" theme.vol_bg = theme.icon_dir .. "/vol_bg.png" theme.taglist_squares_sel = theme.icon_dir .. "/square_sel.png" theme.taglist_squares_unsel = theme.icon_dir .. "/square_unsel.png" @@ -265,6 +266,11 @@ theme.weather = lain.widgets.weather({ notification_preset = { font = "Monospace 9", position = "bottom_right" }, }) +-- Launcher +local mylauncher = awful.widget.button({ image = theme.awesome_icon_launcher }) +mylauncher:connect_signal("button::press", function() awful.util.mymainmenu:toggle() end) +--awful.widget.launcher({ image = theme.awesome_icon_launcher, command = awful.util.mymainmenu:toggle() }) + -- Separators local first = wibox.widget.textbox(' ') local spr_small = wibox.widget.imagebox(theme.spr_small) @@ -279,7 +285,7 @@ local barcolor = gears.color({ type = "linear", from = { 32, 0 }, to = { 32, 32 }, - stops = { {0, theme.bg_focus }, {0.25, "#505050"}, {1, theme.bg_focus} } + stops = { {0, theme.bg_focus}, {0.25, "#505050"}, {1, theme.bg_focus} } }) function theme.at_screen_connect(s)