diff --git a/wm/default.nix b/wm/default.nix index d6d79d0..288f493 100644 --- a/wm/default.nix +++ b/wm/default.nix @@ -64,6 +64,8 @@ }; }; + wallpaper = "${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/backgrounds/nixos/nix-wallpaper-simple-dark-gray.png"; + printScreen = { enable = true; keybind = "Print"; diff --git a/wm/i3.nix b/wm/i3.nix index caeb697..1b9312b 100644 --- a/wm/i3.nix +++ b/wm/i3.nix @@ -13,7 +13,14 @@ let always = true; }] else [ ]; - startup = startupNotifications ++ cfg.startup; + wallpaperSet = + if cfg.wallpaper != null then [{ + command = "${pkgs.feh}/bin/feh --bg-scale ${cfg.wallpaper}"; + always = true; + notification = false; + }] else [ ]; + + startup = startupNotifications ++ wallpaperSet ++ cfg.startup; in { config = mkIf (cfg.enable && cfg.kind == "i3") { @@ -86,16 +93,17 @@ in windowManager.i3 = { enable = true; config = { - keybindings = common.keybindings; - workspaceOutputAssign = common.workspaceOutputAssign; - assigns = common.assigns; - fonts = common.mkFont cfg.font; - modifier = cfg.modifier; - bars = [{ - fonts = common.mkFont cfg.bar.font; - statusCommand = "${config.programs.i3status-rust.package}/bin/i3status-rs ${config.home.homeDirectory}/.config/i3status-rust/config-bottom.toml"; - }]; - }; + inherit startup; + keybindings = common.keybindings; + workspaceOutputAssign = common.workspaceOutputAssign; + assigns = common.assigns; + fonts = common.mkFont cfg.font; + modifier = cfg.modifier; + bars = [{ + fonts = common.mkFont cfg.bar.font; + statusCommand = "${config.programs.i3status-rust.package}/bin/i3status-rs ${config.home.homeDirectory}/.config/i3status-rust/config-bottom.toml"; + }]; + }; }; scriptPath = ".hm-xsession"; }; diff --git a/wm/i3like.nix b/wm/i3like.nix index 678ee19..a7d5a9f 100644 --- a/wm/i3like.nix +++ b/wm/i3like.nix @@ -135,6 +135,11 @@ with lib; }); }; + wallpaper = mkOption { + type = types.nullOr types.path; + description = "wallpaper"; + }; + workspaces = { definitions = mkOption { type = types.attrsOf (types.submodule { diff --git a/wm/sway.nix b/wm/sway.nix index 1e8ab5b..9223928 100644 --- a/wm/sway.nix +++ b/wm/sway.nix @@ -19,7 +19,7 @@ in home.packages = with pkgs; [ sway - ]; + ] ++ (if cfg.wallpaper != null then [ pkgs.swaybg ] else [ ]); home.sessionVariables = { MOZ_ENABLE_WAYLAND = "1"; @@ -104,8 +104,13 @@ in wm.menu.command = mkDefault "${pkgs.wofi}/bin/wofi --show drun,run --allow-images"; wm.exit.command = mkDefault "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; + + wayland.windowManager.sway = { enable = true; + extraConfig = mkIf (cfg.wallpaper != null) '' + output "*" bg ${cfg.wallpaper} fill + ''; config = { inherit startup; modifier = cfg.modifier; @@ -138,8 +143,8 @@ in titlebar = true; }; keybindings = common.keybindings; - workspaceOutputAssign = common.workspaceOutputAssign; - assigns = common.assigns; + workspaceOutputAssign = common.workspaceOutputAssign; + assigns = common.assigns; }; };