mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
wleave: init (#7835)
This commit is contained in:
parent
efcba687d3
commit
55b1f5b7b1
9 changed files with 274 additions and 0 deletions
6
tests/modules/programs/wleave/default.nix
Normal file
6
tests/modules/programs/wleave/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ lib, pkgs, ... }:
|
||||
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
wleave-styling = ./styling.nix;
|
||||
wleave-layout-single = ./layout-single.nix;
|
||||
wleave-layout-multiple = ./layout-multiple.nix;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"buttons":[{"action":"systemctl poweroff","keybind":"s","label":"shutdown","text":"Shutdown"},{"action":"systemctl hibernate","height":0.5,"keybind":"h","label":"hibernate","text":"Hibernate","width":0.5},{"action":"systemctl suspend","circular":true,"keybind":"u","label":"suspend","text":"Suspend"},{"action":"swaymsg exit","keybind":"e","label":"exit","text":"Exit"},{"action":"systemctl reboot","keybind":"r","label":"reboot","text":"Reboot"},{"action":"gtklock","keybind":"l","label":"lock","text":"Lock"}],"buttons-per-row":"3","no-version-info":true}
|
||||
64
tests/modules/programs/wleave/layout-multiple.nix
Normal file
64
tests/modules/programs/wleave/layout-multiple.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
config = {
|
||||
home.stateVersion = "22.11";
|
||||
|
||||
programs.wleave = {
|
||||
package = config.lib.test.mkStubPackage { outPath = "@wleave@"; };
|
||||
enable = true;
|
||||
settings = {
|
||||
no-version-info = true;
|
||||
buttons-per-row = "3";
|
||||
|
||||
buttons = [
|
||||
{
|
||||
label = "shutdown";
|
||||
action = "systemctl poweroff";
|
||||
text = "Shutdown";
|
||||
keybind = "s";
|
||||
}
|
||||
{
|
||||
label = "hibernate";
|
||||
action = "systemctl hibernate";
|
||||
text = "Hibernate";
|
||||
keybind = "h";
|
||||
height = 0.5;
|
||||
width = 0.5;
|
||||
}
|
||||
{
|
||||
label = "suspend";
|
||||
action = "systemctl suspend";
|
||||
text = "Suspend";
|
||||
keybind = "u";
|
||||
circular = true;
|
||||
}
|
||||
{
|
||||
label = "exit";
|
||||
action = "swaymsg exit";
|
||||
text = "Exit";
|
||||
keybind = "e";
|
||||
}
|
||||
{
|
||||
label = "reboot";
|
||||
action = "systemctl reboot";
|
||||
text = "Reboot";
|
||||
keybind = "r";
|
||||
}
|
||||
{
|
||||
label = "lock";
|
||||
action = "gtklock";
|
||||
text = "Lock";
|
||||
keybind = "l";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/wleave/style.css
|
||||
assertFileContent \
|
||||
home-files/.config/wleave/layout.json \
|
||||
${./layout-multiple-expected.json}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"buttons":[{"action":"systemctl poweroff","keybind":"s","label":"shutdown","text":"Shutdown"}]}
|
||||
26
tests/modules/programs/wleave/layout-single.nix
Normal file
26
tests/modules/programs/wleave/layout-single.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
config = {
|
||||
home.stateVersion = "22.11";
|
||||
|
||||
programs.wleave = {
|
||||
package = config.lib.test.mkStubPackage { outPath = "@wleave@"; };
|
||||
enable = true;
|
||||
settings.buttons = [
|
||||
{
|
||||
label = "shutdown";
|
||||
action = "systemctl poweroff";
|
||||
text = "Shutdown";
|
||||
keybind = "s";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/wleave/style.css
|
||||
assertFileContent \
|
||||
home-files/.config/wleave/layout.json \
|
||||
${./layout-single-expected.json}
|
||||
'';
|
||||
};
|
||||
}
|
||||
16
tests/modules/programs/wleave/styling-expected.css
Normal file
16
tests/modules/programs/wleave/styling-expected.css
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: Source Code Pro;
|
||||
font-weight: bold;
|
||||
color: #abb2bf;
|
||||
font-size: 18px;
|
||||
min-height: 0px;
|
||||
}
|
||||
window {
|
||||
background: #16191C;
|
||||
color: #aab2bf;
|
||||
}
|
||||
#window {
|
||||
padding: 0 0px;
|
||||
}
|
||||
36
tests/modules/programs/wleave/styling.nix
Normal file
36
tests/modules/programs/wleave/styling.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
config = {
|
||||
home.stateVersion = "22.11";
|
||||
|
||||
programs.wleave = {
|
||||
package = config.lib.test.mkStubPackage { outPath = "@wleave@"; };
|
||||
enable = true;
|
||||
style = ''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: Source Code Pro;
|
||||
font-weight: bold;
|
||||
color: #abb2bf;
|
||||
font-size: 18px;
|
||||
min-height: 0px;
|
||||
}
|
||||
window {
|
||||
background: #16191C;
|
||||
color: #aab2bf;
|
||||
}
|
||||
#window {
|
||||
padding: 0 0px;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/wleave/layout.json
|
||||
assertFileContent \
|
||||
home-files/.config/wleave/style.css \
|
||||
${./styling-expected.css}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue