Files
Olympus/home-manager/nathan/packages/scripts/default.nix
2025-08-24 22:00:19 -05:00

97 lines
2.7 KiB
Nix

{ config, lib, pkgs, ... }: {
options = {
homeScripts.enable = lib.options.mkOption {
type = lib.types.bool;
default = true;
};
};
config = lib.mkIf config.homeScripts.enable {
home.packages = [
#scripts
(pkgs.writeShellScriptBin "_systemRebuild" ''
${pkgs.nh}/bin/nh os switch --ask
echo //////Enter to close//////
read
'')
(pkgs.writeShellScriptBin "randWallpaper" ''
file=$(ls /home/nathan/Pictures/Wallpaper/ | shuf -n 1)
setWallpaper /home/nathan/Pictures/Wallpaper/$file
'')
(pkgs.writeShellScriptBin "setWallpaper" ''
img=''$(realpath ''${1:-~/.cache/bg})
${pkgs.swww}/bin/swww img ''$img
changeColors ''$img ''$2
'')
(pkgs.writeShellScriptBin "changeColors" ''
if [[ $(ls ~/.cache/ | grep bga) != bga ]]; then
echo 100 > ~/.cache/bga
fi
alpha=''${2:-`cat ~/.cache/bga`}
img=''$(realpath ''${1:-~/.cache/bg})
if [[ $alpha -lt 0 ]]; then
$alpha=0
fi
if [[ $alpha -gt 100 ]]; then
$alpha=100
fi
wal -i $img -a $alpha --cols16 -n
echo $alpha > ~/.cache/bga
rm ~/.cache/bg
ln -s $img ~/.cache/bg
sleep 0.4
pywalfox update &
themecord > ~/.cache/_.txt && rm ~/.cache/_.txt
[[ $(pidof cava) != "" ]] && pkill -USR1 cava &
for i in $(ls /run/user/1000 | grep nvim); do nvr -s --servername /run/user/1000/$i --remote-send '<cmd>colorscheme pywal<CR>'; done
pkill -USR1 kitty
'')
(pkgs.writeShellScriptBin "onSystemStart" ''
${pkgs.hyprpanel}/bin/hyprpanel &
randWallpaper &
pypr &
lxqt-policykit-agent &
# nmcli device wifi connect EagleNet password '~?C#@ZiH' &
hyprctl setcursor Bibata-Modern-Classic 16 &
sleep 3
hyprctl reload &
#tmux new-session -s hyprland
'')
(pkgs.writeShellScriptBin "colorPrefix" ''
exec -a "$0" "$@" &
sleep 0.4 && changeColors &
'')
] ++ (if config.homeconfig.standalone then [
(pkgs.writeShellScriptBin "_homeRebuild" ''
${pkgs.nh}/bin/nh home switch --ask
echo //////Enter to close//////
read
'')
] else []);
};
}