2014-10-19 21:26:42 +03:00
|
|
|
-- {{{ Includes
|
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')
|
2014-10-19 21:26:42 +03:00
|
|
|
-- }}}
|
|
|
|
-- {{{ Custom functions
|
2014-10-20 02:45:52 +03:00
|
|
|
-- test if file exists
|
2014-10-16 02:40:22 +03:00
|
|
|
function exists(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
|
|
|
|
|
2014-10-20 02:45:52 +03:00
|
|
|
-- verify if element is part of the table
|
2014-10-16 02:40:22 +03:00
|
|
|
function enters(element, table)
|
|
|
|
for key, value in pairs(table) do
|
|
|
|
if value == element then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end
|
2016-08-11 13:19:26 +03:00
|
|
|
|
|
|
|
-- update wallpapers, useful when attaching screens
|
|
|
|
function update_wallpapers(wallpaper)
|
|
|
|
for s = 1, screen.count() do
|
|
|
|
gears.wallpaper.centered(wallpaper, s)
|
|
|
|
end
|
|
|
|
end
|
2016-08-11 14:26:53 +03:00
|
|
|
|
2016-08-11 23:25:36 +03:00
|
|
|
-- battery indicator
|
|
|
|
function battery_status ()
|
|
|
|
local batt_status = "/sys/class/power_supply/BAT0/status"
|
|
|
|
local batt_capacity = "/sys/class/power_supply/BAT0/capacity"
|
|
|
|
local fd = io.open(batt_status, "r")
|
|
|
|
if not fd then
|
|
|
|
do return "" end
|
|
|
|
end
|
|
|
|
local text = fd:read("*a")
|
|
|
|
io.close(fd)
|
|
|
|
local fd = io.open(batt_capacity, "r")
|
|
|
|
if not fd then
|
|
|
|
do return "" end
|
|
|
|
end
|
|
|
|
local battery = string.match(fd:read("*a"), "%d+")
|
|
|
|
io.close(fd)
|
|
|
|
local state
|
|
|
|
local icon = ""
|
|
|
|
if string.match(text, "Charging") then
|
|
|
|
state = -1
|
|
|
|
icon = "↑"
|
|
|
|
elseif string.match(text, "Discharging") then
|
|
|
|
state = 1
|
|
|
|
icon = "↓"
|
|
|
|
else
|
|
|
|
stat = 0
|
|
|
|
icon = "•"
|
|
|
|
end
|
|
|
|
return battery .. icon
|
|
|
|
end
|
2014-10-19 21:26:42 +03:00
|
|
|
-- }}}
|
2014-07-18 06:11:03 +03: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)
|
|
|
|
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
|
2014-11-21 02:02:03 +02:00
|
|
|
beautiful.init('/usr/share/awesome/themes/default/theme.lua')
|
2014-07-18 06:11:03 +03:00
|
|
|
theme.font = 'Terminus 9'
|
2015-06-29 18:33:23 +03:00
|
|
|
theme.taglist_font = 'Terminus 11'
|
2014-10-24 18:37:00 +03:00
|
|
|
theme.taglist_squares_sel = nil
|
|
|
|
theme.taglist_squares_unsel = nil
|
2014-07-18 06:11:03 +03:00
|
|
|
|
2015-11-06 09:21:17 +02:00
|
|
|
theme.border_width = 2
|
2015-06-28 23:44:01 +03:00
|
|
|
|
2015-03-16 01:11:16 +02:00
|
|
|
-- amount of pixels to snap windows from
|
2015-04-13 10:08:48 +03:00
|
|
|
snap = 7
|
2015-03-16 01:11:16 +02:00
|
|
|
|
2014-07-18 06:11:03 +03:00
|
|
|
-- set wallpaper
|
2015-12-16 15:19:18 +02:00
|
|
|
local wallpaper = '/home/von/.wallpaper.png'
|
2014-10-16 02:40:22 +03:00
|
|
|
if exists(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.
|
2016-04-29 18:51:20 +03:00
|
|
|
terminal = 'urxvt'
|
2015-11-12 11:22:55 +02:00
|
|
|
editor = 'gvim'
|
|
|
|
editor_cmd = editor
|
2014-07-18 06:11:03 +03: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'
|
|
|
|
|
2014-10-16 02:40:22 +03:00
|
|
|
-- Tables of layouts to cover with awful.layout.inc, order matters.
|
2014-08-06 20:41:13 +03:00
|
|
|
local layouts = {
|
2014-10-16 02:40:22 +03:00
|
|
|
tiled = {
|
|
|
|
awful.layout.suit.tile,
|
2015-06-27 21:33:46 +03:00
|
|
|
awful.layout.suit.tile.top,
|
2014-10-16 02:40:22 +03:00
|
|
|
awful.layout.suit.tile.left,
|
2015-06-27 21:33:46 +03:00
|
|
|
awful.layout.suit.tile.bottom
|
2014-10-16 02:40:22 +03:00
|
|
|
},
|
|
|
|
max = {
|
|
|
|
awful.layout.suit.max,
|
|
|
|
awful.layout.suit.max.fullscreen
|
|
|
|
},
|
|
|
|
float = {
|
|
|
|
awful.layout.suit.floating
|
|
|
|
},
|
2015-08-14 18:47:26 +03:00
|
|
|
magnifier = {
|
|
|
|
awful.layout.suit.magnifier
|
2015-03-24 00:58:58 +02:00
|
|
|
},
|
2014-10-16 02:40:22 +03:00
|
|
|
|
|
|
|
-- Some weird shit I don't use, but it still exists:
|
|
|
|
|
|
|
|
fair = {
|
|
|
|
awful.layout.suit.fair,
|
|
|
|
awful.layout.suit.fair.horizontal
|
|
|
|
},
|
2015-08-14 18:47:26 +03:00
|
|
|
spiral = {
|
|
|
|
awful.layout.suit.spiral,
|
|
|
|
awful.layout.suit.spiral.dwindle
|
2014-10-16 02:40:22 +03:00
|
|
|
}
|
2014-07-18 06:11:03 +03:00
|
|
|
}
|
|
|
|
-- }}}
|
|
|
|
-- {{{ Wallpaper
|
|
|
|
if beautiful.wallpaper then
|
2016-08-11 13:19:26 +03:00
|
|
|
update_wallpapers(beautiful.wallpaper)
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
-- }}}
|
|
|
|
-- {{{ Tags
|
|
|
|
-- Provide tag names and layout settings if we wish to define them
|
|
|
|
tags = {}
|
2015-03-15 23:45:42 +02:00
|
|
|
saved_layouts = {}
|
2014-07-18 06:11:03 +03:00
|
|
|
for s = 1, screen.count() do
|
2014-08-06 20:41:13 +03:00
|
|
|
tags[s] = { name = {}, layout = {} }
|
2015-07-16 13:18:33 +03:00
|
|
|
saved_layouts[s] = { tiled = {}, max = {} }
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
-- screen 1
|
2014-08-06 20:41:13 +03:00
|
|
|
--tags[1].name = {
|
2014-10-15 18:35:48 +03:00
|
|
|
-- [1] = 'example',
|
|
|
|
-- [9] = 'example2'
|
2014-07-18 06:11:03 +03:00
|
|
|
--}
|
2014-08-06 20:41:13 +03:00
|
|
|
tags[1].layout = {
|
2016-08-11 13:37:06 +03:00
|
|
|
[1] = layouts.max[1],
|
2014-11-21 02:16:50 +02:00
|
|
|
[4] = layouts.float[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].layout = {
|
2016-08-11 13:37:06 +03:00
|
|
|
[1] = layouts.max[1],
|
2014-11-21 02:16:50 +02:00
|
|
|
[4] = layouts.float[1]
|
2014-08-06 20:41:13 +03:00
|
|
|
}
|
2014-07-18 06:11:03 +03:00
|
|
|
end
|
|
|
|
-- Fill the missing values with defaults
|
|
|
|
for s = 1, screen.count() do
|
2015-03-16 00:35:50 +02:00
|
|
|
-- Set default tiled layout for all the screens
|
|
|
|
-- if s == 1 and screen.count() ~= 1 then -- in case I ever want to have default for less than 2 screens
|
|
|
|
if s == 1 then
|
|
|
|
default_tiled = layouts.tiled[1]
|
2015-07-02 19:05:59 +03:00
|
|
|
else
|
|
|
|
default_tiled = layouts.tiled[3]
|
2015-03-16 00:35:50 +02:00
|
|
|
end
|
2014-08-06 20:41:13 +03:00
|
|
|
for tag = 1, 9 do
|
2015-03-16 17:16:45 +02:00
|
|
|
local name = tags[s].name[tag] or tostring(tag)
|
2015-03-16 00:35:50 +02:00
|
|
|
local layout = tags[s].layout[tag] or default_tiled
|
2015-03-15 23:45:42 +02:00
|
|
|
tags[s].name[tag] = name
|
|
|
|
tags[s].layout[tag] = layout
|
2015-03-16 00:35:50 +02:00
|
|
|
-- Assign saved tiled layout so that we can use it right away
|
2015-03-15 23:45:42 +02:00
|
|
|
if enters(layout, layouts.tiled) then
|
|
|
|
saved_layouts[s].tiled[name] = layout
|
|
|
|
else
|
2015-03-16 00:35:50 +02:00
|
|
|
saved_layouts[s].tiled[name] = default_tiled
|
2015-03-15 23:45:42 +02:00
|
|
|
end
|
2015-07-16 13:18:33 +03:00
|
|
|
saved_layouts[s].max[name] = layouts.max[1]
|
2014-08-06 20:41:13 +03:00
|
|
|
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
|
2014-10-16 02:40:22 +03:00
|
|
|
mymainmenu_restart = {
|
2014-08-06 20:41:13 +03:00
|
|
|
{ 'restart', awesome.restart }
|
2014-07-18 06:11:03 +03:00
|
|
|
}
|
2016-08-11 13:19:26 +03:00
|
|
|
mymainmenu_screens = {
|
2016-08-11 23:25:36 +03:00
|
|
|
{ 'one', function() awful.util.spawn('xrandr --output DP1 --off') end },
|
|
|
|
{ 'two', function() awful.util.spawn('xrandr --output DP1 --primary --auto --output eDP1 --auto --right-of DP1') end }
|
2016-08-11 13:19:26 +03:00
|
|
|
}
|
2015-03-24 00:58:58 +02:00
|
|
|
--mymainmenu_quit = {
|
|
|
|
-- { 'quit', awesome.quit }
|
|
|
|
--}
|
2014-07-18 06:11:03 +03:00
|
|
|
|
2014-08-06 20:41:13 +03:00
|
|
|
mymainmenu = awful.menu({
|
|
|
|
items = {
|
2016-08-11 13:19:26 +03:00
|
|
|
{ 'restart', mymainmenu_restart, beautiful.awesome_icon },
|
|
|
|
{ 'screens', mymainmenu_screens, beautiful.awesome_icon }
|
2015-03-24 00:58:58 +02:00
|
|
|
-- { 'quit', mymainmenu_quit, beautiful.awesome_icon }
|
2014-08-06 20:41:13 +03:00
|
|
|
}
|
|
|
|
})
|
2014-07-18 06:11:03 +03:00
|
|
|
|
|
|
|
-- Menubar configuration
|
|
|
|
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
|
|
|
|
-- }}}
|
2014-10-16 02:40:22 +03:00
|
|
|
-- {{{ Menu for layoutbox
|
|
|
|
mylbmenu = awful.menu({
|
|
|
|
items = {
|
2015-03-15 23:45:42 +02:00
|
|
|
{ 'Tiled',
|
|
|
|
function ()
|
|
|
|
local screen = mouse.screen
|
|
|
|
local tag = awful.tag.selected(screen).name
|
|
|
|
awful.layout.set(saved_layouts[screen].tiled[tag])
|
|
|
|
end
|
|
|
|
},
|
2014-10-16 02:40:22 +03:00
|
|
|
{ 'Maximized', function () awful.layout.set(layouts.max[1]) end },
|
2015-03-24 00:58:58 +02:00
|
|
|
{ 'Floating', function () awful.layout.set(layouts.float[1]) end },
|
|
|
|
{ 'Spiral', function () awful.layout.set(layouts.spiral[1]) end }
|
2014-10-16 02:40:22 +03:00
|
|
|
}
|
|
|
|
})
|
|
|
|
-- }}}
|
2014-07-18 06:11:03 +03:00
|
|
|
-- {{{ Wibox
|
|
|
|
-- Create a textclock widget
|
2014-10-24 18:37:00 +03:00
|
|
|
mytextclock = awful.widget.textclock(' %a %d %H:%M ')
|
2014-07-18 06:11:03 +03:00
|
|
|
mytextclock:set_font('Terminus Bold 11')
|
2014-08-15 16:27:29 +03:00
|
|
|
-- Create a mail notification widget
|
2014-07-18 06:11:03 +03:00
|
|
|
mytextbox = wibox.widget.textbox()
|
|
|
|
mytextbox:set_text('')
|
|
|
|
mytextbox:set_font('Terminus 9')
|
2016-08-11 14:26:53 +03:00
|
|
|
-- A box to show info about new mail, temporary unneeded
|
|
|
|
--mytextbox_bg = wibox.widget.background()
|
|
|
|
--mytextbox_bg:set_widget(mytextbox)
|
|
|
|
--mytextbox_bg:set_bg(theme.bg_minimize)
|
|
|
|
--mytextbox_bg:set_fg(theme.fg_minimize)
|
2014-08-15 16:27:29 +03:00
|
|
|
-- Create keyboard layout indicator widget
|
|
|
|
--mykblayout = wibox.widget.textbox()
|
|
|
|
--mykblayout:set_text('US')
|
|
|
|
--mykblayout:set_font('Terminus Bold 11')
|
2014-07-18 06:11:03 +03:00
|
|
|
|
2016-08-11 23:25:36 +03:00
|
|
|
-- Battery indicator
|
|
|
|
mybattstatus = wibox.widget.textbox()
|
|
|
|
--mybattstatus:set_font('Terminus Bold 11')
|
|
|
|
mybattstatus:set_font('Terminus 9')
|
|
|
|
|
2014-07-18 06:11:03 +03:00
|
|
|
-- Create a wibox for each screen and add it
|
|
|
|
mywibox = {}
|
|
|
|
mypromptbox = {}
|
|
|
|
mylayoutbox = {}
|
|
|
|
mytaglist = {}
|
|
|
|
mytaglist.buttons = awful.util.table.join(
|
2014-10-15 18:35:48 +03:00
|
|
|
awful.button({ }, 1, awful.tag.viewonly),
|
2014-08-06 20:41:13 +03:00
|
|
|
awful.button({ modkey }, 1, awful.client.movetotag),
|
2014-10-15 18:35:48 +03:00
|
|
|
awful.button({ }, 3, awful.tag.viewtoggle),
|
2014-10-19 21:26:42 +03:00
|
|
|
awful.button({ modkey }, 3, awful.client.toggletag)
|
2014-08-06 20:41:13 +03:00
|
|
|
)
|
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)
|
2014-09-15 12:47:38 +03:00
|
|
|
if c ~= client.focus then
|
2014-08-06 20:41:13 +03:00
|
|
|
-- 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(
|
2014-10-16 02:40:22 +03:00
|
|
|
awful.button({ }, 1,
|
|
|
|
function ()
|
2015-03-15 23:45:42 +02:00
|
|
|
local screen = mouse.screen
|
|
|
|
local current_layout = awful.layout.get(screen)
|
2014-10-16 02:40:22 +03:00
|
|
|
if enters(current_layout, layouts.tiled) then
|
2015-03-15 23:45:42 +02:00
|
|
|
local tag = awful.tag.selected(screen).name
|
2014-10-16 02:40:22 +03:00
|
|
|
awful.layout.inc(layouts.tiled, 1)
|
2015-03-15 23:45:42 +02:00
|
|
|
saved_layouts[screen].tiled[tag] = awful.layout.get(screen)
|
2014-10-16 02:40:22 +03:00
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.button({ }, 3, function () mylbmenu:toggle() end)
|
2014-08-06 20:41:13 +03:00
|
|
|
)
|
|
|
|
)
|
|
|
|
-- 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
|
2014-10-24 18:37:00 +03:00
|
|
|
mywibox[s] = awful.wibox({ position = 'top', height = '18', screen = s })
|
2014-08-06 20:41:13 +03:00
|
|
|
|
|
|
|
local left_layout = wibox.layout.fixed.horizontal()
|
|
|
|
local right_layout = wibox.layout.fixed.horizontal()
|
|
|
|
if s == 1 then
|
|
|
|
right_layout:add(mypromptbox[s])
|
2016-08-11 14:26:53 +03:00
|
|
|
--right_layout:add(mytextbox_bg)
|
|
|
|
right_layout:add(mytaglist[s])
|
|
|
|
right_layout:add(wibox.widget.systray())
|
2016-08-11 23:25:36 +03:00
|
|
|
right_layout:add(mybattstatus)
|
2016-08-10 12:56:36 +03:00
|
|
|
right_layout:add(mytextclock)
|
2014-08-06 20:41:13 +03:00
|
|
|
right_layout:add(mylayoutbox[s])
|
|
|
|
elseif s == 2 then
|
|
|
|
left_layout:add(mylayoutbox[s])
|
|
|
|
left_layout:add(mytextclock)
|
|
|
|
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(
|
2014-10-16 02:40:22 +03:00
|
|
|
awful.button({ }, 3, function () mymainmenu:toggle() end)
|
2014-08-06 20:41:13 +03:00
|
|
|
)
|
|
|
|
)
|
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),
|
|
|
|
|
2014-08-21 15:48:23 +03:00
|
|
|
-- Switch between windows
|
2014-12-26 02:42:54 +02:00
|
|
|
awful.key({ modkey, }, 'j', function () awful.client.focus.byidx( 1) client.focus:raise() end),
|
2014-08-31 00:04:43 +03:00
|
|
|
awful.key({ modkey, }, 'k', function () awful.client.focus.byidx(-1) client.focus:raise() end),
|
2014-08-21 15:48:23 +03:00
|
|
|
awful.key({ modkey, }, 'i', function () client.focus:raise() end),
|
2014-08-06 20:41:13 +03:00
|
|
|
awful.key({ modkey, }, 'w', function () mymainmenu:show() end),
|
|
|
|
|
2014-10-15 18:35:48 +03:00
|
|
|
-- Switch between screens
|
|
|
|
awful.key({ modkey, }, 'o', function () awful.screen.focus_relative(1) end),
|
|
|
|
|
2014-08-06 20:41:13 +03:00
|
|
|
-- Layout manipulation
|
2014-12-26 02:42:54 +02:00
|
|
|
awful.key({ modkey, 'Shift' }, 'j', function () awful.client.swap.byidx( 1) end),
|
2014-08-06 20:41:13 +03:00
|
|
|
awful.key({ modkey, 'Shift' }, 'k', function () awful.client.swap.byidx(-1) end),
|
|
|
|
awful.key({ modkey, }, 'u', awful.client.urgent.jumpto),
|
2014-08-21 15:48:23 +03:00
|
|
|
|
|
|
|
-- Mod#+Tab hotkeys
|
2014-08-06 20:41:13 +03:00
|
|
|
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),
|
|
|
|
|
2014-12-26 02:42:54 +02:00
|
|
|
awful.key({ modkey, }, 'l', function () awful.tag.incmwfact( 0.05) end),
|
2014-08-31 00:04:43 +03:00
|
|
|
awful.key({ modkey, }, 'h', function () awful.tag.incmwfact(-0.05) end),
|
2014-12-26 02:42:54 +02:00
|
|
|
awful.key({ modkey, 'Shift' }, 'h', function () awful.tag.incnmaster( 1) end),
|
2014-08-31 00:04:43 +03:00
|
|
|
awful.key({ modkey, 'Shift' }, 'l', function () awful.tag.incnmaster(-1) end),
|
2014-12-26 02:42:54 +02:00
|
|
|
awful.key({ modkey, 'Control' }, 'h', function () awful.tag.incncol( 1) end),
|
2014-08-31 00:04:43 +03:00
|
|
|
awful.key({ modkey, 'Control' }, 'l', function () awful.tag.incncol(-1) end),
|
2015-08-14 18:47:26 +03:00
|
|
|
awful.key({ modkey, }, 'f', function () awful.layout.set(layouts.float[1]) end),
|
|
|
|
awful.key({ modkey, }, 'g', function () awful.layout.set(layouts.magnifier[1]) end),
|
2014-10-16 02:40:22 +03:00
|
|
|
awful.key({ modkey, }, 'm',
|
|
|
|
function ()
|
2015-03-24 00:58:58 +02:00
|
|
|
local screen = mouse.screen
|
|
|
|
local current_layout = awful.layout.get(screen)
|
2015-07-16 13:18:33 +03:00
|
|
|
local tag = awful.tag.selected(screen).name
|
2014-10-16 02:40:22 +03:00
|
|
|
if not enters(current_layout, layouts.max) then
|
2015-07-16 13:18:33 +03:00
|
|
|
awful.layout.set(saved_layouts[screen].max[tag])
|
2014-10-16 02:40:22 +03:00
|
|
|
else
|
|
|
|
awful.layout.inc(layouts.max, 1)
|
2015-07-16 13:18:33 +03:00
|
|
|
saved_layouts[screen].max[tag] = awful.layout.get(screen)
|
2014-10-16 02:40:22 +03:00
|
|
|
end
|
|
|
|
end),
|
2014-09-01 14:58:27 +03:00
|
|
|
awful.key({ modkey, }, 't',
|
|
|
|
function ()
|
2015-03-15 23:45:42 +02:00
|
|
|
local screen = mouse.screen
|
|
|
|
local current_layout = awful.layout.get(screen)
|
|
|
|
local tag = awful.tag.selected(screen).name
|
2014-10-16 02:40:22 +03:00
|
|
|
if not enters(current_layout, layouts.tiled) then
|
2015-03-15 23:45:42 +02:00
|
|
|
awful.layout.set(saved_layouts[screen].tiled[tag])
|
2014-09-01 14:58:27 +03:00
|
|
|
else
|
2014-10-16 02:40:22 +03:00
|
|
|
awful.layout.inc(layouts.tiled, 1)
|
2015-03-15 23:45:42 +02:00
|
|
|
saved_layouts[screen].tiled[tag] = awful.layout.get(screen)
|
2014-09-01 14:58:27 +03:00
|
|
|
end
|
|
|
|
end),
|
2015-03-24 00:58:58 +02:00
|
|
|
awful.key({ modkey, }, 's',
|
|
|
|
function ()
|
|
|
|
local screen = mouse.screen
|
|
|
|
local current_layout = awful.layout.get(screen)
|
|
|
|
if not enters(current_layout, layouts.spiral) then
|
|
|
|
awful.layout.set(layouts.spiral[1])
|
|
|
|
else
|
|
|
|
awful.layout.inc(layouts.spiral, 1)
|
|
|
|
end
|
|
|
|
end),
|
2014-08-06 20:41:13 +03:00
|
|
|
|
|
|
|
awful.key({ modkey, 'Control' }, 'n', awful.client.restore),
|
|
|
|
|
|
|
|
-- Prompt
|
|
|
|
awful.key({ modkey, }, 'r', 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
|
2015-08-05 06:24:06 +03:00
|
|
|
awful.key({ modkey, 'Shift' }, '\\', function () awful.util.spawn('/home/von/vscripts/compton_toggle', false) end),
|
2014-08-06 20:41:13 +03:00
|
|
|
awful.key({ modkey, }, 'x', function () awful.util.spawn(terminal) end),
|
2014-08-15 16:27:29 +03:00
|
|
|
awful.key({ modkey, }, 'q', function () awful.util.spawn('/home/von/.local/bin/ticket_watch', false) end),
|
2015-12-16 15:32:07 +02:00
|
|
|
awful.key({ modkey, }, 'z', function () awful.util.spawn('bash -c "until i3lock -entc 661111 -i /home/von/.wallpaper.png; do :; done"') end),
|
2014-08-15 16:27:29 +03:00
|
|
|
awful.key({ modkey, }, 'F6', function () awful.util.spawn('/home/von/touchpad_hotkey.sh', false) end),
|
2014-08-06 20:41:13 +03:00
|
|
|
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)
|
2014-07-18 06:11:03 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
clientkeys = awful.util.table.join(
|
2014-08-06 20:41:13 +03:00
|
|
|
awful.key({ modkey, 'Shift' }, 'c', function (c) c:kill() end),
|
|
|
|
awful.key({ modkey, }, 'Return', function (c) c:swap(awful.client.getmaster()) end),
|
2014-10-15 18:35:48 +03:00
|
|
|
awful.key({ modkey, 'Shift' }, 'o', awful.client.movetoscreen ),
|
|
|
|
awful.key({ modkey, }, 'n', function (c) c.minimized = true end),
|
|
|
|
|
|
|
|
-- Window properties
|
2015-08-10 14:51:45 +03:00
|
|
|
awful.key({ modkey, 'Shift' }, 'Return', function (c) c.fullscreen = not c.fullscreen end),
|
2014-12-26 02:42:54 +02:00
|
|
|
awful.key({ modkey, }, 'b',
|
|
|
|
function (c)
|
|
|
|
if c.border_width ~= 0 then
|
|
|
|
c.border_width = 0
|
|
|
|
else
|
|
|
|
c.border_width = beautiful.border_width
|
|
|
|
end
|
|
|
|
end),
|
2014-08-31 00:04:43 +03:00
|
|
|
awful.key({ modkey, 'Shift' }, 't', function (c) c.ontop = not c.ontop end),
|
|
|
|
awful.key({ modkey, 'Shift' }, 's', function (c) c.sticky = not c.sticky end),
|
2015-03-19 13:58:42 +02:00
|
|
|
awful.key({ modkey, }, '`', awful.client.floating.toggle ),
|
2014-08-31 00:04:43 +03:00
|
|
|
awful.key({ modkey, 'Shift' }, 'm',
|
2014-08-06 20:41:13 +03:00
|
|
|
function (c)
|
|
|
|
c.maximized_horizontal = not c.maximized_horizontal
|
|
|
|
c.maximized_vertical = not c.maximized_vertical
|
2014-08-19 01:02:23 +03:00
|
|
|
if c.maximized_horizontal == true and c.maximized_vertical == true then
|
|
|
|
c.border_width = 0
|
2014-08-29 17:52:41 +03:00
|
|
|
client.focus:raise()
|
2014-08-19 01:02:23 +03:00
|
|
|
else
|
|
|
|
c.border_width = beautiful.border_width
|
|
|
|
end
|
2014-08-06 20:41:13 +03:00
|
|
|
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
|
2015-03-21 00:09:34 +02:00
|
|
|
if awful.tag.selected(screen) == tag and awful.tag.selectedlist(screen)[2] == nil then
|
|
|
|
awful.tag.history.restore()
|
|
|
|
else
|
|
|
|
awful.tag.viewonly(tag)
|
|
|
|
end
|
2014-08-06 20:41:13 +03:00
|
|
|
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(
|
2015-03-16 01:11:16 +02:00
|
|
|
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
|
|
|
|
awful.button({ modkey }, 1, function (c) client.focus = c; awful.mouse.client.move(c, snap) end),
|
2014-08-06 20:41:13 +03:00
|
|
|
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,
|
2015-03-16 01:11:16 +02:00
|
|
|
buttons = clientbuttons
|
2014-08-06 20:41:13 +03:00
|
|
|
}
|
|
|
|
},
|
2014-11-13 14:04:43 +02:00
|
|
|
-- Floating only rules:
|
2014-08-06 20:41:13 +03:00
|
|
|
{
|
|
|
|
rule_any = {
|
|
|
|
class = {
|
|
|
|
'Deadbeef',
|
2014-09-11 12:58:46 +03:00
|
|
|
'Google-musicmanager',
|
2014-08-22 08:24:01 +03:00
|
|
|
'mpv',
|
2014-08-06 20:41:13 +03:00
|
|
|
'Pavucontrol',
|
2014-08-22 08:24:01 +03:00
|
|
|
'pinentry',
|
2014-08-06 20:41:13 +03:00
|
|
|
'plugin-container',
|
2016-08-11 13:19:26 +03:00
|
|
|
'Skype',
|
2014-08-22 08:24:01 +03:00
|
|
|
'Vncviewer'
|
2014-08-06 20:41:13 +03:00
|
|
|
},
|
|
|
|
instance = {
|
|
|
|
'sun-awt-X11-XFramePeer'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
properties = {
|
|
|
|
floating = true
|
|
|
|
}
|
|
|
|
},
|
2015-03-18 11:51:04 +02:00
|
|
|
-- Floating borderless, because winamp nostalgia:
|
|
|
|
{
|
|
|
|
rule_any = {
|
|
|
|
class = {
|
|
|
|
'Audacious',
|
|
|
|
'Qmmp'
|
2015-09-17 15:01:33 +03:00
|
|
|
},
|
|
|
|
role = {
|
|
|
|
'bubble'
|
2015-03-18 11:51:04 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
properties = {
|
|
|
|
border_width = 0,
|
|
|
|
floating = true
|
|
|
|
}
|
|
|
|
},
|
2014-11-13 14:04:43 +02:00
|
|
|
-- Per app rules
|
2014-08-06 20:41:13 +03:00
|
|
|
-- firefox
|
|
|
|
{
|
|
|
|
rule = { class = 'Firefox' },
|
|
|
|
except = { instance = 'Navigator' },
|
|
|
|
properties = { floating = true }
|
|
|
|
},
|
|
|
|
-- ardour3
|
|
|
|
{
|
|
|
|
rule = { class = 'Ardour' },
|
|
|
|
except = { instance = 'ardour_editor' },
|
|
|
|
properties = { floating = true }
|
|
|
|
},
|
|
|
|
-- Specific desktops rules: place windows only on specific tags by default
|
2014-12-26 02:42:54 +02:00
|
|
|
-- tag 4: games = maximized
|
2014-11-13 14:04:43 +02:00
|
|
|
{
|
|
|
|
rule_any = {
|
2015-08-26 00:47:26 +03:00
|
|
|
class = {
|
2014-11-13 14:04:43 +02:00
|
|
|
'BaldursGate',
|
2015-04-12 04:02:00 +03:00
|
|
|
'BaldursGateII',
|
2015-07-29 10:36:42 +03:00
|
|
|
'IcewindDale',
|
2015-08-26 00:47:26 +03:00
|
|
|
'starbound',
|
2015-08-14 02:55:50 +03:00
|
|
|
'Terraria.bin.x86',
|
2015-07-29 10:36:42 +03:00
|
|
|
'Terraria.bin.x86_64'
|
2015-08-26 00:47:26 +03:00
|
|
|
},
|
|
|
|
name = {
|
|
|
|
'Pillars of Eternity'
|
2014-11-13 14:04:43 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
properties = {
|
|
|
|
border_width = 0,
|
2015-08-21 09:55:37 +03:00
|
|
|
maximized = true
|
2014-11-13 14:04:43 +02:00
|
|
|
}
|
|
|
|
},
|
2014-11-21 02:16:50 +02:00
|
|
|
-- tag 4: steam and games
|
2014-08-06 20:41:13 +03:00
|
|
|
{
|
2014-08-22 08:24:01 +03:00
|
|
|
rule_any = {
|
|
|
|
class = { 'Steam' },
|
|
|
|
instance = { 'Steam.exe' }
|
|
|
|
},
|
2014-08-06 20:41:13 +03:00
|
|
|
properties = { tag = tags[1][4] }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule_any = {
|
|
|
|
class = {
|
2014-09-23 08:10:54 +03:00
|
|
|
'Awesomenauts.bin.x86',
|
2014-08-22 08:24:01 +03:00
|
|
|
'Civ5XP',
|
2014-12-21 10:01:06 +02:00
|
|
|
'CivBE',
|
|
|
|
'Cities In Motion.bin',
|
2014-08-22 08:24:01 +03:00
|
|
|
'ck2',
|
2014-09-23 08:10:54 +03:00
|
|
|
'csgo_linux',
|
2014-12-26 02:42:54 +02:00
|
|
|
'DefenseGrid2',
|
2014-08-22 08:24:01 +03:00
|
|
|
'deponia_tcj',
|
2014-08-06 20:41:13 +03:00
|
|
|
'dota_linux',
|
2015-06-24 02:13:52 +03:00
|
|
|
'dota2',
|
2014-08-22 08:24:01 +03:00
|
|
|
'game.x86_64',
|
2014-08-06 20:41:13 +03:00
|
|
|
'hl2_linux',
|
|
|
|
'Pandora',
|
2014-08-22 08:24:01 +03:00
|
|
|
'Strife',
|
2014-08-06 20:41:13 +03:00
|
|
|
'Symphony.bin.x86_64',
|
2014-12-21 10:01:06 +02:00
|
|
|
'eu4',
|
2015-03-18 11:51:04 +02:00
|
|
|
'witcher2'
|
2014-08-06 20:41:13 +03:00
|
|
|
},
|
|
|
|
instance = {
|
|
|
|
'Civ4BeyondSword.exe',
|
2014-11-29 11:02:39 +02:00
|
|
|
'GameApp.exe',
|
2014-09-14 17:31:16 +03:00
|
|
|
'KB.exe',
|
|
|
|
'nwn2main.exe'
|
2014-08-22 08:24:01 +03:00
|
|
|
},
|
|
|
|
name = {
|
2014-12-21 10:01:06 +02:00
|
|
|
'Cities in Motion 2',
|
2014-10-16 02:40:22 +03:00
|
|
|
'GunsOfIcarusOnline',
|
2014-08-31 00:04:43 +03:00
|
|
|
'Hand of Fate',
|
|
|
|
'Serious Sam 3 - Linux'
|
2014-08-06 20:41:13 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
properties = {
|
|
|
|
border_width = 0,
|
|
|
|
floating = true,
|
2014-11-21 02:16:50 +02:00
|
|
|
tag = tags[1][4]
|
2014-08-06 20:41:13 +03:00
|
|
|
}
|
|
|
|
}
|
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)
|
2014-11-13 14:04:43 +02:00
|
|
|
if awful.layout.get(c.screen) ~= layouts.magnifier[1] and awful.client.focus.filter(c) then
|
2014-08-06 20:41:13 +03:00
|
|
|
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.
|
2015-03-16 01:11:16 +02:00
|
|
|
awful.client.setslave(c)
|
2014-08-06 20:41:13 +03:00
|
|
|
|
|
|
|
-- 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)
|
2015-03-19 18:47:20 +02:00
|
|
|
|
|
|
|
-- save floating layout parameters for windows created and managed during the current session
|
|
|
|
tag.connect_signal(
|
|
|
|
'property::layout',
|
|
|
|
function(t)
|
|
|
|
for k, c in ipairs(t:clients()) do
|
2015-03-20 01:52:32 +02:00
|
|
|
if awful.layout.get(mouse.screen) == awful.layout.suit.floating then
|
2015-03-21 00:09:34 +02:00
|
|
|
c:geometry(awful.client.property.get(c, 'floating_geometry'))
|
2015-03-19 18:47:20 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
)
|
|
|
|
|
|
|
|
client.connect_signal(
|
|
|
|
'manage',
|
|
|
|
function(c)
|
2015-03-20 01:52:32 +02:00
|
|
|
if awful.layout.get(mouse.screen) == awful.layout.suit.floating then
|
2015-03-21 00:09:34 +02:00
|
|
|
awful.client.property.set(c, 'floating_geometry', c:geometry())
|
2015-03-19 18:47:20 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
)
|
|
|
|
|
|
|
|
client.connect_signal(
|
|
|
|
'property::geometry',
|
|
|
|
function(c)
|
2015-03-21 00:09:34 +02:00
|
|
|
if awful.layout.get(mouse.screen) == awful.layout.suit.floating then
|
|
|
|
awful.client.property.set(c, 'floating_geometry', c:geometry())
|
2015-03-19 18:47:20 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
)
|
2016-08-11 23:25:36 +03:00
|
|
|
|
|
|
|
-- timers
|
|
|
|
if exists("/sys/class/power_supply/BAT0") then
|
|
|
|
mytimer = timer({ timeout = 1 })
|
|
|
|
mybattstatus:set_text('•••')
|
|
|
|
mytimer:connect_signal("timeout", function() mybattstatus:set_text(battery_status()) end)
|
|
|
|
mytimer:start()
|
|
|
|
end
|
2014-07-18 06:11:03 +03:00
|
|
|
-- }}}
|
|
|
|
-- {{{ Autostart
|
|
|
|
-- don't forget you sync this file
|
|
|
|
-- this shit runs every time you restart your wm, dumbass.
|
2015-01-24 16:38:22 +02:00
|
|
|
---- set keyboard layouts
|
2016-05-11 18:32:30 +03:00
|
|
|
awful.util.spawn_with_shell('setxkbmap -layout us,ru -variant altgr-intl,typewriter -option ctrl:nocaps,grp:win_space_toggle,grp_led:caps,compose:menu')
|
2016-08-10 12:56:36 +03:00
|
|
|
awful.util.spawn_with_shell('xkbcomp $DISPLAY - | egrep -v "group . = AltGr;" | xkbcomp - $DISPLAY')
|
2015-01-21 01:08:40 +02:00
|
|
|
---- populate xrdb with .Xresources config
|
2015-03-20 16:52:34 +02:00
|
|
|
if exists('/home/von/.Xresources') then
|
|
|
|
awful.util.spawn_with_shell('xrdb /home/von/.Xresources')
|
|
|
|
end
|
2015-01-21 01:08:40 +02:00
|
|
|
---- execute all the other shit, installation specific
|
2014-10-16 02:40:22 +03:00
|
|
|
if exists('/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
|
|
|
|
-- }}}
|