mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-01-31 09:55:38 +01:00
set up swayidle
This commit is contained in:
parent
89604624c9
commit
82a05531c3
5 changed files with 97 additions and 34 deletions
|
@ -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; [
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
83
users/rouven/modules/hyprland/session.nix
Normal file
83
users/rouven/modules/hyprland/session.nix
Normal file
|
@ -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"));
|
||||
}
|
||||
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -149,6 +149,7 @@
|
|||
};
|
||||
extraPlugins = with pkgs.vimPlugins;
|
||||
[
|
||||
vim-nix
|
||||
dracula-vim
|
||||
nerdcommenter
|
||||
];
|
||||
|
|
Loading…
Add table
Reference in a new issue