about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-09-15 02:05:55 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-09-15 02:05:55 +0200
commit38d25e2f6edca0c0fcb32c1340bafac7c9f4739c (patch)
tree74f8340f8409595cae20ddde9fe1ed109fb59562
parentAdd tmux program (diff)
downloadnixos-config-38d25e2f6edca0c0fcb32c1340bafac7c9f4739c.tar.gz
nixos-config-38d25e2f6edca0c0fcb32c1340bafac7c9f4739c.tar.bz2
nixos-config-38d25e2f6edca0c0fcb32c1340bafac7c9f4739c.zip
Add wayland idling/locking via sway(idle/lock)
-rwxr-xr-xdotfiles/river/init6
-rw-r--r--flake.lock2
-rw-r--r--hosts/configuration.nix7
-rw-r--r--hosts/home.nix2
4 files changed, 16 insertions, 1 deletions
diff --git a/dotfiles/river/init b/dotfiles/river/init
index 106f6f1..0b29c0e 100755
--- a/dotfiles/river/init
+++ b/dotfiles/river/init
@@ -12,6 +12,12 @@
 
 xrdb ~/.Xresources &
 swaybg -i ~/Images/Wallpapers/Day/wave.jpg &
+swayidle -w \
+        timeout 300 'swaylock -f -F -c 000000' \
+	timeout 400 'wlr-randr --output $(wlr-randr | head -n1 | awk "{print $1;}") --off' \
+	resume 'wlr-randr --output $(wlr-randr | head -n1 | awk "{print $1;}") --on' \
+        before-sleep 'swaylock -f -F -c 000000' &
+
 
 riverctl spawn "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river"
 riverctl spawn "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river"
diff --git a/flake.lock b/flake.lock
index b9d103a..e76ba75 100644
--- a/flake.lock
+++ b/flake.lock
@@ -4,7 +4,7 @@
       "flake": false,
       "locked": {
         "lastModified": 1,
-        "narHash": "sha256-XbslHsWSP0xezZOT1NM0587/x/2lc5fRCYwKkbzL9iQ=",
+        "narHash": "sha256-gO3BIkUDARyXvjOUPZUP+fDVNk+dYsBIrEJXVw+6Vwc=",
         "path": "./dotfiles",
         "type": "path"
       },
diff --git a/hosts/configuration.nix b/hosts/configuration.nix
index 0a2c8a3..bb0817c 100644
--- a/hosts/configuration.nix
+++ b/hosts/configuration.nix
@@ -117,6 +117,13 @@
     wlr.enable = true;
   };
 
+  #fix swaylock
+  security.pam.services.swaylock = {
+    text = ''
+      auth include login
+    '';
+  };
+
   # List services that you want to enable:
   services = {
     openssh = {
diff --git a/hosts/home.nix b/hosts/home.nix
index b3057cb..eb0ad68 100644
--- a/hosts/home.nix
+++ b/hosts/home.nix
@@ -39,6 +39,8 @@
       waybar
       wl-clipboard
       sway
+      swayidle
+      swaylock
       swaybg
       river
       wlr-randr