Add HyDE-like workflows to Hyprland using Nix and Home Manager.
- Manage multiple Hyprland configuration profiles ("workflows")
- Easily switch between profiles
- Integrates with Home Manager and Nix Flakes
Clone the repo and make the script executable:
chmod +x packages/hyprland-profile-switcher/hyprland-profile-switcher.shMove the file to somewhere in your path (e. g. ~/.local/bin):
mv packages/hyprland-profile-switcher/hyprland-profile-switcher.sh ~/.local/bin/hyprland-profile-switcherCreate a directory named profiles in ~/.config/hypr:
mkdir -p ~/.config/hypr/profilesIn this directory, you can create as many profiles you want with the extension ".conf". Make sure to add one profile named "default.conf". This should be the profile you use normally.
In each profile, you can put whatever Hyprland settings you may want, but you must define the $WORKFLOW_NAME variable, and set it to the name of the profile, which should match the filename.
For example, you might have in profiles/default.conf:
$PROFILE_NAME=default
animations {
enabled=true
}
And in profiles/gaming.conf:
$PROFILE_NAME=gaming
animations {
enabled=false
}
Finally, add the follwing line to your Hyprland config:
source=./profile.conf
Note:
Any option you set after the source line will overwrite the same option set in the current profile.
Now, you can run hyprland-profile-switcher to manage profiles. See the usage section.
To use this with Nix, you must be using flakes, and the Hyprland home manager module. This project extends the wayland.windowManager.hyprland option with a hyprland-profile-switcher option.
Add the flake to your inputs:
inputs.hyprland-profile-switcher.url = "github:heraldofsolace/hyprland-profile-switcher";Import the module in your Home Manager configuration:
imports = [
# ...
inputs.hyprland-profile-switcher.homeModules.default
];wayland.windowManager.hyprland.hyprland-profiles-switcher = {
enable = true;
profiles = [
{
name = "default";
settings = {
animations = {
enable = true;
};
};
}
{
name = "gaming";
settings = {
animations = {
enable = false;
};
};
}
];
};Note:
- There must be one profile named
default. - All profile names must be unique.
- Any option set in
wayland.windowManager.hyprland.settingswill overwrite the same option set in the current profile. For example, if you have animations enabled inwayland.windowManager.hyprland.settings, and animations disabled ingaming.conf, the value in thewayland.windowManager.hyprland.settingswill take priority. So it's recommended to define the options that you change in their respective profiles, and the unchanged options inwayland.windowManager.hyprland.settings.
The first time you load Hyprland after installing hyprland-profile-switcher, you might get an error. This is expected, since the profile symlink does not exist yet (see the How It Works section). Simply use the script to choose a profile, reload Hyprland and the error should go away.
Use the hyprland-profile-switcher shell application to switch profiles:
hyprland-profile-switcher --select <command>: Select a profile using a menu command (e.g.,wofi,rofi, orwalker)hyprland-profile-switcher --set <profile>: Set a specific profilehyprland-profile-switcher --get-current: Show the current profilehyprland-profile-switcher --reset: Reset to the default profile
You can add a binding to perform the switching with a keypress.
- Each profile is written to
$XDG_CONFIG_HOME/hypr/profile/<name>.conf. - The current profile is symlinked as
$XDG_CONFIG_HOME/hypr/profile.conf. - This file is sourced by Hyprland.
- Hyprland should automatically reload itself when the profile changes. If it doesn't please reload it manually.