mirror of
https://github.com/lcpz/awesome-copycats.git
synced 2025-01-11 02:08:08 +00:00
Moved signals out of rc.lua.theme files. Skipped copland because it is theme-specific
This commit is contained in:
parent
62ae726bfd
commit
674ddfc076
56
myrc/signals.lua
Normal file
56
myrc/signals.lua
Normal file
|
@ -0,0 +1,56 @@
|
|||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
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.client.focus.filter(c) then
|
||||
client.focus = c
|
||||
end
|
||||
end)
|
||||
|
||||
if not startup and 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)
|
||||
|
||||
-- No border for maximized clients
|
||||
client.connect_signal("focus",
|
||||
function(c)
|
||||
if c.maximized_horizontal == true and c.maximized_vertical == true then
|
||||
c.border_width = 0
|
||||
c.border_color = beautiful.border_normal
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
c.border_color = beautiful.border_focus
|
||||
end
|
||||
end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Arrange signal handler
|
||||
for s = 1, screen.count() do screen[s]:connect_signal("arrange", function ()
|
||||
local clients = awful.client.visible(s)
|
||||
local layout = awful.layout.getname(awful.layout.get(s))
|
||||
|
||||
if #clients > 0 then -- Fine grained borders and floaters control
|
||||
for _, c in pairs(clients) do -- Floaters always have borders
|
||||
if awful.client.floating.get(c) or layout == "floating" then
|
||||
c.border_width = beautiful.border_width
|
||||
|
||||
-- No borders with only one visible client
|
||||
elseif #clients == 1 or layout == "max" then
|
||||
clients[1].border_width = 0
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- }}}
|
|
@ -530,56 +530,5 @@ root.keys(globalkeys)
|
|||
-- Rules
|
||||
require("settings.rules")
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
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.client.focus.filter(c) then
|
||||
client.focus = c
|
||||
end
|
||||
end)
|
||||
|
||||
if not startup and 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)
|
||||
|
||||
-- No border for maximized clients
|
||||
client.connect_signal("focus",
|
||||
function(c)
|
||||
if c.maximized_horizontal == true and c.maximized_vertical == true then
|
||||
c.border_width = 0
|
||||
c.border_color = beautiful.border_normal
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
c.border_color = beautiful.border_focus
|
||||
end
|
||||
end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Arrange signal handler
|
||||
for s = 1, screen.count() do screen[s]:connect_signal("arrange", function ()
|
||||
local clients = awful.client.visible(s)
|
||||
local layout = awful.layout.getname(awful.layout.get(s))
|
||||
|
||||
if #clients > 0 then -- Fine grained borders and floaters control
|
||||
for _, c in pairs(clients) do -- Floaters always have borders
|
||||
if awful.client.floating.get(c) or layout == "floating" then
|
||||
c.border_width = beautiful.border_width
|
||||
|
||||
-- No borders with only one visible client
|
||||
elseif #clients == 1 or layout == "max" then
|
||||
clients[1].border_width = 0
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- }}}
|
||||
-- Signals
|
||||
require("myrc.signals")
|
||||
|
|
|
@ -530,85 +530,5 @@ root.keys(globalkeys)
|
|||
-- Rules
|
||||
require("settings.rules")
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
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.client.focus.filter(c) then
|
||||
client.focus = c
|
||||
end
|
||||
end)
|
||||
|
||||
if not startup and 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
|
||||
|
||||
local titlebars_enabled = true
|
||||
if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then
|
||||
-- buttons for the titlebar
|
||||
local buttons = awful.util.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
client.focus = c
|
||||
c:raise()
|
||||
awful.mouse.client.move(c)
|
||||
end),
|
||||
awful.button({ }, 3, function()
|
||||
client.focus = c
|
||||
c:raise()
|
||||
awful.mouse.client.resize(c)
|
||||
end)
|
||||
)
|
||||
|
||||
-- Title in the middle
|
||||
local middle_layout = wibox.layout.flex.horizontal()
|
||||
local title = awful.titlebar.widget.titlewidget(c)
|
||||
title:set_align("center")
|
||||
middle_layout:add(title)
|
||||
middle_layout:buttons(buttons)
|
||||
|
||||
local layout = wibox.layout.align.horizontal()
|
||||
layout:set_middle(middle_layout)
|
||||
|
||||
awful.titlebar(c,{size=18}):set_widget(layout)
|
||||
end
|
||||
end)
|
||||
|
||||
-- No border for maximized clients
|
||||
client.connect_signal("focus",
|
||||
function(c)
|
||||
if c.maximized_horizontal == true and c.maximized_vertical == true then
|
||||
c.border_width = 0
|
||||
c.border_color = beautiful.border_normal
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
c.border_color = beautiful.border_focus
|
||||
end
|
||||
end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Arrange signal handler
|
||||
for s = 1, screen.count() do screen[s]:connect_signal("arrange", function ()
|
||||
local clients = awful.client.visible(s)
|
||||
local layout = awful.layout.getname(awful.layout.get(s))
|
||||
|
||||
if #clients > 0 then -- Fine grained borders and floaters control
|
||||
for _, c in pairs(clients) do -- Floaters always have borders
|
||||
if awful.client.floating.get(c) or layout == "floating" then
|
||||
c.border_width = beautiful.border_width
|
||||
|
||||
-- No borders with only one visible client
|
||||
elseif #clients == 1 or layout == "max" then
|
||||
clients[1].border_width = 0
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- }}}
|
||||
-- Signals
|
||||
require("myrc.signals")
|
||||
|
|
55
rc.lua.holo
55
rc.lua.holo
|
@ -665,56 +665,5 @@ root.keys(globalkeys)
|
|||
-- Rules
|
||||
require("settings.rules")
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
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.client.focus.filter(c) then
|
||||
client.focus = c
|
||||
end
|
||||
end)
|
||||
|
||||
if not startup and 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)
|
||||
|
||||
-- No border for maximized clients
|
||||
client.connect_signal("focus",
|
||||
function(c)
|
||||
if c.maximized_horizontal == true and c.maximized_vertical == true then
|
||||
c.border_width = 0
|
||||
c.border_color = beautiful.border_normal
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
c.border_color = beautiful.border_focus
|
||||
end
|
||||
end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Arrange signal handler
|
||||
for s = 1, screen.count() do screen[s]:connect_signal("arrange", function ()
|
||||
local clients = awful.client.visible(s)
|
||||
local layout = awful.layout.getname(awful.layout.get(s))
|
||||
|
||||
if #clients > 0 then -- Fine grained borders and floaters control
|
||||
for _, c in pairs(clients) do -- Floaters always have borders
|
||||
if awful.client.floating.get(c) or layout == "floating" then
|
||||
c.border_width = beautiful.border_width
|
||||
|
||||
-- No borders with only one visible client
|
||||
elseif #clients == 1 or layout == "max" then
|
||||
clients[1].border_width = 0
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- }}}
|
||||
-- Signals
|
||||
require("myrc.signals")
|
||||
|
|
|
@ -594,60 +594,5 @@ root.keys(globalkeys)
|
|||
-- Rules
|
||||
require("settings.rules")
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
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.client.focus.filter(c) then
|
||||
client.focus = c
|
||||
end
|
||||
end)
|
||||
|
||||
if not startup and 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)
|
||||
|
||||
-- No border for maximized clients
|
||||
client.connect_signal("focus",
|
||||
function(c)
|
||||
if c.maximized_horizontal == true and c.maximized_vertical == true then
|
||||
c.border_width = 0
|
||||
c.border_color = beautiful.border_normal
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
c.border_color = beautiful.border_focus
|
||||
end
|
||||
end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Arrange signal handler
|
||||
for s = 1, screen.count() do screen[s]:connect_signal("arrange", function ()
|
||||
local clients = awful.client.visible(s)
|
||||
local layout = awful.layout.getname(awful.layout.get(s))
|
||||
|
||||
if #clients > 0 then -- Fine grained borders and floaters control
|
||||
for _, c in pairs(clients) do -- Floaters always have borders
|
||||
-- No borders with only one humanly visible client
|
||||
if layout == "max" then
|
||||
c.border_width = 0
|
||||
elseif awful.client.floating.get(c) or layout == "floating" then
|
||||
c.border_width = beautiful.border_width
|
||||
elseif #clients == 1 then
|
||||
clients[1].border_width = 0
|
||||
if layout ~= "max" then
|
||||
awful.client.moveresize(0, 0, 2, 0, clients[1])
|
||||
end
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- }}}
|
||||
-- Signals
|
||||
require("myrc.signals")
|
||||
|
|
|
@ -583,56 +583,5 @@ root.keys(globalkeys)
|
|||
-- Rules
|
||||
require("settings.rules")
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
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.client.focus.filter(c) then
|
||||
client.focus = c
|
||||
end
|
||||
end)
|
||||
|
||||
if not startup and 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)
|
||||
|
||||
-- No border for maximized clients
|
||||
client.connect_signal("focus",
|
||||
function(c)
|
||||
if c.maximized_horizontal == true and c.maximized_vertical == true then
|
||||
c.border_width = 0
|
||||
c.border_color = beautiful.border_normal
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
c.border_color = beautiful.border_focus
|
||||
end
|
||||
end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Arrange signal handler
|
||||
for s = 1, screen.count() do screen[s]:connect_signal("arrange", function ()
|
||||
local clients = awful.client.visible(s)
|
||||
local layout = awful.layout.getname(awful.layout.get(s))
|
||||
|
||||
if #clients > 0 then -- Fine grained borders and floaters control
|
||||
for _, c in pairs(clients) do -- Floaters always have borders
|
||||
if awful.client.floating.get(c) or layout == "floating" then
|
||||
c.border_width = beautiful.border_width
|
||||
|
||||
-- No borders with only one visible client
|
||||
elseif #clients == 1 or layout == "max" then
|
||||
clients[1].border_width = 0
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- }}}
|
||||
-- Signals
|
||||
require("myrc.signals")
|
||||
|
|
|
@ -528,56 +528,5 @@ root.keys(globalkeys)
|
|||
-- Rules
|
||||
require("settings.rules")
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
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.client.focus.filter(c) then
|
||||
client.focus = c
|
||||
end
|
||||
end)
|
||||
|
||||
if not startup and 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)
|
||||
|
||||
-- No border for maximized clients
|
||||
client.connect_signal("focus",
|
||||
function(c)
|
||||
if c.maximized_horizontal == true and c.maximized_vertical == true then
|
||||
c.border_width = 0
|
||||
c.border_color = beautiful.border_normal
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
c.border_color = beautiful.border_focus
|
||||
end
|
||||
end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Arrange signal handler
|
||||
for s = 1, screen.count() do screen[s]:connect_signal("arrange", function ()
|
||||
local clients = awful.client.visible(s)
|
||||
local layout = awful.layout.getname(awful.layout.get(s))
|
||||
|
||||
if #clients > 0 then -- Fine grained borders and floaters control
|
||||
for _, c in pairs(clients) do -- Floaters always have borders
|
||||
if awful.client.floating.get(c) or layout == "floating" then
|
||||
c.border_width = beautiful.border_width
|
||||
|
||||
-- No borders with only one visible client
|
||||
elseif #clients == 1 or layout == "max" then
|
||||
clients[1].border_width = 0
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- }}}
|
||||
-- Signals
|
||||
require("myrc.signals")
|
||||
|
|
|
@ -537,56 +537,5 @@ root.keys(globalkeys)
|
|||
-- Rules
|
||||
require("settings.rules")
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
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.client.focus.filter(c) then
|
||||
client.focus = c
|
||||
end
|
||||
end)
|
||||
|
||||
if not startup and 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)
|
||||
|
||||
-- No border for maximized clients
|
||||
client.connect_signal("focus",
|
||||
function(c)
|
||||
if c.maximized_horizontal == true and c.maximized_vertical == true then
|
||||
c.border_width = 0
|
||||
c.border_color = beautiful.border_normal
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
c.border_color = beautiful.border_focus
|
||||
end
|
||||
end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Arrange signal handler
|
||||
for s = 1, screen.count() do screen[s]:connect_signal("arrange", function ()
|
||||
local clients = awful.client.visible(s)
|
||||
local layout = awful.layout.getname(awful.layout.get(s))
|
||||
|
||||
if #clients > 0 then -- Fine grained borders and floaters control
|
||||
for _, c in pairs(clients) do -- Floaters always have borders
|
||||
if awful.client.floating.get(c) or layout == "floating" then
|
||||
c.border_width = beautiful.border_width
|
||||
|
||||
-- No borders with only one visible client
|
||||
elseif #clients == 1 or layout == "max" then
|
||||
clients[1].border_width = 0
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- }}}
|
||||
-- Signals
|
||||
require("myrc.signals")
|
||||
|
|
Loading…
Reference in a new issue