nix/home-manager/hosts/nixos-vm-02/desktops/hyprland/default.nix

51 lines
1.4 KiB
Nix
Raw Normal View History

2023-09-29 14:08:03 +02:00
{ theme, ... }: {
2023-09-29 13:53:21 +02:00
home.file = {
".config/hypr/hyprland.conf" = {
enable = true;
text = ''
# Monitor specific:
monitor=,2560x1440,auto,1
# Start the config:
exec-once=bash ~/.config/hypr/start.sh
'';
};
# 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
'';
};
};
}