111 lines
2.8 KiB
Nix
111 lines
2.8 KiB
Nix
{
|
|
description = "Nathan user scripts";
|
|
|
|
inputs = {
|
|
};
|
|
|
|
outputs = { self, ... }: {
|
|
|
|
module = { config, lib, pkgs, ... }: {};
|
|
|
|
hmModule = { config, lib, pkgs, ... }: {
|
|
|
|
home.packages = [
|
|
|
|
#scripts
|
|
(pkgs.writeShellScriptBin "_systemRebuild" ''
|
|
sudo nix flake lock /home/nathan/Projects/System --update-input nathan --update-input root --update-input system
|
|
${pkgs.nh}/bin/nh os switch --ask /home/nathan/Projects/System
|
|
echo //////Enter to close//////
|
|
read
|
|
'')
|
|
(pkgs.writeShellScriptBin "_homeRebuild" ''
|
|
sudo nix flake lock /home/nathan/Projects/System --update-input nathan
|
|
${pkgs.nh}/bin/nh home switch --ask /home/nathan/Projects/System
|
|
echo //////Enter to close//////
|
|
read
|
|
'')
|
|
(pkgs.writeShellScriptBin "addCoverArtMP3" ''
|
|
if [[ $# != 2 ]]
|
|
then echo "usage: addCoverArtMP3 song.mp3 image.jpg"
|
|
exit
|
|
fi
|
|
mv $1 copyof$1
|
|
ffmpeg -i copyof$1 -i $2 -map_metadata 0 -map 0 -map 1 -acodec copy $1
|
|
'')
|
|
|
|
(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})
|
|
|
|
if [[ ''${1:-~/.cache/bg} != ~/.cache/bg ]]; then
|
|
swww img $img --transition-step 10 --transition-fps 30 --transition-type center && changeColors $img $2
|
|
else
|
|
changeColors $img $2
|
|
fi
|
|
'')
|
|
|
|
(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" ''
|
|
ags &
|
|
swww-daemon &
|
|
pypr &
|
|
setWallpaper &
|
|
lxqt-policykit-agent &
|
|
nmcli device wifi connect EagleNet password '~?C#@ZiH' &
|
|
hyprctl setcursor Bibata-Modern-Classic 16 &
|
|
'')
|
|
|
|
(pkgs.writeShellScriptBin "colorPrefix" ''
|
|
exec -a "$0" "$@" &
|
|
sleep 0.4 && changeColors &
|
|
'')
|
|
|
|
];
|
|
};
|
|
|
|
};
|
|
}
|