2022-08-31 12:20:58 +00:00
-- This file is part of Reno desktop.
--
-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
--
-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see <https://www.gnu.org/licenses/>.
2022-07-12 21:26:11 +00:00
-- Base upon which modules are layered.
--libraries
local awful = require ( " awful " )
local beautiful = require ( " beautiful " )
local gears = require ( " gears " )
2022-07-23 19:10:02 +00:00
awful.util . shell = global.shell
2022-07-12 21:26:11 +00:00
--error handling
if awesome.startup_errors then
print ( " Error during startup: " .. awesome.startup_errors )
end
do
local in_error = false
awesome.connect_signal ( " debug::error " , function ( err )
if in_error then return end
in_error = true
print ( " Error during runtime: " .. tostring ( err ) )
in_error = false
end )
end
--screen setup
awful.screen . connect_for_each_screen ( function ( s )
2022-07-23 19:10:02 +00:00
gears.wallpaper . maximized ( root_path .. " /background.jpg " )
2022-07-12 21:26:11 +00:00
awful.tag ( { " 1 " } , s , awful.layout . suit.floating )
end )
2022-07-23 19:10:02 +00:00
--theme initialization
beautiful.init ( root_path .. " /themes/ " .. global.theme .. " /theme.lua " )
2022-07-12 21:26:11 +00:00
--client mouse bindings
clientbuttons = gears.table . join (
awful.button ( { } , 1 , function ( c )
c : emit_signal ( " request::activate " , " mouse_click " , { raise = true } )
end )
)
--client rules
awful.rules . rules = {
{ --catch-all rules
rule = { } ,
properties = {
focus = awful.client . focus.filter ,
raise = true ,
screen = awful.screen . preferred ,
2022-07-23 19:10:02 +00:00
border_width = beautiful.border_width ,
border_color = beautiful.border_normal ,
2022-07-12 21:26:11 +00:00
placement = awful.placement . no_overlap + awful.placement . no_offscreen
}
}
}
--client signals
client.connect_signal ( " manage " , function ( c )
-- append the window at the end rather than at the top.
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup
--place client on available screens when screen count changes
and not c.size_hints . user_position
and not c.size_hints . program_position then
awful.placement . no_offscreen ( c )
end
end )
2023-05-06 08:56:25 +00:00
--available layouts
awful.layout . layouts = {
awful.layout . suit.floating
}
2022-07-23 19:10:02 +00: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 )
2022-07-12 21:26:11 +00:00
--screen setup
awful.screen . connect_for_each_screen ( function ( s )
awful.tag ( { " 1 " , " 2 " , " 3 " , " 4 " } , s , awful.layout . suit.floating )
end )