2014-07-18 06:11:03 +03:00
|
|
|
-- Standard awesome library
|
|
|
|
local gears = require('gears')
|
|
|
|
local awful = require('awful')
|
|
|
|
awful.rules = require('awful.rules')
|
|
|
|
require('awful.autofocus')
|
|
|
|
-- Widget and layout library
|
|
|
|
local wibox = require('wibox')
|
|
|
|
-- Theme handling library
|
|
|
|
local beautiful = require('beautiful')
|
|
|
|
-- Notification library
|
|
|
|
local naughty = require('naughty')
|
|
|
|
local menubar = require('menubar')
|
|
|
|
|
|
|
|
-- enable testing if file exists
|
|
|
|
function ifexists(name)
|
2014-08-06 20:41:13 +03:00
|
|
|
local f=io.open(name,'r')
|
2014-08-07 15:47:20 +03:00
|
|
|
if f ~= nil then
|
|
|
|
io.close(f)
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
-- {{{ 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)
|
|
|
|
if awesome.startup_errors then
|
2014-08-06 20:41:13 +03:00
|
|
|
naughty.notify({
|
|
|
|
preset = naughty.config.presets.critical,
|
|
|
|
title = 'Oops, there were errors during startup!',
|
|
|
|
text = awesome.startup_errors
|
|
|
|
})
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Handle runtime errors after startup
|
|
|
|
do
|
2014-08-06 20:41:13 +03:00
|
|
|
local in_error = false
|
|
|
|
awesome.connect_signal(
|
|
|
|
'debug::error',
|
|
|
|
function (err)
|
|
|
|
-- Make sure we don't go into an endless error loop
|
|
|
|
if in_error then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
in_error = true
|
|
|
|
|
|
|
|
naughty.notify({
|
|
|
|
preset = naughty.config.presets.critical,
|
|
|
|
title = 'Oops, an error happened!',
|
|
|
|
text = err
|
|
|
|
})
|
|
|
|
in_error = false
|
|
|
|
end
|
|
|
|
)
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
-- }}}
|
|
|
|
|
|
|
|
-- {{{ Variable definitions
|
|
|
|
-- Themes define colours, icons, and wallpapers
|
|
|
|
beautiful.init('/home/von/vdotfiles/theme.lua')
|
|
|
|
theme.border_width = 1
|
|
|
|
theme.font = 'Terminus 9'
|
|
|
|
|
|
|
|
-- set wallpaper
|
|
|
|
local wallpaper = '/home/von/Pictures/wallpaper.png'
|
|
|
|
if ifexists(wallpaper) then
|
2014-08-06 20:41:13 +03:00
|
|
|
theme.wallpaper = wallpaper
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
-- This is used later as the default terminal and editor to run.
|
|
|
|
terminal = 'roxterm'
|
|
|
|
editor = os.getenv('EDITOR') or 'vim'
|
|
|
|
editor_cmd = terminal .. ' -e ' .. editor
|
|
|
|
|
|
|
|
-- 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'
|
|
|
|
|
|
|
|
-- Table of layouts to cover with awful.layout.inc, order matters.
|
2014-08-06 20:41:13 +03:00
|
|
|
local layouts = {
|
|
|
|
awful.layout.suit.floating,
|
|
|
|
awful.layout.suit.tile,
|
|
|
|
awful.layout.suit.tile.bottom,
|
|
|
|
awful.layout.suit.max,
|
|
|
|
awful.layout.suit.magnifier
|
2014-07-18 06:11:03 +03:00
|
|
|
}
|
|
|
|
-- }}}
|
|
|
|
|
|
|
|
-- {{{ Wallpaper
|
|
|
|
if beautiful.wallpaper then
|
2014-08-06 20:41:13 +03:00
|
|
|
for s = 1, screen.count() do
|
|
|
|
gears.wallpaper.centered(beautiful.wallpaper, s)
|
|
|
|
end
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
-- }}}
|
|
|
|
|
|
|
|
-- {{{ Tags
|
|
|
|
-- Provide tag names and layout settings if we wish to define them
|
|
|
|
tags = {}
|
|
|
|
for s = 1, screen.count() do
|
2014-08-06 20:41:13 +03:00
|
|
|
tags[s] = { name = {}, layout = {} }
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
-- screen 1
|
2014-08-06 20:41:13 +03:00
|
|
|
--tags[1].name = {
|
|
|
|
-- [1] = '1:browser',
|
|
|
|
-- [2] = '2:terminal',
|
|
|
|
-- [3] = '3:terminal',
|
|
|
|
-- [4] = '4:float',
|
|
|
|
-- [9] = '9:mail'
|
2014-07-18 06:11:03 +03:00
|
|
|
--}
|
2014-08-06 20:41:13 +03:00
|
|
|
tags[1].layout = {
|
|
|
|
[1] = layouts[2],
|
|
|
|
[4] = layouts[1],
|
|
|
|
[5] = layouts[1]
|
2014-07-18 06:11:03 +03:00
|
|
|
}
|
|
|
|
-- screens 2+
|
|
|
|
if screen.count() >= 2 then
|
2014-08-06 20:41:13 +03:00
|
|
|
--tags[2].name = {
|
|
|
|
-- [3] = '3:float',
|
|
|
|
--}
|
|
|
|
tags[2].layout = {
|
|
|
|
[3] = layouts[1]
|
|
|
|
}
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
-- Fill the missing values with defaults
|
|
|
|
for s = 1, screen.count() do
|
2014-08-06 20:41:13 +03:00
|
|
|
for tag = 1, 9 do
|
|
|
|
tags[s].name[tag] = tags[s].name[tag] or tag
|
|
|
|
tags[s].layout[tag] = tags[s].layout[tag] or layouts[3]
|
|
|
|
end
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
-- Set tags instances in wm
|
|
|
|
for s = 1, screen.count() do
|
2014-08-06 20:41:13 +03:00
|
|
|
tags[s] = awful.tag(tags[s].name, s, tags[s].layout)
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
-- }}}
|
|
|
|
|
|
|
|
-- {{{ Menu
|
|
|
|
-- Create a laucher widget and a main menu
|
|
|
|
restartmenu = {
|
2014-08-06 20:41:13 +03:00
|
|
|
{ 'restart', awesome.restart }
|
2014-07-18 06:11:03 +03:00
|
|
|
}
|
|
|
|
quitmenu = {
|
2014-08-06 20:41:13 +03:00
|
|
|
{ 'quit', awesome.quit }
|
2014-07-18 06:11:03 +03:00
|
|
|
}
|
|
|
|
|
2014-08-06 20:41:13 +03:00
|
|
|
mymainmenu = awful.menu({
|
|
|
|
items = {
|
|
|
|
{ 'restart', restartmenu, beautiful.awesome_icon },
|
|
|
|
{ 'quit', quitmenu, beautiful.awesome_icon }
|
|
|
|
}
|
|
|
|
})
|
2014-07-18 06:11:03 +03:00
|
|
|
|
2014-08-06 20:41:13 +03:00
|
|
|
mylauncher = awful.widget.launcher({
|
|
|
|
image = beautiful.awesome_icon,
|
|
|
|
menu = mymainmenu
|
|
|
|
})
|
2014-07-18 06:11:03 +03:00
|
|
|
|
|
|
|
-- Menubar configuration
|
|
|
|
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
|
|
|
|
-- }}}
|
|
|
|
|
|
|
|
-- {{{ Wibox
|
|
|
|
-- Create a textclock widget
|
|
|
|
mytextclock = awful.widget.textclock('%a %d %H:%M')
|
|
|
|
mytextclock:set_font('Terminus Bold 11')
|
|
|
|
mytextbox = wibox.widget.textbox()
|
|
|
|
mytextbox:set_text('')
|
|
|
|
mytextbox:set_font('Terminus 9')
|
|
|
|
|
|
|
|
-- Create a wibox for each screen and add it
|
|
|
|
mywibox = {}
|
|
|
|
mypromptbox = {}
|
|
|
|
mylayoutbox = {}
|
|
|
|
mytaglist = {}
|
|
|
|
mytaglist.buttons = awful.util.table.join(
|
2014-08-06 20:41:13 +03:00
|
|
|
awful.button({ }, 1, awful.tag.viewonly),
|
|
|
|
awful.button({ modkey }, 1, awful.client.movetotag),
|
|
|
|
awful.button({ }, 3, awful.tag.viewtoggle),
|
|
|
|
awful.button({ modkey }, 3, awful.client.toggletag),
|
|
|
|
awful.button({ }, 5, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
|
|
|
|
awful.button({ }, 4, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
|
|
|
|
)
|
2014-07-18 06:11:03 +03:00
|
|
|
mytasklist = {}
|
|
|
|
mytasklist.buttons = awful.util.table.join(
|
2014-08-06 20:41:13 +03:00
|
|
|
awful.button({ }, 1,
|
|
|
|
function (c)
|
|
|
|
if c == client.focus then
|
|
|
|
c.minimized = true
|
|
|
|
else
|
|
|
|
-- Without this, the following
|
|
|
|
-- :isvisible() makes no sense
|
|
|
|
c.minimized = false
|
|
|
|
if not c:isvisible() then
|
|
|
|
awful.tag.viewonly(c:tags()[1])
|
|
|
|
end
|
|
|
|
-- This will also un-minimize
|
|
|
|
-- the client, if needed
|
|
|
|
client.focus = c
|
|
|
|
c:raise()
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.button({ }, 3,
|
|
|
|
function ()
|
|
|
|
if instance then
|
|
|
|
instance:hide()
|
|
|
|
instance = nil
|
|
|
|
else
|
|
|
|
instance = awful.menu.clients({ width=250 })
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.button({ }, 4,
|
|
|
|
function ()
|
|
|
|
awful.client.focus.byidx(1)
|
|
|
|
if client.focus then
|
|
|
|
client.focus:raise()
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.button({ }, 5,
|
|
|
|
function ()
|
|
|
|
awful.client.focus.byidx(-1)
|
|
|
|
if client.focus then
|
|
|
|
client.focus:raise()
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
)
|
2014-07-18 06:11:03 +03:00
|
|
|
|
|
|
|
for s = 1, screen.count() do
|
2014-08-06 20:41:13 +03:00
|
|
|
-- Create a promptbox for each screen
|
|
|
|
mypromptbox[s] = awful.widget.prompt()
|
|
|
|
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
|
|
|
|
-- We need one layoutbox per screen.
|
|
|
|
mylayoutbox[s] = awful.widget.layoutbox(s)
|
|
|
|
mylayoutbox[s]:buttons(
|
|
|
|
awful.util.table.join(
|
|
|
|
awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
|
|
|
|
awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
|
|
|
|
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
|
|
|
|
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
-- Create a taglist widget
|
|
|
|
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.noempty, mytaglist.buttons)
|
|
|
|
|
|
|
|
-- Create a tasklist widget
|
|
|
|
mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
|
|
|
|
|
|
|
|
-- Create the wibox
|
|
|
|
mywibox[s] = awful.wibox({ position = 'top', height = '16', screen = s })
|
|
|
|
|
|
|
|
local left_layout = wibox.layout.fixed.horizontal()
|
|
|
|
local right_layout = wibox.layout.fixed.horizontal()
|
|
|
|
if s == 1 then
|
|
|
|
left_layout:add(mytextbox)
|
|
|
|
right_layout:add(mypromptbox[s])
|
|
|
|
right_layout:add(mytaglist[s])
|
|
|
|
if screen.count() == 1 then
|
|
|
|
right_layout:add(wibox.widget.systray())
|
|
|
|
right_layout:add(mytextclock)
|
|
|
|
end
|
|
|
|
right_layout:add(mylayoutbox[s])
|
|
|
|
elseif s == 2 then
|
|
|
|
left_layout:add(mylayoutbox[s])
|
|
|
|
left_layout:add(mytextclock)
|
|
|
|
left_layout:add(wibox.widget.systray())
|
|
|
|
left_layout:add(mytaglist[s])
|
|
|
|
left_layout:add(mypromptbox[s])
|
|
|
|
else
|
|
|
|
left_layout:add(mytaglist[s])
|
|
|
|
left_layout:add(mypromptbox[s])
|
|
|
|
right_layout:add(mylayoutbox[s])
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Now bring it all together (with the tasklist in the middle)
|
|
|
|
local layout = wibox.layout.align.horizontal()
|
|
|
|
layout:set_left(left_layout)
|
|
|
|
layout:set_middle(mytasklist[s])
|
|
|
|
layout:set_right(right_layout)
|
|
|
|
|
|
|
|
mywibox[s]:set_widget(layout)
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
-- }}}
|
|
|
|
|
|
|
|
-- {{{ Mouse bindings
|
2014-08-06 20:41:13 +03:00
|
|
|
root.buttons(
|
|
|
|
awful.util.table.join(
|
|
|
|
awful.button({ }, 3, function () mymainmenu:toggle() end),
|
|
|
|
awful.button({ }, 5, awful.tag.viewnext),
|
|
|
|
awful.button({ }, 4, awful.tag.viewprev)
|
|
|
|
)
|
|
|
|
)
|
2014-07-18 06:11:03 +03:00
|
|
|
-- }}}
|
|
|
|
|
|
|
|
-- {{{ Key bindings
|
|
|
|
globalkeys = awful.util.table.join(
|
2014-08-06 20:41:13 +03:00
|
|
|
awful.key({ modkey, }, 'Up', function () awful.screen.focus_relative( 1) end),
|
|
|
|
awful.key({ modkey, }, 'Down', function () awful.screen.focus_relative(-1) end),
|
|
|
|
awful.key({ modkey, }, 'Left', awful.tag.viewprev),
|
|
|
|
awful.key({ modkey, }, 'Right', awful.tag.viewnext),
|
|
|
|
awful.key({ modkey, }, 'Escape', awful.tag.history.restore),
|
|
|
|
|
|
|
|
awful.key({ modkey, }, 'j',
|
|
|
|
function ()
|
|
|
|
awful.client.focus.byidx(1)
|
|
|
|
if client.focus then
|
|
|
|
client.focus:raise()
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.key({ modkey, }, 'k',
|
|
|
|
function ()
|
|
|
|
awful.client.focus.byidx(-1)
|
|
|
|
if client.focus then
|
|
|
|
client.focus:raise()
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.key({ modkey, }, 'w', function () mymainmenu:show() end),
|
|
|
|
|
|
|
|
-- Layout manipulation
|
|
|
|
awful.key({ modkey, 'Shift' }, 'j', function () awful.client.swap.byidx(1) end),
|
|
|
|
awful.key({ modkey, 'Shift' }, 'k', function () awful.client.swap.byidx(-1) end),
|
|
|
|
awful.key({ modkey, 'Control' }, 'j', function () awful.screen.focus_relative(1) end),
|
|
|
|
awful.key({ modkey, 'Control' }, 'k', function () awful.screen.focus_relative(-1) end),
|
|
|
|
awful.key({ modkey, }, 'u', awful.client.urgent.jumpto),
|
|
|
|
awful.key({ modkey, }, 'Tab',
|
|
|
|
function ()
|
|
|
|
awful.client.focus.history.previous()
|
|
|
|
if client.focus then
|
|
|
|
client.focus:raise()
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.key({ 'Mod1', }, 'Tab',
|
|
|
|
function ()
|
|
|
|
awful.client.focus.byidx(-1)
|
|
|
|
if client.focus then
|
|
|
|
client.focus:raise()
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.key({ 'Mod1', 'Shift' }, 'Tab',
|
|
|
|
function ()
|
|
|
|
awful.client.focus.byidx(1)
|
|
|
|
if client.focus then
|
|
|
|
client.focus:raise()
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
|
|
|
|
-- Standard program
|
|
|
|
--awful.key({ modkey, 'Control' }, 'r', awesome.restart),
|
|
|
|
--awful.key({ modkey, 'Shift' }, 'q', awesome.quit),
|
|
|
|
|
|
|
|
awful.key({ modkey, }, 'l', function () awful.tag.incmwfact( 0.05) end),
|
|
|
|
awful.key({ modkey, }, 'h', function () awful.tag.incmwfact(-0.05) end),
|
|
|
|
awful.key({ modkey, 'Shift' }, 'h', function () awful.tag.incnmaster( 1) end),
|
|
|
|
awful.key({ modkey, 'Shift' }, 'l', function () awful.tag.incnmaster(-1) end),
|
|
|
|
awful.key({ modkey, 'Control' }, 'h', function () awful.tag.incncol( 1) end),
|
|
|
|
awful.key({ modkey, 'Control' }, 'l', function () awful.tag.incncol(-1) end),
|
|
|
|
awful.key({ modkey, }, 'space', function () awful.layout.inc(layouts, 1) end),
|
|
|
|
awful.key({ modkey, 'Shift' }, 'space', function () awful.layout.inc(layouts, -1) end),
|
|
|
|
|
|
|
|
awful.key({ modkey, 'Control' }, 'n', awful.client.restore),
|
|
|
|
|
|
|
|
-- Prompt
|
|
|
|
awful.key({ modkey, }, 'r', function () mypromptbox[mouse.screen]:run() end),
|
|
|
|
awful.key({ 'Mod1', }, 'F2', function () mypromptbox[mouse.screen]:run() end),
|
|
|
|
|
|
|
|
awful.key({ modkey, }, 'e',
|
|
|
|
function ()
|
|
|
|
awful.prompt.run(
|
|
|
|
{ prompt = 'Run Lua code: ' },
|
|
|
|
mypromptbox[mouse.screen].widget,
|
|
|
|
awful.util.eval, nil,
|
|
|
|
awful.util.getdir('cache') .. '/history_eval'
|
|
|
|
)
|
|
|
|
end),
|
|
|
|
-- Menubar
|
|
|
|
awful.key({ modkey, }, 'p', function () menubar.show() end),
|
|
|
|
-- Glbal commands
|
|
|
|
awful.key({ modkey, }, 'x', function () awful.util.spawn(terminal) end),
|
|
|
|
awful.key({ modkey, }, 'q', function () awful.util.spawn('/home/von/.local/bin/ticket_watch') end),
|
|
|
|
awful.key({ modkey, }, 'z', function () awful.util.spawn('bash -c "until slock; do :; done"') end),
|
|
|
|
awful.key({ modkey, }, 'F6', function () awful.util.spawn('/home/von/touchpad_hotkey.sh') end),
|
|
|
|
awful.key({ }, 'Print', function () awful.util.spawn('xfce4-screenshooter -ws /home/von/screenshots') end),
|
|
|
|
awful.key({ modkey, }, 'Print', function () awful.util.spawn('xfce4-screenshooter -fs /home/von/screenshots') end)
|
|
|
|
-- screenshot via scrot (might be useful at some point
|
|
|
|
-- awful.key({ }, 'Print', function() awful.util.spawn('scrot /home/von/screenshots/%Y-%m-%d_%H-%M_all.png') end),
|
2014-07-18 06:11:03 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
clientkeys = awful.util.table.join(
|
2014-08-06 20:41:13 +03:00
|
|
|
awful.key({ modkey, }, 'f', function (c) c.fullscreen = not c.fullscreen end),
|
|
|
|
awful.key({ modkey, 'Shift' }, 'c', function (c) c:kill() end),
|
|
|
|
awful.key({ modkey, 'Control' }, 'space', awful.client.floating.toggle ),
|
|
|
|
awful.key({ modkey, }, 'Return', function (c) c:swap(awful.client.getmaster()) end),
|
|
|
|
awful.key({ modkey, }, 'o', awful.client.movetoscreen ),
|
|
|
|
awful.key({ modkey, }, 't', function (c) c.ontop = not c.ontop end),
|
|
|
|
awful.key({ modkey, }, 's', function (c) c.sticky = not c.sticky end),
|
|
|
|
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
|
|
|
|
end),
|
|
|
|
awful.key({ modkey, }, 'm',
|
|
|
|
function (c)
|
|
|
|
c.maximized_horizontal = not c.maximized_horizontal
|
|
|
|
c.maximized_vertical = not c.maximized_vertical
|
|
|
|
end)
|
2014-07-18 06:11:03 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
-- Bind all key numbers to tags.
|
|
|
|
-- Be careful: we use keycodes to make it works on any keyboard layout.
|
|
|
|
-- This should map on the top row of your keyboard, usually 1 to 9.
|
|
|
|
for i = 1, 9 do
|
2014-08-06 20:41:13 +03:00
|
|
|
globalkeys = awful.util.table.join(globalkeys,
|
|
|
|
awful.key({ modkey }, '#' .. i + 9,
|
|
|
|
function ()
|
|
|
|
local screen = mouse.screen
|
|
|
|
local tag = awful.tag.gettags(screen)[i]
|
|
|
|
if tag then
|
|
|
|
awful.tag.viewonly(tag)
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.key({ modkey, 'Control' }, '#' .. i + 9,
|
|
|
|
function ()
|
|
|
|
local screen = mouse.screen
|
|
|
|
local tag = awful.tag.gettags(screen)[i]
|
|
|
|
if tag then
|
|
|
|
awful.tag.viewtoggle(tag)
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.key({ modkey, 'Shift' }, '#' .. i + 9,
|
|
|
|
function ()
|
|
|
|
if client.focus then
|
|
|
|
local tag = awful.tag.gettags(client.focus.screen)[i]
|
|
|
|
if tag then
|
|
|
|
awful.client.movetotag(tag)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.key({ modkey, 'Control', 'Shift' }, '#' .. i + 9,
|
|
|
|
function ()
|
|
|
|
if client.focus then
|
|
|
|
local tag = awful.tag.gettags(client.focus.screen)[i]
|
|
|
|
if tag then
|
|
|
|
awful.client.toggletag(tag)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
)
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
clientbuttons = awful.util.table.join(
|
2014-08-06 20:41:13 +03:00
|
|
|
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
|
|
|
|
awful.button({ modkey }, 1, awful.mouse.client.move),
|
|
|
|
awful.button({ modkey }, 3, awful.mouse.client.resize)
|
|
|
|
)
|
2014-07-18 06:11:03 +03:00
|
|
|
|
|
|
|
-- Set keys
|
|
|
|
root.keys(globalkeys)
|
|
|
|
-- }}}
|
|
|
|
|
|
|
|
-- {{{ Rules
|
|
|
|
awful.rules.rules = {
|
2014-08-06 20:41:13 +03:00
|
|
|
-- 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
|
|
|
|
}
|
|
|
|
},
|
|
|
|
-- Floating only rules class based rules
|
|
|
|
{
|
|
|
|
rule_any = {
|
|
|
|
class = {
|
|
|
|
'pinentry',
|
|
|
|
'Skype',
|
|
|
|
'Deadbeef',
|
|
|
|
'Pavucontrol',
|
|
|
|
'Qmmp',
|
|
|
|
'Vncviewer',
|
|
|
|
'plugin-container',
|
|
|
|
'mpv'
|
|
|
|
},
|
|
|
|
instance = {
|
|
|
|
'sun-awt-X11-XFramePeer'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
properties = {
|
|
|
|
floating = true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
-- Mostly floating rules, we want to keep them separately since it's easier to manage
|
|
|
|
-- firefox
|
|
|
|
{
|
|
|
|
rule = { class = 'Firefox' },
|
|
|
|
except = { instance = 'Navigator' },
|
|
|
|
properties = { floating = true }
|
|
|
|
},
|
|
|
|
-- ardour3
|
|
|
|
{
|
|
|
|
rule = { class = 'Ardour' },
|
|
|
|
except = { instance = 'ardour_editor' },
|
|
|
|
properties = { floating = true }
|
|
|
|
},
|
|
|
|
-- Remove gaps between terminal windows:
|
|
|
|
-- roxterm
|
|
|
|
{
|
|
|
|
rule = { class = 'Roxterm' },
|
|
|
|
properties = { size_hints_honor = false }
|
|
|
|
},
|
|
|
|
-- Specific desktops rules: place windows only on specific tags by default
|
|
|
|
-- steam
|
|
|
|
{
|
|
|
|
rule_any = { class = { 'Steam' },
|
|
|
|
instance = { 'Steam.exe' } },
|
|
|
|
properties = { tag = tags[1][4] }
|
|
|
|
},
|
|
|
|
-- games = float / fullscreen
|
|
|
|
{
|
|
|
|
rule_any = {
|
|
|
|
class = {
|
|
|
|
'dota_linux',
|
|
|
|
'hl2_linux',
|
|
|
|
'Strife',
|
|
|
|
'ck2',
|
|
|
|
'Pandora',
|
|
|
|
'witcher2',
|
|
|
|
'Symphony.bin.x86_64',
|
|
|
|
'Civ5XP',
|
|
|
|
'game.x86_64',
|
|
|
|
'deponia_tcj'
|
|
|
|
},
|
|
|
|
instance = {
|
|
|
|
'Civ4BeyondSword.exe',
|
|
|
|
'KB.exe'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
properties = {
|
|
|
|
border_width = 0,
|
|
|
|
floating = true,
|
|
|
|
tag = tags[1][5]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
-- games = maximized
|
|
|
|
{
|
|
|
|
rule_any = {
|
|
|
|
instance = {
|
|
|
|
'BGEE.exe',
|
|
|
|
'Baldur.exe'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
properties = {
|
|
|
|
border_width = 0,
|
|
|
|
tag = tags[1][2]
|
|
|
|
}
|
|
|
|
}
|
2014-07-18 06:11:03 +03:00
|
|
|
}
|
|
|
|
-- }}}
|
|
|
|
|
|
|
|
-- {{{ Signals
|
|
|
|
-- Signal function to execute when a new client appears.
|
2014-08-06 20:41:13 +03:00
|
|
|
client.connect_signal(
|
|
|
|
'manage',
|
|
|
|
function (c, startup)
|
|
|
|
-- Enable sloppy focus
|
|
|
|
c:connect_signal(
|
|
|
|
'mouse::enter',
|
|
|
|
function(c)
|
|
|
|
if (awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.layout.get(c.screen) ~= awful.layout.suit.floating) and awful.client.focus.filter(c) then
|
|
|
|
client.focus = c
|
|
|
|
end
|
|
|
|
end
|
|
|
|
)
|
|
|
|
|
|
|
|
if not startup then
|
|
|
|
-- Set the windows at the slave,
|
|
|
|
-- i.e. put it at the end of others instead of setting it master.
|
|
|
|
-- awful.client.setslave(c)
|
|
|
|
|
|
|
|
-- Put windows in a smart way, only if they do not set an initial position.
|
|
|
|
if not c.size_hints.user_position and not c.size_hints.program_position then
|
|
|
|
awful.placement.no_overlap(c)
|
|
|
|
awful.placement.no_offscreen(c)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
)
|
2014-07-18 06:11:03 +03: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)
|
|
|
|
-- }}}
|
|
|
|
-- {{{ Autostart
|
|
|
|
-- don't forget you sync this file
|
|
|
|
-- this shit runs every time you restart your wm, dumbass.
|
|
|
|
awful.util.spawn_with_shell('setxkbmap -layout us,ru -variant altgr-intl,typewriter -option grp:caps_toggle,compose:menu,grp_led:scroll')
|
|
|
|
awful.util.spawn_with_shell('xrdb /home/von/.Xresources')
|
|
|
|
if ifexists('/home/von/.autostart') then
|
2014-08-06 20:41:13 +03:00
|
|
|
awful.util.spawn_with_shell('/home/von/.autostart')
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
-- }}}
|