diff --git a/homeManagerModules/desktop/sway/autoRotate.nix b/homeManagerModules/desktop/sway/autoRotate.nix new file mode 100644 index 00000000..7eefe41a --- /dev/null +++ b/homeManagerModules/desktop/sway/autoRotate.nix @@ -0,0 +1,13 @@ +{ + pkgs, + lib, + config, + ... +}: { + config = lib.mkIf config.alyraffauf.desktop.sway.autoRotate { + home.packages = with pkgs; [rot8]; + wayland.windowManager.sway.config.startup = [ + {command = "${lib.getExe pkgs.rot8}";} + ]; + }; +} diff --git a/homeManagerModules/desktop/sway/default.nix b/homeManagerModules/desktop/sway/default.nix index b90fa58a..4af6478b 100644 --- a/homeManagerModules/desktop/sway/default.nix +++ b/homeManagerModules/desktop/sway/default.nix @@ -5,7 +5,7 @@ osConfig, ... }: { - imports = [./randomWallpaper.nix]; + imports = [./autoRotate.nix ./randomWallpaper.nix]; options = { alyraffauf.desktop.sway.enable = lib.mkEnableOption "Sway with extra apps."; alyraffauf.desktop.sway.autoSuspend = lib.mkOption { @@ -13,6 +13,16 @@ default = true; type = lib.types.bool; }; + alyraffauf.desktop.sway.autoRotate = lib.mkOption { + description = "Whether to autorotate screen."; + default = false; + type = lib.types.bool; + }; + alyraffauf.desktop.sway.randomWallpaper = lib.mkOption { + description = "Whether to enable random wallpaper script."; + default = true; + type = lib.types.bool; + }; }; config = lib.mkIf config.alyraffauf.desktop.sway.enable { diff --git a/homeManagerModules/desktop/sway/randomWallpaper.nix b/homeManagerModules/desktop/sway/randomWallpaper.nix index 3fe253fd..bb024a70 100644 --- a/homeManagerModules/desktop/sway/randomWallpaper.nix +++ b/homeManagerModules/desktop/sway/randomWallpaper.nix @@ -34,11 +34,6 @@ fi ''; in { - options = { - alyraffauf.desktop.sway.randomWallpaper = - lib.mkEnableOption "Enable Sway random wallpaper script."; - }; - config = lib.mkIf config.alyraffauf.desktop.sway.randomWallpaper { # Packages that should be installed to the user profile. home.packages = with pkgs; [swaybg sway-randomWallpaper]; diff --git a/hosts/petalburg/home.nix b/hosts/petalburg/home.nix index ccf7ea28..e66e732c 100644 --- a/hosts/petalburg/home.nix +++ b/hosts/petalburg/home.nix @@ -7,5 +7,6 @@ }: { home-manager.users.aly = { imports = [../../homeManagerModules ../../aly.nix]; + alyraffauf.desktop.sway.autoRotate = true; }; }