mirror of
https://github.com/lcpz/awesome-copycats.git
synced 2024-12-22 11:12:31 +00:00
synchronise rc.lua with Awesome master
This commit is contained in:
parent
e22ff52948
commit
dbc2b5ca69
|
@ -151,7 +151,7 @@ Blackburn and Dremora use Icons_, Vertex uses FontAwesome_: be sure to have bitm
|
||||||
|
|
||||||
Additional default software used: ::
|
Additional default software used: ::
|
||||||
|
|
||||||
unclutter firefox scrot mpd mpc dmenu xsel xlock
|
unclutter firefox scrot mpd mpc dmenu xsel slock
|
||||||
|
|
||||||
.. _BY-NC-SA: http://creativecommons.org/licenses/by-nc-sa/4.0
|
.. _BY-NC-SA: http://creativecommons.org/licenses/by-nc-sa/4.0
|
||||||
.. _b0ab0d7: https://github.com/lcpz/awesome-copycats/tree/b0ab0d7837987be81b9195a36631df773113d491
|
.. _b0ab0d7: https://github.com/lcpz/awesome-copycats/tree/b0ab0d7837987be81b9195a36631df773113d491
|
||||||
|
|
135
rc.lua.template
135
rc.lua.template
|
@ -19,16 +19,20 @@ local lain = require("lain")
|
||||||
--local menubar = require("menubar")
|
--local menubar = require("menubar")
|
||||||
local freedesktop = require("freedesktop")
|
local freedesktop = require("freedesktop")
|
||||||
local hotkeys_popup = require("awful.hotkeys_popup").widget
|
local hotkeys_popup = require("awful.hotkeys_popup").widget
|
||||||
|
require("awful.hotkeys_popup.keys")
|
||||||
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
-- {{{ Error handling
|
-- {{{ 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
|
if awesome.startup_errors then
|
||||||
naughty.notify({ preset = naughty.config.presets.critical,
|
naughty.notify({ preset = naughty.config.presets.critical,
|
||||||
title = "Oops, there were errors during startup!",
|
title = "Oops, there were errors during startup!",
|
||||||
text = awesome.startup_errors })
|
text = awesome.startup_errors })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Handle runtime errors after startup
|
||||||
do
|
do
|
||||||
local in_error = false
|
local in_error = false
|
||||||
awesome.connect_signal("debug::error", function (err)
|
awesome.connect_signal("debug::error", function (err)
|
||||||
|
@ -52,7 +56,7 @@ local function run_once(cmd_arr)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
run_once({ "urxvtd", "unclutter -root" }) -- entries must be comma-separated
|
run_once({ "urxvtd", "unclutter -root" }) -- entries must be separated by commas
|
||||||
|
|
||||||
-- This function implements the XDG autostart specification
|
-- This function implements the XDG autostart specification
|
||||||
--[[
|
--[[
|
||||||
|
@ -84,12 +88,12 @@ local themes = {
|
||||||
local chosen_theme = themes[5]
|
local chosen_theme = themes[5]
|
||||||
local modkey = "Mod4"
|
local modkey = "Mod4"
|
||||||
local altkey = "Mod1"
|
local altkey = "Mod1"
|
||||||
local terminal = "xterm"
|
local terminal = "urxvtc"
|
||||||
local editor = os.getenv("EDITOR") or "nano"
|
local editor = os.getenv("EDITOR") or "vim"
|
||||||
local gui_editor = "gvim"
|
local gui_editor = "gvim"
|
||||||
local browser = "firefox"
|
local browser = "firefox"
|
||||||
local guieditor = "atom"
|
local guieditor = "atom"
|
||||||
local scrlocker = "xlock"
|
local scrlocker = "slock"
|
||||||
|
|
||||||
awful.util.terminal = terminal
|
awful.util.terminal = terminal
|
||||||
awful.util.tagnames = { "1", "2", "3", "4", "5" }
|
awful.util.tagnames = { "1", "2", "3", "4", "5" }
|
||||||
|
@ -117,57 +121,47 @@ awful.layout.layouts = {
|
||||||
--lain.layout.termfair,
|
--lain.layout.termfair,
|
||||||
--lain.layout.termfair.center,
|
--lain.layout.termfair.center,
|
||||||
}
|
}
|
||||||
awful.util.taglist_buttons = my_table.join(
|
|
||||||
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)
|
|
||||||
)
|
|
||||||
awful.util.tasklist_buttons = my_table.join(
|
|
||||||
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() and c.first_tag then
|
|
||||||
c.first_tag:view_only()
|
|
||||||
end
|
|
||||||
-- This will also un-minimize
|
|
||||||
-- the client, if needed
|
|
||||||
client.focus = c
|
|
||||||
c:raise()
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
awful.button({ }, 3, function()
|
|
||||||
local instance = nil
|
|
||||||
|
|
||||||
return function ()
|
awful.util.taglist_buttons = my_table.join(
|
||||||
if instance and instance.wibox.visible then
|
awful.button({ }, 1, function(t) t:view_only() end),
|
||||||
instance:hide()
|
awful.button({ modkey }, 1, function(t)
|
||||||
instance = nil
|
if client.focus then
|
||||||
else
|
client.focus:move_to_tag(t)
|
||||||
instance = awful.menu.clients({ theme = { width = 250 } })
|
end
|
||||||
end
|
end),
|
||||||
end
|
awful.button({ }, 3, awful.tag.viewtoggle),
|
||||||
end),
|
awful.button({ modkey }, 3, function(t)
|
||||||
awful.button({ }, 4, function ()
|
if client.focus then
|
||||||
awful.client.focus.byidx(1)
|
client.focus:toggle_tag(t)
|
||||||
end),
|
end
|
||||||
awful.button({ }, 5, function ()
|
end),
|
||||||
awful.client.focus.byidx(-1)
|
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
|
||||||
end))
|
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
|
||||||
|
)
|
||||||
|
|
||||||
|
awful.util.tasklist_buttons = my_table.join(
|
||||||
|
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 ()
|
||||||
|
local instance = nil
|
||||||
|
|
||||||
|
return function ()
|
||||||
|
if instance and instance.wibox.visible then
|
||||||
|
instance:hide()
|
||||||
|
instance = nil
|
||||||
|
else
|
||||||
|
instance = awful.menu.clients({theme = {width = 250}})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
awful.button({ }, 4, function () awful.client.focus.byidx(1) end),
|
||||||
|
awful.button({ }, 5, function () awful.client.focus.byidx(-1) end)
|
||||||
|
)
|
||||||
|
|
||||||
lain.layout.termfair.nmaster = 3
|
lain.layout.termfair.nmaster = 3
|
||||||
lain.layout.termfair.ncol = 1
|
lain.layout.termfair.ncol = 1
|
||||||
|
@ -179,8 +173,7 @@ lain.layout.cascade.tile.extra_padding = 5
|
||||||
lain.layout.cascade.tile.nmaster = 5
|
lain.layout.cascade.tile.nmaster = 5
|
||||||
lain.layout.cascade.tile.ncol = 2
|
lain.layout.cascade.tile.ncol = 2
|
||||||
|
|
||||||
local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme)
|
beautiful.init(string.format(gears.filesystem.get_configuration_dir() .. "/themes/%s/theme.lua", chosen_theme))
|
||||||
beautiful.init(theme_path)
|
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
-- {{{ Menu
|
-- {{{ Menu
|
||||||
|
@ -608,10 +601,19 @@ for i = 1, 9 do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
clientbuttons = my_table.join(
|
clientbuttons = gears.table.join(
|
||||||
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
|
awful.button({ }, 1, function (c)
|
||||||
awful.button({ modkey }, 1, awful.mouse.client.move),
|
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
||||||
awful.button({ modkey }, 3, awful.mouse.client.resize))
|
end),
|
||||||
|
awful.button({ modkey }, 1, function (c)
|
||||||
|
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
||||||
|
awful.mouse.client.move(c)
|
||||||
|
end),
|
||||||
|
awful.button({ modkey }, 3, function (c)
|
||||||
|
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
||||||
|
awful.mouse.client.resize(c)
|
||||||
|
end)
|
||||||
|
)
|
||||||
|
|
||||||
-- Set keys
|
-- Set keys
|
||||||
root.keys(globalkeys)
|
root.keys(globalkeys)
|
||||||
|
@ -674,13 +676,11 @@ client.connect_signal("request::titlebars", function(c)
|
||||||
-- buttons for the titlebar
|
-- buttons for the titlebar
|
||||||
local buttons = my_table.join(
|
local buttons = my_table.join(
|
||||||
awful.button({ }, 1, function()
|
awful.button({ }, 1, function()
|
||||||
client.focus = c
|
c:emit_signal("request::activate", "titlebar", {raise = true})
|
||||||
c:raise()
|
|
||||||
awful.mouse.client.move(c)
|
awful.mouse.client.move(c)
|
||||||
end),
|
end),
|
||||||
awful.button({ }, 3, function()
|
awful.button({ }, 3, function()
|
||||||
client.focus = c
|
c:emit_signal("request::activate", "titlebar", {raise = true})
|
||||||
c:raise()
|
|
||||||
awful.mouse.client.resize(c)
|
awful.mouse.client.resize(c)
|
||||||
end)
|
end)
|
||||||
)
|
)
|
||||||
|
@ -713,10 +713,7 @@ end)
|
||||||
|
|
||||||
-- Enable sloppy focus, so that focus follows mouse.
|
-- Enable sloppy focus, so that focus follows mouse.
|
||||||
client.connect_signal("mouse::enter", function(c)
|
client.connect_signal("mouse::enter", function(c)
|
||||||
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
|
c:emit_signal("request::activate", "mouse_enter", {raise = true})
|
||||||
and awful.client.focus.filter(c) then
|
|
||||||
client.focus = c
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- No border for maximized clients
|
-- No border for maximized clients
|
||||||
|
@ -729,7 +726,7 @@ function border_adjust(c)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
client.connect_signal("focus", border_adjust)
|
|
||||||
client.connect_signal("property::maximized", border_adjust)
|
client.connect_signal("property::maximized", border_adjust)
|
||||||
|
client.connect_signal("focus", border_adjust)
|
||||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
Loading…
Reference in a new issue