xrandr.lua: Remove useless icon shuffling

There is only a single icon that this code ever uses. However, it goes
through lots of trouble to move that icon uselessly around. Remove that.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2017-01-28 17:57:21 +01:00
parent 96c2e6b43f
commit 49c4316959
1 changed files with 5 additions and 7 deletions

View File

@ -81,9 +81,7 @@ local function menu()
end
end
menu[#menu + 1] = { label,
cmd,
icon_path}
menu[#menu + 1] = { label, cmd }
end
return menu
@ -106,18 +104,18 @@ local function xrandr()
end
-- Select one and display the appropriate notification
local label, action, icon
local label, action
local next = state.menu[state.index]
state.index = state.index + 1
if not next then
label, icon = "Keep the current configuration", icon_path
label = "Keep the current configuration"
state.index = nil
else
label, action, icon = unpack(next)
label, action = unpack(next)
end
state.cid = naughty.notify({ text = label,
icon = icon,
icon = icon_path,
timeout = 4,
screen = mouse.screen,
replaces_id = state.cid }).id