Skip to content

Zhaith-Izaliel/iio-niri

Repository files navigation

Contributors Forks Stargazers Issues MIT License


IIO-Niri

Listen to iio-sensor-proxy and updates Niri output orientation depending on the accelerometer orientation.
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Listen to IIO-Sensor-Proxy and updates Niri output orientation depending on the accelerometer orientation.

(back to top)

Built With

  • Rust
  • Nix

(back to top)

Getting Started

Prerequisites

IIO-Niri requires the Rust Compiler if you plan to compile it, you will also need Cargo to build the project and DBus dependencies.

  • rustc ⩾ 1.86.0
  • cargo ⩾ 1.86.0
  • pkg-config ⩾ 0.29.2
  • libdbus ⩾ 1.6

At runtime, the program relies on IIO-Sensor-Proxy to fetch updates on the accelerometer. Make sure it is running alongside IIO-Niri.

If you intend to work with Nix:

Installation

From source

  1. Clone the repo
    git clone https://github.com/Zhaith-Izaliel/iio-niri.git
  2. Install Cargo and Rustc from your package manager.
  3. Build IIO-Niri with Cargo in release mode
    cargo build --release
  4. An executable for IIO-Niri will be available in target/release/iio-niri

Nix

IIO-Niri is officially available in Nixpkgs under pkgs.iio-niri and has a corresponding module at services.iio-niri. This flake exists purely for bleeding edge updates and for historical reason.

The maintainer of the project is also the maintainer of the package and module upstream (a.k.a. yours truly).

If you prefer, you can install it with the provided flake like so:

  1. Import the project in your flake inputs
    inputs = {
     nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
     iio-niri = {
       url = "github:Zhaith-Izaliel/iio-niri";
       inputs.nixpkgs.follows = "nixpkgs";
     };
    };
  2. You can then install it from inputs.iio-niri.packages.${system}.default where ${system} is your system descriptor. For Linux, usually x86_64-linux.

Arch Linux (AUR)

There are two primary ways to install IIO-Niri via the Arch User Repository (AUR):

Via Preferred AUR Helper (Yay or Paru)
  1. Simply enter one of the two commands below, depending on your installed pacman wrapper:
  $ yay -S iio-niri
  
  $ paru -S iio-niri
Via makepkg (default)
  1. Alternatively, simply clone the AUR repository and install using makepkg:
  git clone https://aur.archlinux.org/iio-niri.git
  cd iio-niri
  makepkg -si

Please Note: The AUR package for this project is maintained by the community, and not by the developer. While it is sourced directly from the master branch of the developer's GitHub repository, users should always exercise discretion and caution when installing packages via the AUR.

(back to top)

Usage

Use iio-niri -h to see a short summary of available options and iio-niri --help to see a detailed explanation of every available options.

At runtime, the program relies on IIO-Sensor-Proxy to fetch updates on the accelerometer. Make sure it is running alongside IIO-Niri.

Then start IIO-Niri with Niri:

spawn-at-startup "iio-niri" "--monitor" "eDP-1"

NixOS

The provided flake offers a NixOS module to install IIO-Niri as well as an overlay.

Here is a simple example on how to install both the overlay and the module in your NixOS configuration:

outputs = { self, nixpkgs, iio-niri }: {
  # replace 'joes-desktop' with your hostname here.
  nixosConfigurations.joes-desktop = nixpkgs.lib.nixosSystem {
    system = "x86_64-linux";
    modules = [
      iio-niri.nixosModules.default
      # ---Snip---
      # Add your own modules here
      # ---Snip---

      # Example to add the overlay to Nixpkgs:
      {
        nixpkgs = {
          overlays = [
            iio-niri.overlays.default
          ];
        };
      }
    ];
  };
};

Then enable the module.

{...}: {
  services.iio-niri = {
    enable = true;

    extraArgs = [
      "--monitor"
      "eDP-1"
    ];
  };
}

See the module documentation for more info.

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

How to make a pull request

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/amazing-feature)
  3. Commit your Changes (git commit -m 'feat: add some amazing-feature')
  1. Push to the Branch (git push origin feature/amazing-feature)
  2. Open a Pull Request on develop

(back to top)

Top contributors:

contrib.rocks image

License

Distributed under the MIT License. See LICENSE.md for more information.

(back to top)

Contact

Zhaith Izaliel - @zhaith-izaliel.bsky.social

Project Link: https://github.com/Zhaith-Izaliel/iio-niri

(back to top)

Acknowledgments

(back to top)

About

Listen to iio-sensor-proxy and updates Niri output orientation depending on the accelerometer orientation.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors