about summary refs log tree commit diff
path: root/users
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-02-13 12:52:43 -0800
committerFranck Cuny <franck@fcuny.net>2022-02-13 12:52:43 -0800
commit03b0e9e2fa5514171a25f85d9c4190297d73eca9 (patch)
tree35c5459417a589847738f1b86c4b5be64aa8f425 /users
parenthome-manager: the clown car (diff)
downloadworld-03b0e9e2fa5514171a25f85d9c4190297d73eca9.tar.gz
sway: run swayidle and waybar via systemd
Diffstat (limited to 'users')
-rw-r--r--users/fcuny/desktop/sway/default.nix11
-rw-r--r--users/fcuny/desktop/sway/sway-idle.nix11
-rw-r--r--users/fcuny/desktop/sway/waybar.nix8
3 files changed, 21 insertions, 9 deletions
diff --git a/users/fcuny/desktop/sway/default.nix b/users/fcuny/desktop/sway/default.nix
index e1ef951..f765363 100644
--- a/users/fcuny/desktop/sway/default.nix
+++ b/users/fcuny/desktop/sway/default.nix
@@ -2,6 +2,8 @@
 
 {
   imports = [
+    ./waybar.nix
+    ./sway-idle.nix
     ./wofi.nix
   ];
 
@@ -24,15 +26,6 @@
       modifier = "Mod4";
       terminal = "${config.programs.alacritty.package}/bin/alacritty";
       menu = "${pkgs.wofi}/bin/wofi -S run";
-      defaultWorkspace = "workspace number 1";
-      startup = [
-        # Initial lock
-        { command = "${pkgs.swaylock-effects}/bin/swaylock"; }
-        # Start idle daemon
-        { command = "${pkgs.swayidle}/bin/swayidle -w"; }
-        # Start waybar
-        { command = "${pkgs.waybar}/bin/waybar"; }
-      ];
       bars = [ ];
     };
   };
diff --git a/users/fcuny/desktop/sway/sway-idle.nix b/users/fcuny/desktop/sway/sway-idle.nix
new file mode 100644
index 0000000..7db37bf
--- /dev/null
+++ b/users/fcuny/desktop/sway/sway-idle.nix
@@ -0,0 +1,11 @@
+{ pkgs, config, ... }:
+
+{
+  services.swayidle = {
+    enable = true;
+    timeouts = [{
+      timeout = 300;
+      command = "${pkgs.swaylock}/bin/swaylock -fF -c 1D2021";
+    }];
+  };
+}
diff --git a/users/fcuny/desktop/sway/waybar.nix b/users/fcuny/desktop/sway/waybar.nix
new file mode 100644
index 0000000..e5d28de
--- /dev/null
+++ b/users/fcuny/desktop/sway/waybar.nix
@@ -0,0 +1,8 @@
+{ config, pkgs, lib, ... }:
+
+{
+  programs.waybar = {
+    enable = true;
+    systemd.enable = true;
+  };
+}