add lockscreen

This commit is contained in:
2025-05-06 22:54:36 +02:00
parent 11358663fc
commit 23010ee036
13 changed files with 129 additions and 21 deletions

View File

@@ -31,6 +31,19 @@
stateVersion = "23.11";
};
systemd.user.services = {
idle-inhibitor = {
Unit = {
Description = "Presentation Mode";
};
Service = {
Type = "simple";
ExecStart = "systemd-inhibit --what=idle --who=Caffeine --why=Caffeine --mode=block sleep inf";
};
};
};
programs = { home-manager.enable = true; };
nixpkgs.config = {

View File

@@ -1,5 +1,6 @@
{
imports = [
./hyprlock.nix
./river
./alacritty
./anki

View File

@@ -254,6 +254,13 @@
:class "text separator"
:text "|"))
(defwidget idle_inhibitor []
(box :class "idle_inhibitor"
:space-evenly false
(button :class "icon"
:onclick "systemctl --user is-active idle-inhibitor.service && systemctl --user stop idle-inhibitor.service || systemctl --user start idle-inhibitor.service"
(label :text "${idle_inhibitor == 'start' ? '󰈈' : '󰛐' }"))))
;; /-- Bar -->
(defwindow bar []
:geometry (geometry
@@ -266,6 +273,8 @@
:reserve (struts
:distance "25px"
:side "top")
:exclusive true
:layer "top"
:windowtype "dock"
(box
:orientation "horizontal"
@@ -277,6 +286,7 @@
(widgetLogSeperator)
(widgetWindows)
(box :hexpand true)
(idle_inhibitor)
(widgetSpeaker)
(widgetSeperator)
(widgetBacklight)

View File

@@ -0,0 +1,6 @@
socat - UNIX-CONNECT:"$XDG_RUNTIME_DIR"/river/status | while read -r line; do
workspace=$(echo "$line" | jq -r '.workspace')
layout=$(echo "$line" | jq -r '.layout')
title=$(echo "$line" | jq -r '.title')
echo "WS: $workspace | Layout: $layout | $title"
done

View File

@@ -0,0 +1,33 @@
{ ... }:
{
programs.hyprlock = {
enable = true;
settings = {
general = {
disable_loading_bar = true;
grace = 300;
hide_cursor = true;
no_fade_in = false;
};
background = [{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}];
input-field = [{
size = "200, 50";
position = "0, -80";
monitor = "";
dots_center = true;
fade_on_empty = false;
font_color = "rgb(202, 211, 245)";
inner_color = "rgb(91, 96, 120)";
outer_color = "rgb(24, 25, 38)";
outline_thickness = 5;
placeholder_text = ''<span foreground="##cad3f5">Password...</span>'';
shadow_passes = 2;
}];
};
};
}

View File

@@ -1,13 +1,13 @@
{ pkgs, lib, ... }:
{
home.packages = with pkgs; [
wlr-randr
yad slurp
grim
wl-clipboard
rivercarro
# river-status
];
xdg.configFile."helperscripts" = {
recursive = true;
@@ -33,13 +33,12 @@
systemd = { enable = true; };
xwayland.enable = true;
extraConfig = ''
rivertile -view-padding 0 -outer-padding 25 &
rivertile -view-padding 0 -outer-padding 0 &
'';
settings = {
spawn = [
"nextcloud --background"
"~/.config/helperscriptsstartEww.sh"
"trayer --edge top --align left --widthtype request --height 25 --transparent true --alpha 0 --expand true --SetDockType true --SetPartialStrut true"
"/home/elias/.config/helperscripts/startEww.sh"
];
spawn-tagmask = "${all_but_scratch_tag}";
keyboard-layout = "de";

View File

@@ -1,5 +1,5 @@
{ pkgs, ... }:
{
imports = [ ./ssh-agent ./gpg-agent ];
imports = [ ./ssh-agent ./gpg-agent ./hypridle.nix ];
}

View File

@@ -0,0 +1,23 @@
{ pkgs, ... }: {
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd =
"/run/current-system/sw/bin/pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
before_sleep_cmd = "/run/current-system/sw/bin/loginctl lock-session";
};
listener = [
{
timeout = 300;
on-timeout = "${pkgs.hyprlock}/bin/hyprlock";
}
{
timeout = 600;
on-timeout = "${pkgs.systemd}/bin/systemctl suspend";
}
];
};
};
}