]> git.rmz.io Git - dotfiles.git/blobdiff - awesome/rc.lua
add a shutdown menu
[dotfiles.git] / awesome / rc.lua
index cd711258408b31abeffdf7fd2c55fb968bc1b18d..cd9fb2d64919d7e2d94dbf7be2d0f74c236745ae 100644 (file)
@@ -67,6 +67,12 @@ end
 -- }}}
 
 -- {{{ Menu
+-- Setup global menu keys
+awful.menu.menu_keys.up    = { "k", "Up"}
+awful.menu.menu_keys.down  = { "j", "Down"}
+awful.menu.menu_keys.enter = { "l", "Right"}
+awful.menu.menu_keys.back  = { "h", "Left"}
+
 -- Create a laucher widget and a main menu
 myawesomemenu = {
    { "manual", terminal .. " -e man awesome" },
@@ -83,6 +89,12 @@ mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesom
 mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
                                      menu = mymainmenu })
 
+myshutdownmenu = awful.menu({ items = { { "shutdown", "systemctl poweroff" },
+                                        { "restart",  "systemctl restart"  },
+                                        { "suspend",  "systemctl suspend"  },
+                                      }
+                            })
+
 -- Menubar configuration
 menubar.utils.terminal = terminal -- Set the terminal for applications that require it
 -- }}}
@@ -122,6 +134,7 @@ mytasklist.buttons = awful.util.table.join(
                                                   c:raise()
                                               end
                                           end),
+                     awful.button({ }, 2, function (c) c:kill() end),
                      awful.button({ }, 3, function ()
                                               if instance then
                                                   instance:hide()
@@ -185,26 +198,8 @@ end
 -- Mouse/Key Bindings
 require("bindings")
 
--- {{{ Rules
-awful.rules.rules = {
-    -- All clients will match this rule.
-    { rule = { },
-      properties = { border_width = beautiful.border_width,
-                     border_color = beautiful.border_normal,
-                     focus = awful.client.focus.filter,
-                     keys = clientkeys,
-                     buttons = clientbuttons } },
-    { rule = { class = "MPlayer" },
-      properties = { floating = true } },
-    { rule = { class = "pinentry" },
-      properties = { floating = true } },
-    { rule = { class = "gimp" },
-      properties = { floating = true } },
-    -- Set Firefox to always map on tags number 2 of screen 1.
-    -- { rule = { class = "Firefox" },
-    --   properties = { tag = tags[1][2] } },
-}
--- }}}
+-- Rules
+require("rules")
 
 -- {{{ Signals
 -- Signal function to execute when a new client appears.