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

[Feature] Implement "source" keyword in Hypridle config file #90

Closed
BinaryInk opened this issue Sep 4, 2024 · 1 comment
Closed

[Feature] Implement "source" keyword in Hypridle config file #90

BinaryInk opened this issue Sep 4, 2024 · 1 comment

Comments

@BinaryInk
Copy link

Request

Allow for including other config files in other directories via include keyword. e.g., :

source = ~/.config/hypr/hypridle.conf.d/*.conf and source = ~/.config/hypr/hypridle.conf.d/$variable/*.conf

Rationale

  1. This is a common behavior for a plethora of Linux applications. Those that don't support it out of the box typically provide a mechanism (like hyprland itself) to include files (e.g., nginx).
  2. This is supported behavior in hyprland.conf. It would stand to reason that one could expect this behavior in hyprland's other optional daemons.

  1. Personally, I like being able to separate out different bits of configuration files into their own parts for easier maintenance when possible. I doubt I'm entirely alone on this.
  2. Again personally, I use Syncthing to keep my laptop and desktop hyprland configs in sync. Having the source keyword allows me to do the following:
# This file must contain a variable of $hostname. 
# This is used to load the machine-specific confs at the end of this script.
# This file should not be synced with Syncthing.
source = ~/.config/hypr/hyprland.conf.d/hostname.conf

...

# Load all loose conf files
source = ~/.config/hypr/hyprland.conf.d/*.conf
# Load machine-specific conf files
source = ~/.config/hypr/hyprland.conf.d/$hostname/*.conf

In effect, I load a variable of the hostname into the config file first, apply a baseline of settings I want in the main file and in any loose *.conf files in ~/.config/hypr/hyprland.conf.d, then overlay settings for the specific machine in ~/.config/hypr/hyprland.conf.d/$hostname.

This system, while seemingly convoluted, has actually made having one set of configs extremely easy to manage vs. manually maintaining two different sets of configs. When I make a change on my desktop, it's reflected on my laptop (or vice versa) and the config is applied upon sync if the change touches a *.conf file that the machine is using. It enables me to have NVIDIA-specific fixes for my laptop in addition to changing animation, blur, and shadow settings to save on battery, in addition to having different applications on start-up, have device-specific bindings, and anything else one could think to do.

Given that most people want their laptop and desktop to behave much differently when it comes to idle behavior for security (screen locking) and energy reasons, I believe this would be a good addition to hypridle for individuals who want to use Syncthing or otherwise maintain one set of configs for multiple devices.


I may look into submitting a PR myself if I get around to comparing the code from hyprland and hypridle, but in the meantime...if I'm wrong and this is already implemented and I may just doing something stupid on my end, please let me know. I haven't found any documentation on hypridle syntax that indicates this feature exists, however.

@BinaryInk
Copy link
Author

Ahh crap. I see there's already an issue out for this...I promise I did search before doing this and didn't see it come up. Naturally I saw it right after submitting.

Closing and bumping on #33 .

@BinaryInk BinaryInk closed this as not planned Won't fix, can't repro, duplicate, stale Sep 4, 2024
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

1 participant