Yessiest
1 year ago
6 changed files with 99 additions and 7 deletions
-
19desktop.conf
-
50modules/compositor.lua
-
19modules/powermanX.lua
-
11modules/rules_stub.lua
-
4modules/static_tags.lua
-
3rc.lua
@ -0,0 +1,50 @@ |
|||||
|
-- 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/>. |
||||
|
-- Compositor manager with inhibitor |
||||
|
local awful = require("awful") |
||||
|
-- Configuration variables |
||||
|
local cfg = config.compositor or {} |
||||
|
local compositor_enabled = false |
||||
|
local inhibitors = {} |
||||
|
local compositor_pid = nil |
||||
|
local function count(t) |
||||
|
local c = 0 |
||||
|
for _,_ in pairs(t) do |
||||
|
c = c + 1 |
||||
|
end |
||||
|
return c |
||||
|
end |
||||
|
if cfg.exec then |
||||
|
compositor_pid = awful.spawn(cfg.exec) |
||||
|
compositor_enabled = true |
||||
|
client.connect_signal("manage",function(c) |
||||
|
if c.inhibit_compositor then |
||||
|
inhibitors[c] = true |
||||
|
if compositor_enabled then |
||||
|
awful.spawn("kill "..tostring(compositor_pid)) |
||||
|
compositor_enabled = false |
||||
|
end |
||||
|
end |
||||
|
end) |
||||
|
client.connect_signal("unmanage",function(c) |
||||
|
if c.inhibit_compositor then |
||||
|
inhibitors[c] = nil |
||||
|
if count(inhibitors) == 0 then |
||||
|
if compositor_enabled == false then |
||||
|
compositor_pid = awful.spawn(cfg.exec) |
||||
|
compositor_enabled = true |
||||
|
end |
||||
|
end |
||||
|
end |
||||
|
end) |
||||
|
awesome.connect_signal("exit",function() |
||||
|
if compositor_enabled and compositor_pid then |
||||
|
awful.spawn("kill "..tostring(compositor_pid)) |
||||
|
end |
||||
|
end) |
||||
|
end |
@ -0,0 +1,11 @@ |
|||||
|
local awful = require("awful") |
||||
|
local gears = require("gears") |
||||
|
awful.rules.rules = gears.table.join(awful.rules.rules, { |
||||
|
{ rule_any = { class = { |
||||
|
"steam_app_548430", |
||||
|
"steam_app_%d*", |
||||
|
"love" |
||||
|
}}, |
||||
|
properties = {inhibit_compositor = true}, |
||||
|
}, |
||||
|
}) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue