sway: added autorotate support with rot8

This commit is contained in:
Aly Raffauf 2024-05-17 14:48:32 -04:00
parent 00ccd66008
commit 3d520d2eb5
4 changed files with 25 additions and 6 deletions

View file

@ -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}";}
];
};
}

View file

@ -5,7 +5,7 @@
osConfig, osConfig,
... ...
}: { }: {
imports = [./randomWallpaper.nix]; imports = [./autoRotate.nix ./randomWallpaper.nix];
options = { options = {
alyraffauf.desktop.sway.enable = lib.mkEnableOption "Sway with extra apps."; alyraffauf.desktop.sway.enable = lib.mkEnableOption "Sway with extra apps.";
alyraffauf.desktop.sway.autoSuspend = lib.mkOption { alyraffauf.desktop.sway.autoSuspend = lib.mkOption {
@ -13,6 +13,16 @@
default = true; default = true;
type = lib.types.bool; 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 { config = lib.mkIf config.alyraffauf.desktop.sway.enable {

View file

@ -34,11 +34,6 @@
fi fi
''; '';
in { in {
options = {
alyraffauf.desktop.sway.randomWallpaper =
lib.mkEnableOption "Enable Sway random wallpaper script.";
};
config = lib.mkIf config.alyraffauf.desktop.sway.randomWallpaper { config = lib.mkIf config.alyraffauf.desktop.sway.randomWallpaper {
# Packages that should be installed to the user profile. # Packages that should be installed to the user profile.
home.packages = with pkgs; [swaybg sway-randomWallpaper]; home.packages = with pkgs; [swaybg sway-randomWallpaper];

View file

@ -7,5 +7,6 @@
}: { }: {
home-manager.users.aly = { home-manager.users.aly = {
imports = [../../homeManagerModules ../../aly.nix]; imports = [../../homeManagerModules ../../aly.nix];
alyraffauf.desktop.sway.autoRotate = true;
}; };
} }