From dd57859fc8ae2e2530d45193ddcca6997242d40a Mon Sep 17 00:00:00 2001 From: CDaut Date: Sun, 25 Feb 2024 23:44:38 +0100 Subject: [PATCH] screenlock --- configuration.nix | 1 + home.nix | 6 ++++++ programm_configs/lock.sh | 8 ++++++++ vm_hardware-configuration.nix | 3 +++ 4 files changed, 18 insertions(+) create mode 100644 programm_configs/lock.sh diff --git a/configuration.nix b/configuration.nix index 05b4317..f59cbdb 100644 --- a/configuration.nix +++ b/configuration.nix @@ -56,6 +56,7 @@ package = pkgs.i3-gaps; extraPackages = with pkgs; [ dmenu + i3lock ]; }; }; diff --git a/home.nix b/home.nix index 75f7c58..a49c345 100644 --- a/home.nix +++ b/home.nix @@ -32,6 +32,8 @@ in zsh alacritty polybar + scrot + imagemagick firefox tex jetbrains.idea-ultimate @@ -43,6 +45,10 @@ in source = ./programm_configs/slate.rasi; target = ".config/rofi/slate.rasi"; }; + i3lock = { + source = ./programm_configs/lock.sh; + target = ".config/i3/lock.sh"; + }; }; # envars diff --git a/programm_configs/lock.sh b/programm_configs/lock.sh new file mode 100644 index 0000000..9f903fa --- /dev/null +++ b/programm_configs/lock.sh @@ -0,0 +1,8 @@ +#!/bin/sh +scrot /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 diff --git a/vm_hardware-configuration.nix b/vm_hardware-configuration.nix index 5981af9..b3d8a5b 100644 --- a/vm_hardware-configuration.nix +++ b/vm_hardware-configuration.nix @@ -28,4 +28,7 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; virtualisation.virtualbox.guest.enable = true; virtualisation.virtualbox.guest.x11 = true; + + # only add this usergroup on oracle VMs + users.users.clemens.extraGroups = ["vboxsf"]; }