Switched to kanshi instead of wlr-randr

This commit is contained in:
Alexey 2025-01-22 09:36:54 +03:00
commit b8057d0283
3 changed files with 23 additions and 37 deletions

View file

@ -42,6 +42,9 @@ local startup_commands = {
{
'waybar'
},
{
'kanshi'
},
-- Wallpaper
{
string.format("swaybg -o %s -i %s -o %s -i %s",
@ -50,23 +53,6 @@ local startup_commands = {
}
}
local outputs = {
[monitors.main] = {
mode = '1920x1080',
pos = '0,0',
transform = 'normal',
scale = '1.000000',
preferred = true,
},
[monitors.external] = {
mode = '1920x1080',
pos = '-1920,0',
transform = 'normal',
scale = '1.000000',
preferred = true,
},
}
local inputs = {
[pointers.touchpad] = {
['drag'] = 'enabled',
@ -311,25 +297,6 @@ for _, cmd in ipairs(startup_commands) do
os.execute(string.format([[riverctl spawn '%s']], concat(cmd, ' ')))
end
-- Configure outputs
local randr_cmd = 'wlr-randr'
for output, options in pairs(outputs) do
randr_cmd = randr_cmd .. ' --output ' .. output
for opt, value in pairs(options) do
if opt ~= 'preferred' then
randr_cmd = string.format(randr_cmd .. ' --%s %s', opt, value)
end
end
-- Ensure '--preferred' is the last argument for each monitor
if options.preferred then
randr_cmd = randr_cmd .. ' --preferred'
end
end
os.execute(randr_cmd)
os.execute(string.format("echo %s > ~/.config/river/wlr-randr", randr_cmd))
-- Configure input devices
for device, options in pairs(inputs) do
for key, val in pairs(options) do