wlogout: add module (#3629)

This commit is contained in:
Sefa Eyeoglu 2023-01-31 17:06:18 +01:00 committed by GitHub
parent 08a778d803
commit 69696fe539
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 316 additions and 0 deletions

View file

@ -0,0 +1,5 @@
{
wlogout-styling = ./styling.nix;
wlogout-layout-single = ./layout-single.nix;
wlogout-layout-multiple = ./layout-multiple.nix;
}

View file

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

View 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}
'';
};
}

View file

@ -0,0 +1 @@
{"action":"systemctl poweroff","keybind":"s","label":"shutdown","text":"Shutdown"}

View 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}
'';
};
}

View 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;
}

View 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}
'';
};
}