From 64bd09d38d9ccf7b04bf70ddad33264bf7fa2b87 Mon Sep 17 00:00:00 2001 From: actionless Date: Thu, 11 Feb 2016 00:54:47 +0100 Subject: [PATCH] fix(awful: hotkeys): fix sorting of hotkeys --- lib/awful/hotkeys_popup/widget.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/awful/hotkeys_popup/widget.lua b/lib/awful/hotkeys_popup/widget.lua index bbcc7915b..f247a5092 100644 --- a/lib/awful/hotkeys_popup/widget.lua +++ b/lib/awful/hotkeys_popup/widget.lua @@ -129,11 +129,6 @@ local function add_hotkey(key, data, target) table.insert(readable_mods, widget.labels[mod] or mod) end local joined_mods = join_plus_sort(readable_mods) - if joined_mods == "none" then - joined_mods = "" - else - joined_mods = markup.fg(widget.modifiers_color, joined_mods.."+") - end local group = data.group or "none" group_list[group] = true @@ -262,7 +257,13 @@ local function create_wibox(s, available_groups) local max_label_content = "" local joined_labels = "" for i, key in ipairs(_keys) do - local hotkey = (key.mod or '')..(key.key or '') + local modifiers = key.mod + if not modifiers or modifiers == "none" then + modifiers = "" + else + modifiers = markup.fg(widget.modifiers_color, modifiers.."+") + end + local hotkey = modifiers .. (key.key or '') local length = string.len(hotkey) + string.len(key.description) local rendered_hotkey = markup.font(widget.title_font, hotkey.." ") .. (markup.font(widget.description_font, key.description) or "")