Move wlogout config to .nix file; hopefully make lockscreen image work
diff --git a/src/apps/personal/sway.nix b/src/apps/personal/sway.nix
index 857e6d1..ae51a86 100644
--- a/src/apps/personal/sway.nix
+++ b/src/apps/personal/sway.nix
@@ -1,4 +1,44 @@
-{ pkgs, lib, ... }: {
+{ pkgs, lib, ... }: let
+ wlogoutConfig = [
+ {
+ label = "lock";
+ action = "swaylock -c 000000 -i ${./sway/lockscreen.png}";
+ text = "Lock";
+ keybind = "l";
+ }
+ {
+ label = "hibernate";
+ action = "swaylock -c 000000 -i ${./sway/lockscreen.png} -f && systemctl hibernate";
+ text = "Hibernate";
+ keybind = "h";
+ }
+ {
+ label = "logout";
+ action = "loginctl terminate-user $USER";
+ text = "Logout";
+ keybind = "e";
+ }
+ {
+ label = "shutdown";
+ action = "systemctl poweroff";
+ text = "Shutdown";
+ keybind = "s";
+ }
+ {
+ label = "suspend";
+ action = "swaylock -c 000000 -i ${./sway/lockscreen.png} -f && systemctl suspend";
+ text = "Suspend";
+ keybind = "u";
+ }
+ {
+ label = "reboot";
+ action = "systemctl reboot";
+ text = "Reboot";
+ keybind = "r";
+ }
+ ];
+ wlogoutConfigFile = writeText "wlogout-layout.layout" (builtins.toJSON wlogoutConfig);
+in {
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true;
@@ -34,7 +74,7 @@
};
};
keybindings = lib.mkOptionDefault {
- "${modifier}+l" = "exec /usr/bin/env wlogout -c 5 -r 5 -p layer-shell -l ${./sway/wlogout-layout.layout}"; # "exec /usr/bin/env swaylock -c 000000";
+ "${modifier}+l" = "exec /usr/bin/env wlogout -c 5 -r 5 -p layer-shell -l ${wlogoutConfigFile}"; # "exec /usr/bin/env swaylock -c 000000";
"XF86AudioRaiseVolume" = "exec volumectl -u up";
"XF86AudioLowerVolume" = "exec volumectl -u down";
"XF86AudioMute" = "exec volumectl toggle-mute";
diff --git a/src/apps/personal/sway/wlogout-layout.layout b/src/apps/personal/sway/wlogout-layout.layout
deleted file mode 100644
index 73c9e80..0000000
--- a/src/apps/personal/sway/wlogout-layout.layout
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "label" : "lock",
- "action" : "swaylock -c 000000 -i ./lockscreen.png",
- "text" : "Lock",
- "keybind" : "l"
-}
-{
- "label" : "hibernate",
- "action" : "swaylock -c 000000 -i ./lockscreen.png -f && systemctl hibernate",
- "text" : "Hibernate",
- "keybind" : "h"
-}
-{
- "label" : "logout",
- "action" : "loginctl terminate-user $USER",
- "text" : "Logout",
- "keybind" : "e"
-}
-{
- "label" : "shutdown",
- "action" : "systemctl poweroff",
- "text" : "Shutdown",
- "keybind" : "s"
-}
-{
- "label" : "suspend",
- "action" : "swaylock -c 000000 -i ./lockscreen.png -f && systemctl suspend",
- "text" : "Suspend",
- "keybind" : "u"
-}
-{
- "label" : "reboot",
- "action" : "systemctl reboot",
- "text" : "Reboot",
- "keybind" : "r"
-}