Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features request #2

Open
IceDBorn opened this issue May 9, 2024 · 4 comments
Open

Features request #2

IceDBorn opened this issue May 9, 2024 · 4 comments

Comments

@IceDBorn
Copy link

IceDBorn commented May 9, 2024

I have a similar project in mind, in which you'll be able to control various scenarios which should inhibit the system.

https://github.com/IceDBorn/IceDOS/blob/main/system/desktop/hyprland/modules/disk-watcher.nix
https://github.com/IceDBorn/IceDOS/blob/main/system/desktop/hyprland/modules/cpu-watcher.nix
https://github.com/IceDBorn/IceDOS/blob/main/system/desktop/hyprland/modules/network-watcher.nix
https://github.com/IceDBorn/IceDOS/blob/main/system/desktop/hyprland/modules/pipewire-watcher.nix

My goal is to move all these scripts into a single application, which will run as a background service and inhibit the system based on your settings. You'll be able to set systemd to only inhibit suspend when your system has a download/upload speed higher than the threshold, for example. This is possible using systemd-inhibit.

With all that in mind, I'd love to contribute these features here, instead of making a new project from the ground up.

@IceDBorn IceDBorn changed the title Feature requests Features request May 9, 2024
@Jappie3
Copy link
Owner

Jappie3 commented May 9, 2024

Thank you for showing interest in this project! I'm gonna be honest - I think writing functionality like your Bash scripts in a language like Rust would massively overcomplicate things (not that I'm that experienced with Rust), Bash seems like a very good choice for getting random system information... My advice would be to call vigiland in your bash scripts rather than implementing your Bash scripts' functionalities in Rust.

Vigiland was a project I started to learn more about Rust & the Wayland protocol, it inhibits a compositor's idle behaviour through Wayland's idle-inhibit-unstable-v1 protocol. I don't know anyone using systemd-inhibit to achieve the same functionality on Wayland, and from a quick test it seems like running systemd-inhibit doesn't register an idle inhibitor (at least, not according to Hyprland's logs).

Last but not least: this project barely has 200 lines of code, a lot of it boilerplate. The only things it does are

  • creating a surface
  • creating an inhibitor for that surface
  • waiting for exit

Recreating this functionality in Rust (or any other language with decent Wayland bindings) would be trivial.

@IceDBorn
Copy link
Author

I thought that the bindings would make this easier than the nightmare I had to go through with bash...

@Jappie3
Copy link
Owner

Jappie3 commented May 10, 2024

With bindings I refer to being able to use libwayland in e.g. Rust, even though the library is written in C++ or something.

Doing idle inhibit (communicating via the Wayland protocol like Vigiland does) in Bash is indeed a nightmare, however I was talking about the functionality of deciding when to idle inhibit (e.g. when there's network or disk activity -> that's easily doable with Bash)

@IceDBorn
Copy link
Author

That's what I meant too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants