1 local hotkeys_popup = require("awful.hotkeys_popup").widget
 
   8 root.buttons(awful.util.table.join(
 
   9     awful.button({ }, 3, function () mymainmenu:toggle() end)
 
  13 globalkeys = awful.util.table.join(globalkeys,
 
  14     awful.key({ modkey,           }, "s",      hotkeys_popup.show_help,
 
  15               {description="show help", group="awesome"}),
 
  16     awful.key({ modkey,           }, "Left",   awful.tag.viewprev,
 
  17               {description = "view previous", group = "tag"}),
 
  18     awful.key({ modkey,           }, "Down",   awful.tag.viewprev,
 
  19               {description = "view previous", group = "tag"}),
 
  20     awful.key({ modkey,           }, "Right",  awful.tag.viewnext,
 
  21               {description = "view next", group = "tag"}),
 
  22     awful.key({ modkey,           }, "Up",  awful.tag.viewnext,
 
  23               {description = "view next", group = "tag"}),
 
  24     awful.key({ modkey,           }, "Escape", awful.tag.history.restore,
 
  25               {description = "go back", group = "tag"}),
 
  27     awful.key({ modkey,           }, "k",
 
  29             awful.client.focus.byidx( 1)
 
  31         {description = "focus next by index", group = "client"}
 
  33     awful.key({ modkey,           }, "j",
 
  35             awful.client.focus.byidx(-1)
 
  37         {description = "focus previous by index", group = "client"}
 
  39     awful.key({ modkey,           }, "w", function () mymainmenu:show({ coords = { x = 0, y = 0}}) end,
 
  40               {description = "show main menu", group = "awesome"}),
 
  42     -- Layout manipulation
 
  43     awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end,
 
  44               {description = "swap with next client by index", group = "client"}),
 
  45     awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1)    end,
 
  46               {description = "swap with previous client by index", group = "client"}),
 
  47     awful.key({ modkey,         }, "#49",     function () awful.screen.focus_relative( 1) end, -- that's the key left of 1 (chronos)
 
  48               {description = "focus the next screen", group = "screen"}),
 
  49     awful.key({ modkey,           }, "=",     function () awful.screen.focus_relative( 1) end, -- that's the key left of 1 (kinesis)
 
  50               {description = "focus the next screen", group = "screen"}),
 
  51     awful.key({ modkey, "Control" }, "Right", function () awful.screen.focus_relative(-1) end,
 
  52               {description = "focus the next screen", group = "screen"}),
 
  53     awful.key({ modkey, "Control" }, "Left",  function () awful.screen.focus_relative(-1) end,
 
  54               {description = "focus the previous screen", group = "screen"}),
 
  55     awful.key({ modkey,           }, "u", awful.client.urgent.jumpto,
 
  56               {description = "jump to urgent client", group = "client"}),
 
  57     awful.key({ modkey,           }, "Tab",
 
  59             awful.client.focus.history.previous()
 
  64         {description = "go back", group = "client"}),
 
  67     awful.key({ modkey,           }, "Return", function () awful.spawn(terminal) end,
 
  68               {description = "open a terminal", group = "launcher"}),
 
  69     awful.key({ modkey, "Control" }, "r", awesome.restart,
 
  70               {description = "reload awesome", group = "awesome"}),
 
  72     awful.key({ modkey,           }, "h",     function () awful.tag.incmwfact(-0.05)          end,
 
  73               {description = "increase master width factor", group = "layout"}),
 
  74     awful.key({ modkey,           }, "l",     function () awful.tag.incmwfact( 0.05)          end,
 
  75               {description = "decrease master width factor", group = "layout"}),
 
  76     awful.key({ modkey, "Shift"   }, "h",     function () awful.tag.incnmaster( 1, nil, true) end,
 
  77               {description = "increase the number of master clients", group = "layout"}),
 
  78     awful.key({ modkey, "Shift"   }, "l",     function () awful.tag.incnmaster(-1, nil, true) end,
 
  79               {description = "decrease the number of master clients", group = "layout"}),
 
  80     awful.key({ modkey, "Control" }, "h",     function () awful.tag.incncol( 1, nil, true)    end,
 
  81               {description = "increase the number of columns", group = "layout"}),
 
  82     awful.key({ modkey, "Control" }, "l",     function () awful.tag.incncol(-1, nil, true)    end,
 
  83               {description = "decrease the number of columns", group = "layout"}),
 
  85     awful.key({ modkey, "Control" }, "j",     function () awful.client.incwfact( 0.05)  end,
 
  86               {description = "increase focused client window factor", group = "layout"}),
 
  87     awful.key({ modkey, "Control" }, "k",     function () awful.client.incwfact(-0.05)  end,
 
  88               {description = "decrease focused client window factor", group = "layout"}),
 
  90     -- switch between layouts
 
  91     awful.key({ modkey,           }, "]", function () awful.layout.inc( 1)                end,
 
  92               {description = "select next", group = "layout"}),
 
  93     awful.key({ modkey,           }, "[", function () awful.layout.inc(-1)                end,
 
  94               {description = "select previous", group = "layout"}),
 
  96     awful.key({ modkey, "Control" }, "n",
 
  98                   local c = awful.client.restore()
 
  99                   -- Focus restored client
 
 105               {description = "restore minimized", group = "client"}),
 
 108     awful.key({ modkey },            "space",     function () awful.screen.focused().mypromptbox:run() end,
 
 109               {description = "run prompt", group = "launcher"}),
 
 111     awful.key({ modkey }, "x",
 
 114                     prompt       = "Run Lua code: ",
 
 115                     textbox      = awful.screen.focused().mypromptbox.widget,
 
 116                     exe_callback = awful.util.eval,
 
 117                     history_path = awful.util.get_cache_dir() .. "/history_eval"
 
 120               {description = "lua execute prompt", group = "awesome"}),
 
 124     awful.key({        }, "F13",   function () awful.spawn("ksnapshot") end),
 
 125     awful.key({        }, "Print", function () awful.spawn("ksnapshot") end),
 
 127     awful.key({ modkey }, "r", function () awful.spawn(terminal .. " -e ranger") end),
 
 129     awful.key({        }, "XF86AudioMute",        function () awful.spawn("ponymix toggle")     end,
 
 130               {description = "toggle mute", group = "volume"}),
 
 131     awful.key({        }, "XF86AudioLowerVolume", function () awful.spawn("ponymix decrease 5") end,
 
 132               {description = "decrease volume", group = "volume"}),
 
 133     awful.key({        }, "XF86AudioRaiseVolume", function () awful.spawn("ponymix increase 5") end,
 
 134               {description = "increase volume", group = "volume"}),
 
 135     awful.key({ modkey }, "F10",                  function () awful.spawn("ponymix toggle")     end,
 
 136               {description = "toggle mute", group = "volume"}),
 
 137     awful.key({ modkey }, "F11",                  function () awful.spawn("ponymix decrease 5") end,
 
 138               {description = "decrease volume", group = "volume"}),
 
 139     awful.key({ modkey }, "F12",                  function () awful.spawn("ponymix increase 5") end,
 
 140               {description = "increase volume", group = "volume"}),
 
 142     awful.key({ modkey, "Control" }, "Escape", function () awful.spawn("i3lock -nc 000000") end),
 
 144     awful.key({ modkey }, "i", function ()
 
 145         awful.spawn(terminal.." -name vimwiki -e vim -c 'call vimwiki#base#goto_index(v:count1)'")
 
 150 clientkeys = awful.util.table.join(
 
 151     awful.key({ modkey,           }, "f",
 
 153             c.fullscreen = not c.fullscreen
 
 156         {description = "toggle fullscreen", group = "client"}),
 
 157     awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end,
 
 158               {description = "close", group = "client"}),
 
 159     awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ,
 
 160               {description = "toggle floating", group = "client"}),
 
 161     awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
 
 162               {description = "move to master", group = "client"}),
 
 163     awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end,
 
 164               {description = "toggle keep on top", group = "client"}),
 
 165     awful.key({ modkey,           }, "b",      function (c) c.below = not c.below            end,
 
 166               {description = "toggle keep below", group = "client"}),
 
 167     awful.key({ modkey,           }, "n",
 
 169             -- The client currently has the input focus, so it cannot be
 
 170             -- minimized, since minimized clients can't have the focus.
 
 173         {description = "minimize", group = "client"}),
 
 174     awful.key({ modkey,           }, "m",
 
 176             c.maximized = not c.maximized
 
 179         {description = "maximize", group = "client"}),
 
 181     -- Move client to screen
 
 182     awful.key({ modkey, "Shift" }, "#94",      function (c) c:move_to_screen()               end,
 
 183               {description = "move to screen", group = "client"}),
 
 184     awful.key({ modkey, "Shift" }, "#49",      function (c) c:move_to_screen()               end,
 
 185               {description = "move to screen", group = "client"}),
 
 186     awful.key({ modkey, "Shift" }, "=",        function (c) c:move_to_screen()               end,
 
 187               {description = "move to screen", group = "client"})
 
 191 -- Bind all key numbers to tags.
 
 192 -- Be careful: we use keycodes to make it works on any keyboard layout.
 
 193 -- This should map on the top row of your keyboard, usually 1 to 9.
 
 195     globalkeys = awful.util.table.join(globalkeys,
 
 197         awful.key({ modkey }, "#" .. i + 9,
 
 199                         local screen = awful.screen.focused()
 
 200                         local tag = screen.tags[i]
 
 203                                 awful.tag.history.restore(screen)
 
 209                   {description = "view tag #"..i, group = "tag"}),
 
 210         -- Toggle tag display.
 
 211         awful.key({ modkey, "Control" }, "#" .. i + 9,
 
 213                       local screen = awful.screen.focused()
 
 214                       local tag = screen.tags[i]
 
 216                          awful.tag.viewtoggle(tag)
 
 219                   {description = "toggle tag #" .. i, group = "tag"}),
 
 220         -- Move client to tag.
 
 221         awful.key({ modkey, "Shift" }, "#" .. i + 9,
 
 224                           local tag = client.focus.screen.tags[i]
 
 226                               client.focus:move_to_tag(tag)
 
 230                   {description = "move focused client to tag #"..i, group = "tag"}),
 
 231         -- Toggle tag on focused client.
 
 232         awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
 
 235                           local tag = client.focus.screen.tags[i]
 
 237                               client.focus:toggle_tag(tag)
 
 241                   {description = "toggle focused client on tag #" .. i, group = "tag"})
 
 245 -- Client Buttons {{{1
 
 246 clientbuttons = awful.util.table.join(
 
 247     awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
 
 248     awful.button({ modkey }, 1, awful.mouse.client.move),
 
 249     awful.button({ modkey }, 3, awful.mouse.client.resize))