make hyprland work without a startupSound path

This commit is contained in:
jacekpoz 2024-03-20 07:48:21 +01:00
parent 20e59ce3ac
commit 5578e7560a
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -22,8 +22,9 @@ in {
options.myOptions.programs.hypr.land = {
enable = mkEnableOption "enable hiper ląd";
startupSound = mkOption {
type = types.path;
type = with types; nullOr path;
description = "sound to play on hyprland startup";
default = null;
};
tearing = mkOption {
type = types.bool;
@ -78,7 +79,7 @@ in {
# adds an equivalent of hm's settings to this module
#imports = [ inputs.hyprland.homeManagerModules.default ];
xdg.dataFile."hypr/startup_sound".source = cfg.startupSound;
xdg.dataFile = mkIf (cfg.startupSound != null) { "hypr/startup_sound".source = cfg.startupSound; };
wayland.windowManager.hyprland = {
enable = true;
@ -94,7 +95,7 @@ in {
extraConfig = ''
bind=$mainMod, W, exec, ${removeSuffix " %U" hmCfg.xdg.desktopEntries.firefox-schizo.exec}
bind=$mainMod SHIFT, W, exec, ${removeSuffix " %U" hmCfg.xdg.desktopEntries.firefox-unschizo.exec}
${if (cfg.startupSound != "") then "exec-once=${pkgs.mpv}/bin/mpv --no-video --volume=100 ${hmCfg.xdg.dataHome}/hypr/startup_sound" else ""}
${if (cfg.startupSound != null) then "exec-once=${pkgs.mpv}/bin/mpv --no-video --volume=100 ${hmCfg.xdg.dataHome}/hypr/startup_sound" else ""}
'';
settings = {
"$mainMod" = "SUPER";