rotate all relevant screens when requested, and parse the output of xrandr and xinput better

This commit is contained in:
Izaya 2022-09-11 22:13:17 +10:00
parent 257753ec99
commit 0103c4a93c
2 changed files with 10 additions and 7 deletions

View File

@ -25,12 +25,16 @@ local powermenu = {
fullscreen = function(self)
self.screen.navbar.visible = not self.screen.navbar.visible
end,
rotateLeft = function()
awful.spawn(gears.filesystem.get_configuration_dir() .. "/awesome-powermenu/rotate.lua left")
rotateLeft = function(self)
for k,v in pairs(self.screen.outputs) do
awful.spawn(gears.filesystem.get_configuration_dir() .. "/awesome-powermenu/rotate.lua left " .. tostring(k))
end
awesome.restart()
end,
rotateRight = function()
awful.spawn(gears.filesystem.get_configuration_dir() .. "/awesome-powermenu/rotate.lua right")
rotateRight = function(self)
for k,v in pairs(self.screen.outputs) do
awful.spawn(gears.filesystem.get_configuration_dir() .. "/awesome-powermenu/rotate.lua right " .. tostring(k))
end
awesome.restart()
end,
brightnessUp = function()
@ -86,7 +90,6 @@ function powermenu.new(s)
}
local powermenuPopup = awful.popup{
layout = wibox.layout.fixed.vertical,
-- widget = wibox.container.constraint(powermenuWidget, "min", 512, 512),
widget = powermenuWidget,
border_color = beautiful.border_focus,
border_width = 2,

View File

@ -56,13 +56,13 @@ c=f:read("*a")
f:close()
local line = (c:match("\n("..disp:gsub("%p","%%%1") .. ".-)\n"))
print(line)
local orientation = line:match("%S+ %S+ %S+ %S+ (%S+) ")
local orientation = line:match(".-(left) %(") or line:match(".-(right) %(") or line:match(".-(normal) %(") or line:match(".-(inverted) %(")
local f = io.popen("xinput --list","r")
local xin=f:read("*a"):lower()
f:close()
--⎜ ↳ Elan Touchscreen id=6 [slave pointer (2)]
local touchscreen = (xin:match("touch.*screen%s-id=(%d+)"))
local touchscreen = (xin:match("touch.*screen%s-id=(%d+)[^\n]-pointer"))
print(orientation)
print(nextLeft(orientation))