From f58c878b96e8bc9b3873e913b95e48509e3c448a Mon Sep 17 00:00:00 2001 From: Damien Leone Date: Wed, 22 Oct 2008 14:30:33 +0200 Subject: [PATCH] awesomerc: added menu stuff Signed-off-by: Julien Danjou --- awesomerc.lua.in | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/awesomerc.lua.in b/awesomerc.lua.in index e75b17d98..f23bd3eb0 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -98,10 +98,23 @@ mytextbox = widget({ type = "textbox", name = "mytextbox", align = "right" }) -- Set the default text in textbox mytextbox.text = " " .. AWESOME_RELEASE .. " " --- Create a laucher widget +-- Create a laucher widget and a main menu +myawesomemenu = { + {"manual", terminal .. " -e man awesome"}, + {"edit config", terminal .. " -e nano ~/.config/awesome/rc.lua"}, + {"restart", "echo \"awesome.restart()\" | awesome-client"}, + {"quit", "echo \"awesome.quit()\" | awesome-client"} +} + +mymainmenu = { + {"awesome", myawesomemenu, "@AWESOME_ICON_PATH@/awesome16.png" }, + {"open terminal", terminal} +} + mylauncher = awful.widget.launcher({ name = "mylauncher", image = "@AWESOME_ICON_PATH@/awesome16.png", - command = terminal .. " -e man awesome"}) + menu = {"mymainmenu", mymainmenu} + }) -- Create a systray mysystray = widget({ type = "systray", name = "mysystray", align = "right" }) @@ -158,7 +171,7 @@ end -- {{{ Mouse bindings awesome.buttons({ - button({ }, 3, function () awful.util.spawn(terminal) end), + button({ }, 3, function () awful.menu.new("mymainmenu", mymainmenu) end), button({ }, 4, awful.tag.viewnext), button({ }, 5, awful.tag.viewprev) })