Compare commits

..

2 Commits

Author SHA1 Message Date
c1ef7c8ef8 change the wallpaper-changer script to use a pid file 2025-07-01 16:11:39 +02:00
1cb4b45de1 add hardwareconfig for laptop1 2025-07-01 16:10:52 +02:00
2 changed files with 54 additions and 1 deletions

View File

@ -1,6 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
Wallpaper_DIR="/home/smayzy/wallpaper" Wallpaper_DIR="/home/smayzy/wallpaper"
LOCKFILE="/tmp/wallpaper_changer.lock"
if [ -f "$LOCKFILE" ]; then
old_pid=$(cat "$LOCKFILE")
if ps -p "$old_pid" > /dev/null 2>&1; then
kill "$old_pid"
sleep 1
fi
fi
echo $$ > "$LOCKFILE"
set_wallpaper() { set_wallpaper() {
local Wallpaper=$(find $Wallpaper_DIR | shuf -n 1) local Wallpaper=$(find $Wallpaper_DIR | shuf -n 1)
@ -10,11 +21,12 @@ set_wallpaper() {
echo "preload = $Wallpaper" >> /home/smayzy/.config/hypr/hyprpaper.conf echo "preload = $Wallpaper" >> /home/smayzy/.config/hypr/hyprpaper.conf
echo "wallpaper = ,$Wallpaper" >> /home/smayzy/.config/hypr/hyprpaper.conf echo "wallpaper = ,$Wallpaper" >> /home/smayzy/.config/hypr/hyprpaper.conf
# Restart hyprpaper
pkill hyprpaper 2>/dev/null pkill hyprpaper 2>/dev/null
hyprpaper & hyprpaper &
} }
trap "rm -f $LOCKFILE" EXIT
while true; do while true; do
set_wallpaper set_wallpaper
sleep 600 sleep 600

View File

@ -0,0 +1,41 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/fa4f1a61-338b-4f1e-9f6c-2b2f2cd12f38";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/8E15-A6E3";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/b451db56-e0a5-4799-88a1-34a31ffe3b08"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s20f0u1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}