mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-17 14:31:09 +01:00
sway-easyfocus: add module (#6976)
This commit is contained in:
parent
5f1f472565
commit
8a318641ac
6 changed files with 85 additions and 0 deletions
|
|
@ -265,6 +265,7 @@ let
|
||||||
./programs/starship.nix
|
./programs/starship.nix
|
||||||
./programs/streamlink.nix
|
./programs/streamlink.nix
|
||||||
./programs/superfile.nix
|
./programs/superfile.nix
|
||||||
|
./programs/sway-easyfocus.nix
|
||||||
./programs/swayimg.nix
|
./programs/swayimg.nix
|
||||||
./programs/swaylock.nix
|
./programs/swaylock.nix
|
||||||
./programs/swayr.nix
|
./programs/swayr.nix
|
||||||
|
|
|
||||||
51
modules/programs/sway-easyfocus.nix
Normal file
51
modules/programs/sway-easyfocus.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib)
|
||||||
|
mkIf
|
||||||
|
mkEnableOption
|
||||||
|
mkPackageOption
|
||||||
|
mkOption
|
||||||
|
;
|
||||||
|
|
||||||
|
cfg = config.programs.sway-easyfocus;
|
||||||
|
formatter = pkgs.formats.yaml { };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
|
||||||
|
|
||||||
|
options.programs.sway-easyfocus = {
|
||||||
|
enable = mkEnableOption "sway-easyfocus";
|
||||||
|
package = mkPackageOption pkgs "sway-easyfocus" { nullable = true; };
|
||||||
|
settings = mkOption {
|
||||||
|
type = formatter.type;
|
||||||
|
default = { };
|
||||||
|
example = {
|
||||||
|
chars = "fjghdkslaemuvitywoqpcbnxz";
|
||||||
|
window_background_color = "d1f21";
|
||||||
|
window_background_opacity = 0.2;
|
||||||
|
focused_background_color = "285577";
|
||||||
|
focused_background_opacity = 1.0;
|
||||||
|
focused_text_color = "ffffff";
|
||||||
|
font_family = "monospace";
|
||||||
|
font_weight = "bold";
|
||||||
|
font_size = "medium";
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
Configuration settings for sway-easyfocus. All available options can be found here:
|
||||||
|
<https://github.com/edzdez/sway-easyfocus?tab=readme-ov-file#config-file>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||||
|
xdg.configFile."sway-easyfocus/config.yaml" = mkIf (cfg.settings != { }) {
|
||||||
|
source = formatter.generate "sway-easyfocus-config.yaml" cfg.settings;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -392,6 +392,7 @@ import nmtSrc {
|
||||||
./modules/programs/rbw
|
./modules/programs/rbw
|
||||||
./modules/programs/rofi
|
./modules/programs/rofi
|
||||||
./modules/programs/rofi-pass
|
./modules/programs/rofi-pass
|
||||||
|
./modules/programs/sway-easyfocus
|
||||||
./modules/programs/swayimg
|
./modules/programs/swayimg
|
||||||
./modules/programs/swaylock
|
./modules/programs/swaylock
|
||||||
./modules/programs/swayr
|
./modules/programs/swayr
|
||||||
|
|
|
||||||
9
tests/modules/programs/sway-easyfocus/config.yaml
Normal file
9
tests/modules/programs/sway-easyfocus/config.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
chars: fjghdkslaemuvitywoqpcbnxz
|
||||||
|
focused_background_color: '285577'
|
||||||
|
focused_background_opacity: 1.0
|
||||||
|
focused_text_color: ffffff
|
||||||
|
font_family: monospace
|
||||||
|
font_size: medium
|
||||||
|
font_weight: bold
|
||||||
|
window_background_color: d1f21
|
||||||
|
window_background_opacity: 0.2
|
||||||
1
tests/modules/programs/sway-easyfocus/default.nix
Normal file
1
tests/modules/programs/sway-easyfocus/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{ sway-easyfocus-example-config = ./example-config.nix; }
|
||||||
22
tests/modules/programs/sway-easyfocus/example-config.nix
Normal file
22
tests/modules/programs/sway-easyfocus/example-config.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
programs.sway-easyfocus = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
chars = "fjghdkslaemuvitywoqpcbnxz";
|
||||||
|
window_background_color = "d1f21";
|
||||||
|
window_background_opacity = 0.2;
|
||||||
|
focused_background_color = "285577";
|
||||||
|
focused_background_opacity = 1.0;
|
||||||
|
focused_text_color = "ffffff";
|
||||||
|
font_family = "monospace";
|
||||||
|
font_weight = "bold";
|
||||||
|
font_size = "medium";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.config/sway-easyfocus/config.yaml
|
||||||
|
assertFileContent home-files/.config/sway-easyfocus/config.yaml \
|
||||||
|
${./config.yaml}
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue