wlogout: add module (#3629)
This commit is contained in:
parent
08a778d803
commit
69696fe539
11 changed files with 316 additions and 0 deletions
5
tests/modules/programs/wlogout/default.nix
Normal file
5
tests/modules/programs/wlogout/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
wlogout-styling = ./styling.nix;
|
||||
wlogout-layout-single = ./layout-single.nix;
|
||||
wlogout-layout-multiple = ./layout-multiple.nix;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{"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"}
|
||||
62
tests/modules/programs/wlogout/layout-multiple.nix
Normal file
62
tests/modules/programs/wlogout/layout-multiple.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
home.stateVersion = "22.11";
|
||||
|
||||
programs.wlogout = {
|
||||
package = config.lib.test.mkStubPackage { outPath = "@wlogout@"; };
|
||||
enable = true;
|
||||
layout = [
|
||||
{
|
||||
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/wlogout/style.css
|
||||
assertFileContent \
|
||||
home-files/.config/wlogout/layout \
|
||||
${./layout-multiple-expected.json}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"action":"systemctl poweroff","keybind":"s","label":"shutdown","text":"Shutdown"}
|
||||
27
tests/modules/programs/wlogout/layout-single.nix
Normal file
27
tests/modules/programs/wlogout/layout-single.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
home.stateVersion = "22.11";
|
||||
|
||||
programs.wlogout = {
|
||||
package = config.lib.test.mkStubPackage { outPath = "@wlogout@"; };
|
||||
enable = true;
|
||||
layout = [{
|
||||
label = "shutdown";
|
||||
action = "systemctl poweroff";
|
||||
text = "Shutdown";
|
||||
keybind = "s";
|
||||
}];
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/wlogout/style.css
|
||||
assertFileContent \
|
||||
home-files/.config/wlogout/layout \
|
||||
${./layout-single-expected.json}
|
||||
'';
|
||||
};
|
||||
}
|
||||
16
tests/modules/programs/wlogout/styling-expected.css
Normal file
16
tests/modules/programs/wlogout/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;
|
||||
}
|
||||
39
tests/modules/programs/wlogout/styling.nix
Normal file
39
tests/modules/programs/wlogout/styling.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
home.stateVersion = "22.11";
|
||||
|
||||
programs.wlogout = {
|
||||
package = config.lib.test.mkStubPackage { outPath = "@wlogout@"; };
|
||||
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/wlogout/layout
|
||||
assertFileContent \
|
||||
home-files/.config/wlogout/style.css \
|
||||
${./styling-expected.css}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue