nix/home-manager/hosts/nixos-framework/desktops/hyprland/default.nix

62 lines
1.9 KiB
Nix
Raw Normal View History

2024-01-05 08:17:13 +01:00
{ ... }: {
2024-01-03 15:33:36 +01:00
wayland.windowManager.hyprland = {
settings = {
monitor = ",highrr,auto,1.25";
bind = [
'', XF86AudioMute, exec, swayosd --output-volume=mute-toggle''
'', XF86AudioPrev, exec, playerctl previous''
];
binde = [
'', XF86AudioPlay, exec, playerctl play-pause''
'', XF86AudioNext, exec, playerctl next''
'', XF86MonBrightnessDown, exec, light -U 5''
'', XF86MonBrightnessUp, exec, light -A 5''
'', XF86AudioLowerVolume, exec, swayosd --output-volume=lower''
'', XF86AudioRaiseVolume, exec, swayosd --output-volume=raise''
];
bindl = [
'',switch:on:1241ec0,exec,hyprctl keyword monitor "eDP-1, 2560x1600, 0x0, 1"''
'',switch:off:1241ec0,exec,hyprctl keyword monitor "eDP-1, disable"''
];
2023-09-29 05:46:20 +02:00
};
2024-01-03 15:34:46 +01:00
};
home.file = {
2023-09-29 05:46:20 +02:00
# Set the custom launcher script
".config/hypr/start.sh" = {
enable = true;
executable = true;
text = ''
#!/usr/bin/env bash
# https://wiki.hyprland.org/FAQ/#some-of-my-apps-take-a-really-long-time-to-open
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &
# Set the wallpaper
swww init
# Waybar
waybar &
# Set up the idle management daemon
swayidle -w \
timeout 120 'swaylock -f && playerctl pause' \
timeout 180 'hyprctl dispatch dpms off' \
timeout 300 'systemctl suspend-then-hibernate' \
resume 'hyprctl dispatch dpms on' \
before-sleep 'swaylock -f' \
before-sleep 'playerctl pause' &
# Automatic device mounting
udiskie &
DIR=/etc/nixos/git/wallpapers/${theme}
IMG=`ls $DIR | shuf -n 1`
swww img $DIR/$IMG -t random &
# Notification listener
mako
'';
};
};
}