A fork of JeanSchoeller/iio-hyprland that adds support for the new Lua syntax introduced in Hyprland 0.55.
Listens to iio-sensor-proxy and automatically changes Hyprland output orientation.
To install locally
nix profile install github:ThorTuwy/lua-iio-hyprlandIf you are using flakes to setup your system :
{
inputs.iio-hyprland.url = "github:ThorTuwy/lua-iio-hyprland";
outputs = {...}@inputs:{};
}And add it to where you defined your packages :
{inputs, pkgs, ...}:{
# ...
environment.systemPackages = with pkgs; [
inputs.iio-hyprland.packages.${pkgs.system}.default
]
# ...
}git clone https://github.com/ThorTuwy/lua-iio-hyprland
cd iio-hyprland
sudo make install
cd iio-hyprland
sudo make uninstall
iio-hyprland [master window location] [monitor to rotate, default=eDP-1], run hyprctl monitors to list available outputs. Use either --left-master or --right-master to set the master window location to the left/top or right/bottom, leave blank to not adjust window layout on rotate.
Add exec-once = iio-hyprland to ~/.config/hypr/hyprland.conf
Some users reported that specifying the monitor in hyprland.conf could be necessary. For example, on Surface Pro:
hl.monitor({
output = "eDP-1",
mode = "preferred",
position = "auto",
scale = 2,
transform = 0,
})In some devices, the display orientation may not match the accelerometer orientation (such as on the GPD Pocket series and others). It is possible to set the transform orientation using the --transform 0,1,2,3 or for GPD Pocket (as an example) --transform 3,0,1,2 These correspond to the Orientation ENUM (Normal, LeftUp, BotomUp, RightUp ) related to the hyprland transform property.
Note that iio-hyprland uses the hyprctl keyword device:touchdevice:transform, which sets the transform value for all touch devices that don't have explicit device-specific configurations. So if you already have a specific device config this won't work (e.g. to correctly rotate your display on start - needed for portrait displays that linux doesn't recognise, e.g. GPD Pocket, GPD Win, Chuwi Minibook etc).
Should automatically rotate all Tablets and Touch Devices from hyprctl devices.
Thank you to Desktop31 for fetching the hyprctl devices output.