diff --git a/home-manager/hyprland/default.nix b/home-manager/hyprland/default.nix index f6bf98e..f44b507 100644 --- a/home-manager/hyprland/default.nix +++ b/home-manager/hyprland/default.nix @@ -3,5 +3,6 @@ ./hyprland-settings.nix ./hyprland-xwaylandvideobridge.nix ./waybar.nix + ./hyprlock.nix ]; } diff --git a/home-manager/hyprland/hyprland-settings.nix b/home-manager/hyprland/hyprland-settings.nix index 41f5f19..a09bb74 100644 --- a/home-manager/hyprland/hyprland-settings.nix +++ b/home-manager/hyprland/hyprland-settings.nix @@ -25,12 +25,12 @@ in { # laptop "eDP-1,3840x2160@60,0x0,2" "DP-3,1920x1080@60,1920x0,1" - ] else - [ - # Default - ",preferred,auto,auto" - ]; - + ",preferred,auto,auto" + ] else [ + # Default + ",preferred,auto,auto" + ]; + # See https://wiki.hyprland.org/Configuring/Keywords/ for more # Execute your favorite apps at launch @@ -146,11 +146,13 @@ in { pdfgrep = "${pkgs.pdfgrep}/bin/pdfgrep"; brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; swaylock = "${pkgs.swaylock}/bin/swaylock"; + hyprlock = "${pkgs.hyprlock}/bin/hyprlock"; playerctl = "${pkgs.playerctl}/bin/playerctl"; in [ "$mainMod, Q, exec, ${kitty}" "$mainMod, C, killactive" - "$mainMod, L, exec, ${swaylock} -f -c 000000" + #"$mainMod, L, exec, ${swaylock} -f -c 000000" + "$mainMod, L, exec, ${hyprlock}" "$mainMod, M, exit," "$mainMod, E, exec, ${thunar}" "$mainMod, F, fullscreen" diff --git a/home-manager/hyprland/hyprlock.nix b/home-manager/hyprland/hyprlock.nix new file mode 100644 index 0000000..4b28750 --- /dev/null +++ b/home-manager/hyprland/hyprlock.nix @@ -0,0 +1,88 @@ +{ config, osConfig, pkgs, inputs, lib, ... }: +with lib; +let + cfg = osConfig.custom.graphical.hyprland; +in +{ + config = lib.mkIf cfg.enable { + programs.hyprlock.enable = true; + programs.hyprlock.settings = { + general = { + disable_loading_bar = true; + grace = 0; + hide_cursor = true; + no_fade_in = false; + }; + + background = [ + { + path = "/synced/default/dinge/Bg/yuyukowallpaper1809.png"; + blur_passes = 3; + blur_size = 8; + } + ]; + + # TIME + #label = { + # monitor = ""; + # text = "cmd[update:30000] echo \"$(date +\"%R\")\""; + # color = "${config.colorScheme.colors.base05}"; + # #font_size = 90; + # #font_family = "$font"; + # position = "-130, -100"; + # halign = "right"; + # valign = "top"; + # shadow_passes = 2; + #}; + # + ## DATE + #label = { + # monitor = ""; + # text = "cmd[update:43200000] echo \"$(date +\"%A, %d %B %Y\")\""; + # color = "${config.colorScheme.colors.base05}"; + # #font_size = "25"; + # #font_family = "$font"; + # position = "-130, -250"; + # halign = "right"; + # valign = "top"; + # shadow_passes = 2; + #}; + input-field = [ + { + size = "400, 100"; + 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 = "Password..."; + shadow_passes = 2; + } + ]; + }; + services.hypridle.enable = true; + services.hypridle.settings = { + general = { + after_sleep_cmd = "hyprctl dispatch dpms on"; + ignore_dbus_inhibit = false; + lock_cmd = "hyprlock"; + }; + + listener = [ + { + timeout = 900; + on-timeout = "hyprlock"; + } + { + timeout = 1200; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; + +} diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index 248dcb0..389e98a 100644 --- a/modules/graphical/hyprland.nix +++ b/modules/graphical/hyprland.nix @@ -55,27 +55,65 @@ in { auth include login ''; }; - }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - # hyprland stuff - dunst - swww - rofi-wayland - libnotify - networkmanagerapplet - wayland - wl-clipboard - #qt5.qtwayland - #qt6.qmake - #qt6.qtwayland - #waybar - #xdg-desktop-portal-hyprland - #xdg-desktop-portal-gtk - #xdg-utils - #xwayland - ]; + + environment.sessionVariables = { + WLR_NO_HARDWARE_CURSORS="1"; + #WLR_DRM_NO_ATOMIC="1"; + #WLR_DRM_DEVICES = "/dev/dri/card0"; + LIBVA_DRIVER_NAME="nvidia"; + # black screen :( + #XDG_SESSION_TYPE = "wayland"; + GBM_BACKEND = "nvidia-drm"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + WLR_RENDERER_ALLOW_SOFTWARE="1"; + }; + + hardware = { + # Opengl + opengl.enable = true; + + # Most wayland compositors need this + nvidia.modesetting.enable = true; + }; + + xdg.portal.enable = true; + xdg.portal.extraPortals = lib.mkDefault [ pkgs.xdg-desktop-portal-gtk ]; + + programs.hyprland = { + enable = true; + package = pkgs.unstable.hyprland; + }; + + security.pam.services = { + swaylock = { + fprintAuth = false; + text = '' + auth include login + ''; + }; + }; + security.pam.services.hyprlock = {}; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # hyprland stuff + patchedWaybar + dunst + swww + rofi-wayland + libnotify + networkmanagerapplet + wayland + wl-clipboard + #qt5.qtwayland + #qt6.qmake + #qt6.qtwayland + #waybar + #xdg-desktop-portal-hyprland + #xdg-desktop-portal-gtk + #xdg-utils + #xwayland + ]; }; } diff --git a/search.sh b/search.sh new file mode 100755 index 0000000..1923719 --- /dev/null +++ b/search.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +pdfgrep -h -i -C 10 "$1" /synced/fh/cloud_computing/scriptum/*