diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix index 123a46e..a6ed086 100755 --- a/hosts/thinkpad/default.nix +++ b/hosts/thinkpad/default.nix @@ -111,11 +111,14 @@ services.logind = { lidSwitch = "suspend-then-hibernate"; - lidSwitchDocked = "hybrid-sleep"; + lidSwitchDocked = "suspend-then-hibernate"; lidSwitchExternalPower = "suspend"; + extraConfig = '' + HandlePowerKey = ignore + ''; }; systemd.sleep.extraConfig = '' - HibernateDelaySec=1h + HibernateDelaySec=3min ''; environment.systemPackages = with pkgs; [ diff --git a/users/rouven/modules/hyprland/default.nix b/users/rouven/modules/hyprland/default.nix index 0b7d3cc..338b049 100644 --- a/users/rouven/modules/hyprland/default.nix +++ b/users/rouven/modules/hyprland/default.nix @@ -1,7 +1,8 @@ { config, pkgs, ... }: { - imports = [ + imports = [ ./hyprpaper.nix + ./session.nix ./waybar.nix ]; wayland.windowManager.hyprland.enable = true; @@ -17,25 +18,11 @@ grim slurp swappy - swaylock-effects - wlogout ]; xdg.configFile = { "hypr/hyprland.conf".source = ./hyprland.conf; - "swaylock/config".text = '' - indicator-radius=200 - indicator-thickness=3 - inside-color=00000000 - inside-ver-color=${config.colorScheme.colors.base0D} - inside-clear-color=${config.colorScheme.colors.base0B} - ring-color=${config.colorScheme.colors.base03} - ring-wrong-color=${config.colorScheme.colors.base08} - screenshot - effect-blur=7x5 - ''; - "wofi/config".text = '' allow_images = true term = alacritty diff --git a/users/rouven/modules/hyprland/hyprland.conf b/users/rouven/modules/hyprland/hyprland.conf index 3ff51da..7991b6a 100644 --- a/users/rouven/modules/hyprland/hyprland.conf +++ b/users/rouven/modules/hyprland/hyprland.conf @@ -1,17 +1,9 @@ # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=eDP-1, 1920x1080, 0x0, 1 -# See https://wiki.hyprland.org/Configuring/Keywords/ for more +# manually start the systemd target +exec-once = systemctl --user start hyprland-session.target -# Execute your favorite apps at launch - #exec-once = waybar & hyprpaper - #exec-once = hyprpaper - - # manually start the systemd target - exec-once = systemctl --user start hyprland-session.target - -# Source a file (multi-file configs) -# source = ~/.config/hypr/myColors.conf # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { @@ -81,7 +73,7 @@ master { gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = off # doesn't really work + workspace_swipe = on } misc { @@ -165,10 +157,7 @@ binde = SHIFT, XF86AudioLowerVolume, exec, pactl set-source-volume @DEFAULT_SOUR bind = ,XF86Messenger, exec, makoctl dismiss bind = SHIFT ,XF86Messenger, exec, makoctl restore bind = ,XF86Go, exec, makoctl invoke -bind = SHIFT, XF86Go, exec, sh ~/.config/mako/do-not-disturb.sh +bind = ,XF86Cancel, exec, sh ~/.config/mako/do-not-disturb.sh bind = ,XF86Display, exec, hyprpaper -bind = ,XF86Favorites, exec, swaylock -bind = ,Cancel, exec, wlogout - -# lock on lid -bindl = ,switch:Lid Switch, exec, swaylock +bind = ,XF86Favorites, exec, loginctl lock-session +bind = ,XF86PowerOff, exec, wlogout diff --git a/users/rouven/modules/hyprland/session.nix b/users/rouven/modules/hyprland/session.nix new file mode 100644 index 0000000..87f30f8 --- /dev/null +++ b/users/rouven/modules/hyprland/session.nix @@ -0,0 +1,83 @@ +{ config, pkgs, ... }: +{ + home.packages = with pkgs; [ + swaylock-effects + wlogout + ]; + + services.swayidle = { + enable = true; + systemdTarget = "hyprland-session.target"; + events = [ + { event = "before-sleep"; command = "${pkgs.swaylock-effects}/bin/swaylock"; } + { event = "lock"; command = "${pkgs.swaylock-effects}/bin/swaylock"; } + ]; + timeouts = [ + { timeout = 300; command = "${pkgs.swaylock-effects}/bin/swaylock"; } + ]; + }; + + xdg.configFile = { + "swaylock/config".text = '' + indicator-radius=200 + indicator-thickness=3 + inside-color=00000000 + inside-ver-color=${config.colorScheme.colors.base0D} + inside-clear-color=${config.colorScheme.colors.base0B} + ring-color=${config.colorScheme.colors.base03} + ring-wrong-color=${config.colorScheme.colors.base08} + screenshot + effect-blur=7x5 + ''; + + "wlogout/style.css".text = '' + * { + background-image: none; + } + window { + background-color: rgba(12, 12, 12, 0); + } + button { + color: #${config.colorScheme.colors.base05}; + background-color: #${config.colorScheme.colors.base00}; + border-style: solid; + border-width: 2px; + border-radius: 30px; + margin: 5px; + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + } + + button:active, button:hover { + background-color: #${config.colorScheme.colors.base03}; + outline-style: none; + } + + #lock { + background-image: image(url("${pkgs.wlogout}/share/wlogout/icons/lock.png")); + } + + #logout { + background-image: image(url("${pkgs.wlogout}/share/wlogout/icons/logout.png")); + } + + #suspend { + background-image: image(url("${pkgs.wlogout}/share/wlogout/icons/suspend.png")); + } + + #hibernate { + background-image: image(url("${pkgs.wlogout}/share/wlogout/icons/hibernate.png")); + } + + #shutdown { + background-image: image(url("${pkgs.wlogout}/share/wlogout/icons/shutdown.png")); + } + + #reboot { + background-image: image(url("${pkgs.wlogout}/share/wlogout/icons/reboot.png")); + } + + ''; + }; +} diff --git a/users/rouven/modules/neovim/default.nix b/users/rouven/modules/neovim/default.nix index f14c99e..57108a2 100644 --- a/users/rouven/modules/neovim/default.nix +++ b/users/rouven/modules/neovim/default.nix @@ -149,6 +149,7 @@ }; extraPlugins = with pkgs.vimPlugins; [ + vim-nix dracula-vim nerdcommenter ];