mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-07 01:07:00 +00:00
eww: added tests
This commit is contained in:
parent
f8729b11ee
commit
1f6fa87808
5 changed files with 79 additions and 0 deletions
|
@ -282,6 +282,7 @@ in import nmtSrc {
|
||||||
./modules/programs/bemenu
|
./modules/programs/bemenu
|
||||||
./modules/programs/boxxy
|
./modules/programs/boxxy
|
||||||
./modules/programs/cavalier
|
./modules/programs/cavalier
|
||||||
|
./modules/programs/eww
|
||||||
./modules/programs/firefox/firefox.nix
|
./modules/programs/firefox/firefox.nix
|
||||||
./modules/programs/firefox/floorp.nix
|
./modules/programs/firefox/floorp.nix
|
||||||
./modules/programs/foot
|
./modules/programs/foot
|
||||||
|
|
15
tests/modules/programs/eww/basic-config.nix
Normal file
15
tests/modules/programs/eww/basic-config.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ ... }: {
|
||||||
|
config = {
|
||||||
|
programs.eww = {
|
||||||
|
enable = true;
|
||||||
|
configDir = ./config-dir;
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
yuckDir=home-files/.config/eww
|
||||||
|
|
||||||
|
assertFileExists $yuckDir/eww.yuck
|
||||||
|
assertFileExists $yuckDir/eww.scss
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
4
tests/modules/programs/eww/config-dir/eww.scss
Normal file
4
tests/modules/programs/eww/config-dir/eww.scss
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
.powermenu {
|
||||||
|
padding: 10px 10px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
58
tests/modules/programs/eww/config-dir/eww.yuck
Normal file
58
tests/modules/programs/eww/config-dir/eww.yuck
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
(defwindow powermenu
|
||||||
|
:monitor 0
|
||||||
|
:geometry (geometry
|
||||||
|
:anchor "center"
|
||||||
|
)
|
||||||
|
; Widgets
|
||||||
|
(box
|
||||||
|
:spacing 5
|
||||||
|
:class "powermenu"
|
||||||
|
:space-evenly true
|
||||||
|
:orientation "vertical"
|
||||||
|
:halign "left"
|
||||||
|
:valign "center"
|
||||||
|
|
||||||
|
; Contents
|
||||||
|
(button
|
||||||
|
:onclick "eww open confirm-command --arg action=poweroff --arg command=poweroff"
|
||||||
|
"Poweroff"
|
||||||
|
)
|
||||||
|
(button
|
||||||
|
:onclick "eww open confirm-command --arg action=reboot --arg command=reboot"
|
||||||
|
"Reboot"
|
||||||
|
)
|
||||||
|
(button
|
||||||
|
:onclick "eww close powermenu"
|
||||||
|
"Cancel"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defwindow confirm-command [action command]
|
||||||
|
:monitor 0
|
||||||
|
:geometry (geometry
|
||||||
|
:anchor "center"
|
||||||
|
:width "13%"
|
||||||
|
:height "8%"
|
||||||
|
)
|
||||||
|
; Widgets
|
||||||
|
(box
|
||||||
|
:class "powermenu"
|
||||||
|
:orientation "vertical"
|
||||||
|
:halign "center"
|
||||||
|
:valign "center"
|
||||||
|
"Are you sure you want to ${action}"
|
||||||
|
(box
|
||||||
|
:orientation "horizontal"
|
||||||
|
:spacing 10
|
||||||
|
(button
|
||||||
|
:onclick "eww close confirm-command"
|
||||||
|
"No"
|
||||||
|
)
|
||||||
|
(button
|
||||||
|
:onclick command
|
||||||
|
"Yes"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
1
tests/modules/programs/eww/default.nix
Normal file
1
tests/modules/programs/eww/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{ eww-basic-config = ./basic-config.nix; }
|
Loading…
Add table
Reference in a new issue