screenlock

This commit is contained in:
CDaut 2024-05-21 11:47:20 +02:00
parent 78369ea502
commit 08c2e18396
Signed by: clara
GPG key ID: 223391B52FAD4463
5 changed files with 22 additions and 11 deletions

View file

@ -150,6 +150,13 @@
GTK_THEME = "Adwaita:dark";
};
# patch for swaylock https://github.com/swaywm/sway/issues/2773
security.pam.services.swaylock = {
text = ''
auth include login
'';
};
# Patch for IDEA PlugIn dev. Should be in dev flake!
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [

View file

@ -35,6 +35,7 @@ let username = "clemens"; in
./programm_configs/redshift.nix
] else [
./programm_configs/sway.nix
./programm_configs/swaylock.nix
./programm_configs/waybar.nix
./programm_configs/gammastep.nix
]);
@ -43,8 +44,6 @@ let username = "clemens"; in
# environment.
home.packages = with pkgs; [
alacritty
polybar
scrot
imagemagick
htop
firefox
@ -81,6 +80,8 @@ let username = "clemens"; in
] ++ (if x11mode then [
arandr
flameshot
scrot
polybar
] else [
wdisplays
sway-contrib.grimshot
@ -94,9 +95,9 @@ let username = "clemens"; in
source = ./programm_configs/slate.rasi;
target = ".config/rofi/slate.rasi";
};
i3lock = {
swaylock = {
source = ./programm_configs/lock.sh;
target = ".config/i3/lock.sh";
target = ".config/sway/lock.sh";
executable = true;
};
};

9
programm_configs/lock.sh Normal file → Executable file
View file

@ -1,8 +1,5 @@
#!/bin/sh
scrot /tmp/screenshot.png
grimshot save output /tmp/screenshot.png
convert /tmp/screenshot.png -blur 0x10 /tmp/screenshotblur.png
set -e
xset s off dpms 0 10 0
i3lock -i /tmp/screenshotblur.png --ignore-empty-password --show-failed-attempts --nofork
rm -f /tmp/screenshot.png
xset s off -dpms
rm /tmp/screenshot.png
swaylock -i /tmp/screenshotblur.png --ignore-empty-password --show-failed-attempts --daemonize

View file

@ -24,7 +24,7 @@
keybindings = {
# screenlock
"${mod}+shift+l" = "exec --no-startup-id ~/.config/i3/lock.sh";
"${mod}+shift+l" = "exec --no-startup-id ~/.config/sway/lock.sh";
# audio control fluff
"XF86AudioRaiseVolume" = "exec --no-startup-id wpctl set-volume @DEFAULT_SINK@ 5%+";

View file

@ -0,0 +1,6 @@
{ config, pkgs, ... }:
{
programs.swaylock = {
enable = true;
};
}