2017-08-16 23:32:04 +02:00
|
|
|
-- If LuaRocks is installed, make sure that packages installed through it are
|
|
|
|
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
|
|
|
|
pcall(require, "luarocks.loader")
|
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_REQUIRE_SECTION@
|
2008-11-20 20:45:09 +01:00
|
|
|
-- Standard awesome library
|
2012-07-29 16:47:04 +02:00
|
|
|
local gears = require("gears")
|
2012-06-12 20:13:09 +02:00
|
|
|
local awful = require("awful")
|
2009-08-19 11:21:56 +02:00
|
|
|
require("awful.autofocus")
|
2010-10-06 14:32:41 +02:00
|
|
|
-- Widget and layout library
|
2012-06-12 14:14:57 +02:00
|
|
|
local wibox = require("wibox")
|
2008-11-20 20:45:09 +01:00
|
|
|
-- Theme handling library
|
2012-06-12 03:24:22 +02:00
|
|
|
local beautiful = require("beautiful")
|
2008-11-20 20:45:09 +01:00
|
|
|
-- Notification library
|
2012-06-12 03:48:41 +02:00
|
|
|
local naughty = require("naughty")
|
2012-06-12 10:36:28 +02:00
|
|
|
local menubar = require("menubar")
|
2019-01-14 01:47:33 +01:00
|
|
|
local hotkeys_popup = require("awful.hotkeys_popup")
|
2017-06-13 02:39:46 +02:00
|
|
|
-- Enable hotkeys help widget for VIM and other apps
|
|
|
|
-- when client with a matching name is opened:
|
|
|
|
require("awful.hotkeys_popup.keys")
|
2008-08-05 22:21:22 +02:00
|
|
|
|
2011-10-23 15:59:15 +02:00
|
|
|
-- {{{ Error handling
|
|
|
|
-- Check if awesome encountered an error during startup and fell back to
|
|
|
|
-- another config (This code will only ever execute for the fallback config)
|
2019-10-01 18:49:28 +02:00
|
|
|
-- @DOC_ERROR_HANDLING@
|
2019-04-28 22:09:51 +02:00
|
|
|
naughty.connect_signal("request::display_error", function(message, startup)
|
2017-07-02 04:43:26 +02:00
|
|
|
naughty.notification {
|
2019-04-28 22:09:51 +02:00
|
|
|
urgency = "critical",
|
|
|
|
title = "Oops, an error happened"..(startup and " during startup!" or "!"),
|
|
|
|
message = message
|
2017-07-02 04:43:26 +02:00
|
|
|
}
|
2019-04-28 22:09:51 +02:00
|
|
|
end)
|
2011-10-23 15:59:15 +02:00
|
|
|
-- }}}
|
|
|
|
|
2008-06-11 23:13:15 +02:00
|
|
|
-- {{{ Variable definitions
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_LOAD_THEME@
|
2014-03-28 15:17:41 +01:00
|
|
|
-- Themes define colours, icons, font and wallpapers.
|
2017-03-31 03:37:16 +02:00
|
|
|
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
|
2009-09-28 13:42:34 +02:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_DEFAULT_APPLICATIONS@
|
2008-10-22 22:51:01 +02:00
|
|
|
-- This is used later as the default terminal and editor to run.
|
2008-05-20 15:39:47 +02:00
|
|
|
terminal = "xterm"
|
2008-10-23 10:26:13 +02:00
|
|
|
editor = os.getenv("EDITOR") or "nano"
|
|
|
|
editor_cmd = terminal .. " -e " .. editor
|
2008-06-11 23:13:15 +02:00
|
|
|
|
2008-05-20 15:39:47 +02:00
|
|
|
-- Default modkey.
|
|
|
|
-- Usually, Mod4 is the key with a logo between Control and Alt.
|
|
|
|
-- If you do not like this or do not have such a key,
|
|
|
|
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
|
|
|
|
-- However, you can use another modifier like Mod1, but it may interact with others.
|
|
|
|
modkey = "Mod4"
|
2008-06-11 23:13:15 +02:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_LAYOUT@
|
2008-05-24 13:55:49 +02:00
|
|
|
-- Table of layouts to cover with awful.layout.inc, order matters.
|
2014-03-26 23:56:10 +01:00
|
|
|
awful.layout.layouts = {
|
2009-12-21 09:18:51 +01:00
|
|
|
awful.layout.suit.floating,
|
2009-01-28 12:08:33 +01:00
|
|
|
awful.layout.suit.tile,
|
|
|
|
awful.layout.suit.tile.left,
|
|
|
|
awful.layout.suit.tile.bottom,
|
|
|
|
awful.layout.suit.tile.top,
|
2008-11-25 17:01:06 +01:00
|
|
|
awful.layout.suit.fair,
|
|
|
|
awful.layout.suit.fair.horizontal,
|
2009-07-12 20:27:41 +02:00
|
|
|
awful.layout.suit.spiral,
|
|
|
|
awful.layout.suit.spiral.dwindle,
|
2008-11-25 17:01:06 +01:00
|
|
|
awful.layout.suit.max,
|
|
|
|
awful.layout.suit.max.fullscreen,
|
2015-05-25 17:09:43 +02:00
|
|
|
awful.layout.suit.magnifier,
|
|
|
|
awful.layout.suit.corner.nw,
|
|
|
|
-- awful.layout.suit.corner.ne,
|
|
|
|
-- awful.layout.suit.corner.sw,
|
|
|
|
-- awful.layout.suit.corner.se,
|
2008-06-11 23:13:15 +02:00
|
|
|
}
|
2008-05-20 15:39:47 +02:00
|
|
|
-- }}}
|
|
|
|
|
2009-08-31 11:52:49 +02:00
|
|
|
-- {{{ Menu
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_MENU@
|
2016-01-06 19:25:24 +01:00
|
|
|
-- Create a launcher widget and a main menu
|
2009-09-08 10:23:18 +02:00
|
|
|
myawesomemenu = {
|
2019-01-14 01:47:33 +01:00
|
|
|
{ "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
|
2009-09-08 10:23:18 +02:00
|
|
|
{ "manual", terminal .. " -e man awesome" },
|
2011-09-17 17:24:44 +02:00
|
|
|
{ "edit config", editor_cmd .. " " .. awesome.conffile },
|
2009-09-08 10:23:18 +02:00
|
|
|
{ "restart", awesome.restart },
|
2019-01-14 05:52:21 +01:00
|
|
|
{ "quit", function() awesome.quit() end },
|
2009-09-08 10:23:18 +02:00
|
|
|
}
|
|
|
|
|
2009-08-31 11:52:49 +02:00
|
|
|
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
|
|
|
|
{ "open terminal", terminal }
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2010-09-29 13:26:09 +02:00
|
|
|
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
|
2009-08-31 11:52:49 +02:00
|
|
|
menu = mymainmenu })
|
2012-03-08 20:24:21 +01:00
|
|
|
|
|
|
|
-- Menubar configuration
|
|
|
|
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
|
2009-08-31 11:52:49 +02:00
|
|
|
-- }}}
|
|
|
|
|
2015-02-23 20:30:02 +01:00
|
|
|
-- Keyboard map indicator and switcher
|
|
|
|
mykeyboardlayout = awful.widget.keyboardlayout()
|
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- {{{ Wibar
|
2009-06-30 12:20:45 +02:00
|
|
|
-- Create a textclock widget
|
2016-05-23 06:46:01 +02:00
|
|
|
mytextclock = wibox.widget.textclock()
|
2008-06-14 18:12:16 +02:00
|
|
|
|
2008-09-24 12:13:21 +02:00
|
|
|
-- Create a wibox for each screen and add it
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @TAGLIST_BUTTON@
|
2018-12-27 03:21:49 +01:00
|
|
|
local taglist_buttons = {
|
|
|
|
awful.button({ }, 1, function(t) t:view_only() end),
|
|
|
|
awful.button({ modkey }, 1, function(t)
|
|
|
|
if client.focus then
|
|
|
|
client.focus:move_to_tag(t)
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.button({ }, 3, awful.tag.viewtoggle),
|
|
|
|
awful.button({ modkey }, 3, function(t)
|
|
|
|
if client.focus then
|
|
|
|
client.focus:toggle_tag(t)
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
|
|
|
|
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end),
|
|
|
|
}
|
2015-09-13 10:58:44 +02:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @TASKLIST_BUTTON@
|
2018-12-27 03:21:49 +01:00
|
|
|
local tasklist_buttons = {
|
|
|
|
awful.button({ }, 1, function (c)
|
|
|
|
if c == client.focus then
|
|
|
|
c.minimized = true
|
|
|
|
else
|
|
|
|
c:emit_signal(
|
|
|
|
"request::activate",
|
|
|
|
"tasklist",
|
|
|
|
{raise = true}
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.button({ }, 3, function()
|
|
|
|
awful.menu.client_list({ theme = { width = 250 } })
|
|
|
|
end),
|
|
|
|
awful.button({ }, 4, function ()
|
|
|
|
awful.client.focus.byidx(1)
|
|
|
|
end),
|
|
|
|
awful.button({ }, 5, function ()
|
|
|
|
awful.client.focus.byidx(-1)
|
|
|
|
end),
|
|
|
|
}
|
2008-10-19 19:14:55 +02:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_WALLPAPER@
|
2018-12-27 08:04:09 +01:00
|
|
|
screen.connect_signal("request::wallpaper", function(s)
|
2016-08-12 21:18:27 +02:00
|
|
|
-- Wallpaper
|
2016-04-17 15:34:00 +02:00
|
|
|
if beautiful.wallpaper then
|
2016-04-28 17:45:36 +02:00
|
|
|
local wallpaper = beautiful.wallpaper
|
|
|
|
-- If wallpaper is a function, call it with the screen
|
|
|
|
if type(wallpaper) == "function" then
|
|
|
|
wallpaper = wallpaper(s)
|
|
|
|
end
|
|
|
|
gears.wallpaper.maximized(wallpaper, s, true)
|
2016-04-17 15:34:00 +02:00
|
|
|
end
|
2018-12-27 08:04:09 +01:00
|
|
|
end)
|
2016-09-23 09:51:21 +02:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_FOR_EACH_SCREEN@
|
2018-12-27 08:04:09 +01:00
|
|
|
screen.connect_signal("request::desktop_decoration", function(s)
|
2016-04-17 15:34:00 +02:00
|
|
|
-- Each screen has its own tag table.
|
2016-04-17 15:49:06 +02:00
|
|
|
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
|
2016-04-17 15:34:00 +02:00
|
|
|
|
2008-10-19 19:14:55 +02:00
|
|
|
-- Create a promptbox for each screen
|
2016-09-30 22:46:51 +02:00
|
|
|
s.mypromptbox = awful.widget.prompt()
|
2017-05-26 15:35:39 +02:00
|
|
|
-- Create an imagebox widget which will contain an icon indicating which layout we're using.
|
2008-10-19 19:14:55 +02:00
|
|
|
-- We need one layoutbox per screen.
|
2018-12-27 03:24:55 +01:00
|
|
|
s.mylayoutbox = awful.widget.layoutbox {
|
|
|
|
screen = s,
|
|
|
|
buttons = {
|
|
|
|
awful.button({ }, 1, function () awful.layout.inc( 1) end),
|
|
|
|
awful.button({ }, 3, function () awful.layout.inc(-1) end),
|
|
|
|
awful.button({ }, 4, function () awful.layout.inc( 1) end),
|
|
|
|
awful.button({ }, 5, function () awful.layout.inc(-1) end),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-19 19:14:55 +02:00
|
|
|
-- Create a taglist widget
|
2017-11-27 06:50:03 +01:00
|
|
|
s.mytaglist = awful.widget.taglist {
|
|
|
|
screen = s,
|
|
|
|
filter = awful.widget.taglist.filter.all,
|
|
|
|
buttons = taglist_buttons
|
|
|
|
}
|
2008-10-19 19:14:55 +02:00
|
|
|
|
|
|
|
-- Create a tasklist widget
|
2017-11-27 06:50:03 +01:00
|
|
|
s.mytasklist = awful.widget.tasklist {
|
|
|
|
screen = s,
|
|
|
|
filter = awful.widget.tasklist.filter.currenttags,
|
|
|
|
buttons = tasklist_buttons
|
|
|
|
}
|
2008-10-19 19:14:55 +02:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_WIBAR@
|
2008-10-19 19:14:55 +02:00
|
|
|
-- Create the wibox
|
2016-09-30 22:46:51 +02:00
|
|
|
s.mywibox = awful.wibar({ position = "top", screen = s })
|
2009-10-24 15:06:54 +02:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_SETUP_WIDGETS@
|
2015-09-27 17:00:01 +02:00
|
|
|
-- Add widgets to the wibox
|
2018-12-27 05:33:05 +01:00
|
|
|
s.mywibox.widget = {
|
2015-09-27 17:00:01 +02:00
|
|
|
layout = wibox.layout.align.horizontal,
|
|
|
|
{ -- Left widgets
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
|
|
|
mylauncher,
|
2016-09-30 22:46:51 +02:00
|
|
|
s.mytaglist,
|
|
|
|
s.mypromptbox,
|
2015-09-27 17:00:01 +02:00
|
|
|
},
|
2016-09-30 22:46:51 +02:00
|
|
|
s.mytasklist, -- Middle widget
|
2015-09-27 17:00:01 +02:00
|
|
|
{ -- Right widgets
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
|
|
|
mykeyboardlayout,
|
2016-03-05 16:49:49 +01:00
|
|
|
wibox.widget.systray(),
|
2015-09-27 17:00:01 +02:00
|
|
|
mytextclock,
|
2016-09-30 22:46:51 +02:00
|
|
|
s.mylayoutbox,
|
2015-09-27 17:00:01 +02:00
|
|
|
},
|
|
|
|
}
|
2016-03-26 18:36:38 +01:00
|
|
|
end)
|
2008-05-20 15:39:47 +02:00
|
|
|
-- }}}
|
|
|
|
|
|
|
|
-- {{{ Mouse bindings
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_ROOT_BUTTONS@
|
2018-12-29 03:18:25 +01:00
|
|
|
awful.mouse.append_global_mousebindings({
|
2009-04-14 17:53:22 +02:00
|
|
|
awful.button({ }, 3, function () mymainmenu:toggle() end),
|
|
|
|
awful.button({ }, 4, awful.tag.viewnext),
|
2018-12-27 03:49:56 +01:00
|
|
|
awful.button({ }, 5, awful.tag.viewprev),
|
2018-12-29 03:18:25 +01:00
|
|
|
})
|
2008-05-20 15:39:47 +02:00
|
|
|
-- }}}
|
|
|
|
|
|
|
|
-- {{{ Key bindings
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_GLOBAL_KEYBINDINGS@
|
2018-12-29 03:18:25 +01:00
|
|
|
|
|
|
|
-- General Awesome keys
|
|
|
|
awful.keyboard.append_global_keybindings({
|
2015-09-20 16:42:24 +02:00
|
|
|
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
|
|
|
|
{description="show help", group="awesome"}),
|
2018-12-29 03:18:25 +01:00
|
|
|
awful.key({ modkey, }, "w", function () mymainmenu:show() end,
|
|
|
|
{description = "show main menu", group = "awesome"}),
|
|
|
|
awful.key({ modkey, "Control" }, "r", awesome.restart,
|
|
|
|
{description = "reload awesome", group = "awesome"}),
|
|
|
|
awful.key({ modkey, "Shift" }, "q", awesome.quit,
|
|
|
|
{description = "quit awesome", group = "awesome"}),
|
|
|
|
awful.key({ modkey }, "x",
|
|
|
|
function ()
|
|
|
|
awful.prompt.run {
|
|
|
|
prompt = "Run Lua code: ",
|
|
|
|
textbox = awful.screen.focused().mypromptbox.widget,
|
|
|
|
exe_callback = awful.util.eval,
|
|
|
|
history_path = awful.util.get_cache_dir() .. "/history_eval"
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
{description = "lua execute prompt", group = "awesome"}),
|
|
|
|
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
|
|
|
|
{description = "open a terminal", group = "launcher"}),
|
|
|
|
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
|
|
|
|
{description = "run prompt", group = "launcher"}),
|
|
|
|
awful.key({ modkey }, "p", function() menubar.show() end,
|
|
|
|
{description = "show the menubar", group = "launcher"}),
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Tags related keybindings
|
|
|
|
awful.keyboard.append_global_keybindings({
|
2015-10-17 19:05:35 +02:00
|
|
|
awful.key({ modkey, }, "Left", awful.tag.viewprev,
|
|
|
|
{description = "view previous", group = "tag"}),
|
|
|
|
awful.key({ modkey, }, "Right", awful.tag.viewnext,
|
|
|
|
{description = "view next", group = "tag"}),
|
|
|
|
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
|
|
|
|
{description = "go back", group = "tag"}),
|
2018-12-29 03:18:25 +01:00
|
|
|
})
|
2009-02-20 15:02:22 +01:00
|
|
|
|
2018-12-29 03:18:25 +01:00
|
|
|
-- Focus related keybindings
|
|
|
|
awful.keyboard.append_global_keybindings({
|
2009-04-14 17:53:22 +02:00
|
|
|
awful.key({ modkey, }, "j",
|
2009-02-24 17:42:21 +01:00
|
|
|
function ()
|
|
|
|
awful.client.focus.byidx( 1)
|
2015-10-17 19:05:35 +02:00
|
|
|
end,
|
|
|
|
{description = "focus next by index", group = "client"}
|
|
|
|
),
|
2009-04-14 17:53:22 +02:00
|
|
|
awful.key({ modkey, }, "k",
|
2009-02-24 17:42:21 +01:00
|
|
|
function ()
|
|
|
|
awful.client.focus.byidx(-1)
|
2015-10-17 19:05:35 +02:00
|
|
|
end,
|
|
|
|
{description = "focus previous by index", group = "client"}
|
|
|
|
),
|
2009-04-14 17:53:22 +02:00
|
|
|
awful.key({ modkey, }, "Tab",
|
2009-02-24 17:42:21 +01:00
|
|
|
function ()
|
|
|
|
awful.client.focus.history.previous()
|
|
|
|
if client.focus then
|
|
|
|
client.focus:raise()
|
|
|
|
end
|
2015-10-17 19:05:35 +02:00
|
|
|
end,
|
|
|
|
{description = "go back", group = "client"}),
|
2018-12-29 03:18:25 +01:00
|
|
|
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
|
|
|
|
{description = "focus the next screen", group = "screen"}),
|
|
|
|
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
|
|
|
|
{description = "focus the previous screen", group = "screen"}),
|
|
|
|
awful.key({ modkey, "Control" }, "n",
|
|
|
|
function ()
|
|
|
|
local c = awful.client.restore()
|
|
|
|
-- Focus restored client
|
|
|
|
if c then
|
|
|
|
c:emit_signal(
|
|
|
|
"request::activate", "key.unminimize", {raise = true}
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
{description = "restore minimized", group = "client"}),
|
|
|
|
})
|
2009-02-20 15:02:22 +01:00
|
|
|
|
2018-12-29 03:18:25 +01:00
|
|
|
-- Layout related keybindings
|
|
|
|
awful.keyboard.append_global_keybindings({
|
|
|
|
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
|
|
|
|
{description = "swap with next client by index", group = "client"}),
|
|
|
|
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
|
|
|
|
{description = "swap with previous client by index", group = "client"}),
|
|
|
|
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
|
|
|
|
{description = "jump to urgent client", group = "client"}),
|
2015-10-17 19:05:35 +02:00
|
|
|
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
|
|
|
|
{description = "increase master width factor", group = "layout"}),
|
|
|
|
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
|
|
|
|
{description = "decrease master width factor", group = "layout"}),
|
|
|
|
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
|
|
|
|
{description = "increase the number of master clients", group = "layout"}),
|
|
|
|
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
|
|
|
|
{description = "decrease the number of master clients", group = "layout"}),
|
|
|
|
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
|
|
|
|
{description = "increase the number of columns", group = "layout"}),
|
|
|
|
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
|
|
|
|
{description = "decrease the number of columns", group = "layout"}),
|
|
|
|
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
|
|
|
|
{description = "select next", group = "layout"}),
|
|
|
|
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
|
|
|
|
{description = "select previous", group = "layout"}),
|
2018-12-29 03:18:25 +01:00
|
|
|
})
|
2009-02-20 15:02:22 +01:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_CLIENT_KEYBINDINGS@
|
2018-12-27 04:01:05 +01:00
|
|
|
clientkeys = {
|
2015-06-21 23:26:08 +02:00
|
|
|
awful.key({ modkey, }, "f",
|
|
|
|
function (c)
|
|
|
|
c.fullscreen = not c.fullscreen
|
|
|
|
c:raise()
|
2016-05-30 04:33:59 +02:00
|
|
|
end,
|
|
|
|
{description = "toggle fullscreen", group = "client"}),
|
2015-10-17 19:05:35 +02:00
|
|
|
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
|
|
|
|
{description = "close", group = "client"}),
|
|
|
|
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
|
|
|
|
{description = "toggle floating", group = "client"}),
|
|
|
|
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
|
|
|
|
{description = "move to master", group = "client"}),
|
2016-04-02 09:27:45 +02:00
|
|
|
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
|
2015-10-17 19:05:35 +02:00
|
|
|
{description = "move to screen", group = "client"}),
|
|
|
|
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
|
|
|
|
{description = "toggle keep on top", group = "client"}),
|
2011-04-28 20:14:11 +02:00
|
|
|
awful.key({ modkey, }, "n",
|
|
|
|
function (c)
|
|
|
|
-- The client currently has the input focus, so it cannot be
|
|
|
|
-- minimized, since minimized clients can't have the focus.
|
|
|
|
c.minimized = true
|
2015-10-17 19:05:35 +02:00
|
|
|
end ,
|
|
|
|
{description = "minimize", group = "client"}),
|
2009-08-25 14:56:17 +02:00
|
|
|
awful.key({ modkey, }, "m",
|
2009-02-20 15:02:22 +01:00
|
|
|
function (c)
|
2015-06-21 23:26:08 +02:00
|
|
|
c.maximized = not c.maximized
|
|
|
|
c:raise()
|
2015-10-17 19:05:35 +02:00
|
|
|
end ,
|
2017-02-15 23:35:04 +01:00
|
|
|
{description = "(un)maximize", group = "client"}),
|
|
|
|
awful.key({ modkey, "Control" }, "m",
|
|
|
|
function (c)
|
|
|
|
c.maximized_vertical = not c.maximized_vertical
|
|
|
|
c:raise()
|
|
|
|
end ,
|
|
|
|
{description = "(un)maximize vertically", group = "client"}),
|
|
|
|
awful.key({ modkey, "Shift" }, "m",
|
|
|
|
function (c)
|
|
|
|
c.maximized_horizontal = not c.maximized_horizontal
|
|
|
|
c:raise()
|
|
|
|
end ,
|
2018-12-27 04:01:05 +01:00
|
|
|
{description = "(un)maximize horizontally", group = "client"}),
|
|
|
|
}
|
2009-02-20 15:02:22 +01:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_NUMBER_KEYBINDINGS@
|
2019-11-18 08:04:48 +01:00
|
|
|
|
|
|
|
awful.keyboard.append_global_keybindings({
|
|
|
|
awful.key {
|
|
|
|
modifiers = { modkey },
|
|
|
|
keygroup = "numrow",
|
|
|
|
description = "only view tag",
|
|
|
|
group = "tag",
|
|
|
|
on_press = function (index)
|
2018-12-27 04:51:35 +01:00
|
|
|
local screen = awful.screen.focused()
|
2019-11-18 08:04:48 +01:00
|
|
|
local tag = screen.tags[index]
|
2018-12-27 04:51:35 +01:00
|
|
|
if tag then
|
|
|
|
tag:view_only()
|
|
|
|
end
|
|
|
|
end,
|
2019-11-18 08:04:48 +01:00
|
|
|
},
|
|
|
|
awful.key {
|
|
|
|
modifiers = { modkey, "Control" },
|
|
|
|
keygroup = "numrow",
|
|
|
|
description = "toggle tag",
|
|
|
|
group = "tag",
|
|
|
|
on_press = function (index)
|
2018-12-27 04:51:35 +01:00
|
|
|
local screen = awful.screen.focused()
|
2019-11-18 08:04:48 +01:00
|
|
|
local tag = screen.tags[index]
|
2018-12-27 04:51:35 +01:00
|
|
|
if tag then
|
|
|
|
awful.tag.viewtoggle(tag)
|
|
|
|
end
|
|
|
|
end,
|
2019-11-18 08:04:48 +01:00
|
|
|
},
|
|
|
|
awful.key {
|
|
|
|
modifiers = { modkey, "Shift" },
|
|
|
|
keygroup = "numrow",
|
|
|
|
description = "move focused client to tag",
|
|
|
|
group = "tag",
|
|
|
|
on_press = function (index)
|
2018-12-27 04:51:35 +01:00
|
|
|
if client.focus then
|
2019-11-18 08:04:48 +01:00
|
|
|
local tag = client.focus.screen.tags[index]
|
2018-12-27 04:51:35 +01:00
|
|
|
if tag then
|
|
|
|
client.focus:move_to_tag(tag)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
2019-11-18 08:04:48 +01:00
|
|
|
},
|
|
|
|
awful.key {
|
|
|
|
modifiers = { modkey, "Control", "Shift" },
|
|
|
|
keygroup = "numrow",
|
|
|
|
description = "toggle focused client on tag",
|
|
|
|
group = "tag",
|
|
|
|
on_press = function (index)
|
2018-12-27 04:51:35 +01:00
|
|
|
if client.focus then
|
2019-11-18 08:04:48 +01:00
|
|
|
local tag = client.focus.screen.tags[index]
|
2018-12-27 04:51:35 +01:00
|
|
|
if tag then
|
|
|
|
client.focus:toggle_tag(tag)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
2019-11-18 08:04:48 +01:00
|
|
|
}
|
|
|
|
})
|
2008-05-20 15:39:47 +02:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_CLIENT_BUTTONS@
|
2018-12-27 03:51:22 +01:00
|
|
|
clientbuttons = {
|
2018-06-10 01:35:08 +02:00
|
|
|
awful.button({ }, 1, function (c)
|
2018-07-28 20:34:29 +02:00
|
|
|
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
2018-06-10 01:35:08 +02:00
|
|
|
end),
|
|
|
|
awful.button({ modkey }, 1, function (c)
|
2018-07-28 20:34:29 +02:00
|
|
|
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
2018-06-10 01:35:08 +02:00
|
|
|
awful.mouse.client.move(c)
|
|
|
|
end),
|
|
|
|
awful.button({ modkey }, 3, function (c)
|
2018-07-28 20:34:29 +02:00
|
|
|
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
2018-06-10 01:35:08 +02:00
|
|
|
awful.mouse.client.resize(c)
|
2018-12-27 03:51:22 +01:00
|
|
|
end),
|
|
|
|
}
|
2009-08-24 16:27:35 +02:00
|
|
|
|
2008-05-20 15:39:47 +02:00
|
|
|
-- }}}
|
|
|
|
|
2009-08-24 16:27:35 +02:00
|
|
|
-- {{{ Rules
|
2014-03-28 15:17:41 +01:00
|
|
|
-- Rules to apply to new clients (through the "manage" signal).
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_RULES@
|
2009-08-24 16:27:35 +02:00
|
|
|
awful.rules.rules = {
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_GLOBAL_RULE@
|
2009-08-24 16:27:35 +02:00
|
|
|
-- All clients will match this rule.
|
|
|
|
{ rule = { },
|
|
|
|
properties = { border_width = beautiful.border_width,
|
|
|
|
border_color = beautiful.border_normal,
|
2012-07-06 17:30:35 +02:00
|
|
|
focus = awful.client.focus.filter,
|
2014-03-23 18:34:38 +01:00
|
|
|
raise = true,
|
2009-08-24 16:27:35 +02:00
|
|
|
keys = clientkeys,
|
2016-04-16 11:51:25 +02:00
|
|
|
buttons = clientbuttons,
|
2016-09-15 22:50:28 +02:00
|
|
|
screen = awful.screen.preferred,
|
2016-04-16 11:51:25 +02:00
|
|
|
placement = awful.placement.no_overlap+awful.placement.no_offscreen
|
|
|
|
}
|
|
|
|
},
|
2015-07-20 01:57:21 +02:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_FLOATING_RULE@
|
2015-07-20 01:57:21 +02:00
|
|
|
-- Floating clients.
|
|
|
|
{ rule_any = {
|
|
|
|
instance = {
|
|
|
|
"DTA", -- Firefox addon DownThemAll.
|
|
|
|
"copyq", -- Includes session name in class.
|
2017-08-28 10:55:56 +02:00
|
|
|
"pinentry",
|
2015-07-20 01:57:21 +02:00
|
|
|
},
|
|
|
|
class = {
|
|
|
|
"Arandr",
|
2017-08-28 10:55:56 +02:00
|
|
|
"Blueman-manager",
|
2015-07-20 01:57:21 +02:00
|
|
|
"Gpick",
|
|
|
|
"Kruler",
|
|
|
|
"MessageWin", -- kalarm.
|
|
|
|
"Sxiv",
|
2018-12-27 16:53:46 +01:00
|
|
|
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
|
2015-07-20 01:57:21 +02:00
|
|
|
"Wpa_gui",
|
|
|
|
"veromix",
|
2018-12-27 16:53:46 +01:00
|
|
|
"xtightvncviewer"},
|
2015-07-20 01:57:21 +02:00
|
|
|
|
2018-12-17 15:40:04 +01:00
|
|
|
-- Note that the name property shown in xprop might be set slightly after creation of the client
|
|
|
|
-- and the name shown there might not match defined rules here.
|
2015-07-20 01:57:21 +02:00
|
|
|
name = {
|
|
|
|
"Event Tester", -- xev.
|
|
|
|
},
|
|
|
|
role = {
|
|
|
|
"AlarmWindow", -- Thunderbird's calendar.
|
2017-08-28 10:55:56 +02:00
|
|
|
"ConfigManager", -- Thunderbird's about:config.
|
2015-07-20 01:57:21 +02:00
|
|
|
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
|
|
|
|
}
|
|
|
|
}, properties = { floating = true }},
|
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_DIALOG_RULE@
|
2016-04-14 09:13:06 +02:00
|
|
|
-- Add titlebars to normal clients and dialogs
|
|
|
|
{ rule_any = {type = { "normal", "dialog" }
|
2018-08-26 19:26:19 +02:00
|
|
|
-- @DOC_CSD_TITLEBARS@
|
2016-04-14 09:13:06 +02:00
|
|
|
}, properties = { titlebars_enabled = true }
|
|
|
|
},
|
|
|
|
|
2016-04-10 11:18:07 +02:00
|
|
|
-- Set Firefox to always map on the tag named "2" on screen 1.
|
2009-08-25 11:09:12 +02:00
|
|
|
-- { rule = { class = "Firefox" },
|
2016-04-10 11:18:07 +02:00
|
|
|
-- properties = { screen = 1, tag = "2" } },
|
2009-08-24 16:27:35 +02:00
|
|
|
}
|
|
|
|
-- }}}
|
|
|
|
|
2009-08-19 15:49:15 +02:00
|
|
|
-- {{{ Signals
|
|
|
|
-- Signal function to execute when a new client appears.
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_MANAGE_HOOK@
|
2014-03-16 20:15:02 +01:00
|
|
|
client.connect_signal("manage", function (c)
|
2016-04-16 11:51:25 +02:00
|
|
|
-- Set the windows at the slave,
|
|
|
|
-- i.e. put it at the end of others instead of setting it master.
|
|
|
|
-- if not awesome.startup then awful.client.setslave(c) end
|
|
|
|
|
2018-03-13 03:53:44 +01:00
|
|
|
if awesome.startup
|
|
|
|
and not c.size_hints.user_position
|
2016-04-16 11:51:25 +02:00
|
|
|
and not c.size_hints.program_position then
|
2015-07-11 22:53:57 +02:00
|
|
|
-- Prevent clients from being unreachable after screen count changes.
|
2014-11-01 23:53:03 +01:00
|
|
|
awful.placement.no_offscreen(c)
|
2009-09-18 11:35:59 +02:00
|
|
|
end
|
2016-04-14 09:13:06 +02:00
|
|
|
end)
|
2012-10-23 20:32:59 +02:00
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_TITLEBARS@
|
2016-04-14 09:13:06 +02:00
|
|
|
-- Add a titlebar if titlebars_enabled is set to true in the rules.
|
|
|
|
client.connect_signal("request::titlebars", function(c)
|
|
|
|
-- buttons for the titlebar
|
2018-12-27 03:52:09 +01:00
|
|
|
local buttons = {
|
2016-04-14 09:13:06 +02:00
|
|
|
awful.button({ }, 1, function()
|
2018-07-28 20:34:29 +02:00
|
|
|
c:emit_signal("request::activate", "titlebar", {raise = true})
|
2016-04-14 09:13:06 +02:00
|
|
|
awful.mouse.client.move(c)
|
|
|
|
end),
|
|
|
|
awful.button({ }, 3, function()
|
2018-07-28 20:34:29 +02:00
|
|
|
c:emit_signal("request::activate", "titlebar", {raise = true})
|
2016-04-14 09:13:06 +02:00
|
|
|
awful.mouse.client.resize(c)
|
2018-12-27 03:52:09 +01:00
|
|
|
end),
|
|
|
|
}
|
2016-04-14 09:13:06 +02:00
|
|
|
|
2018-12-27 05:33:05 +01:00
|
|
|
awful.titlebar(c).widget = {
|
2016-04-14 09:13:06 +02:00
|
|
|
{ -- Left
|
|
|
|
awful.titlebar.widget.iconwidget(c),
|
|
|
|
buttons = buttons,
|
|
|
|
layout = wibox.layout.fixed.horizontal
|
|
|
|
},
|
|
|
|
{ -- Middle
|
|
|
|
{ -- Title
|
|
|
|
align = "center",
|
|
|
|
widget = awful.titlebar.widget.titlewidget(c)
|
2015-09-27 17:00:01 +02:00
|
|
|
},
|
2016-04-14 09:13:06 +02:00
|
|
|
buttons = buttons,
|
|
|
|
layout = wibox.layout.flex.horizontal
|
|
|
|
},
|
|
|
|
{ -- Right
|
|
|
|
awful.titlebar.widget.floatingbutton (c),
|
|
|
|
awful.titlebar.widget.maximizedbutton(c),
|
|
|
|
awful.titlebar.widget.stickybutton (c),
|
|
|
|
awful.titlebar.widget.ontopbutton (c),
|
|
|
|
awful.titlebar.widget.closebutton (c),
|
|
|
|
layout = wibox.layout.fixed.horizontal()
|
|
|
|
},
|
|
|
|
layout = wibox.layout.align.horizontal
|
|
|
|
}
|
2008-08-25 15:35:17 +02:00
|
|
|
end)
|
2009-08-21 16:08:38 +02:00
|
|
|
|
2016-11-09 21:46:58 +01:00
|
|
|
-- Enable sloppy focus, so that focus follows mouse.
|
2014-03-23 19:48:07 +01:00
|
|
|
client.connect_signal("mouse::enter", function(c)
|
2019-01-19 09:48:01 +01:00
|
|
|
c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
2014-03-23 19:48:07 +01:00
|
|
|
end)
|
|
|
|
|
2016-08-12 21:18:27 +02:00
|
|
|
-- @DOC_BORDER@
|
2009-10-09 20:39:55 +02:00
|
|
|
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
|
|
|
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
2008-05-20 15:39:47 +02:00
|
|
|
-- }}}
|