Improved scripts and changed theme.

This commit is contained in:
Tyler Kelley 2024-03-02 15:09:30 -06:00
parent 24daebf4d3
commit e9b91b41d9
4 changed files with 42 additions and 20 deletions

View File

@ -12,10 +12,10 @@ pkgs.writeShellScriptBin "wallsetter" ''
if [ -d ${wallpaperDir} ]; then
num_files=$(ls -1 ${wallpaperDir} | wc -l)
if [ "$num_files" -eq 0 ]; then
if [ $num_files -eq 0 ]; then
notify-send "The wallpaper folder is empty. Exiting Wallsetter."
exit
elif [ "$num_files" -eq 1 ]; then
elif [ $num_files -eq 1 ]; then
notify-send "The wallpaper folder has only one file. Exiting Wallsetter."
exit
else
@ -28,8 +28,7 @@ pkgs.writeShellScriptBin "wallsetter" ''
fi
while true;
do
if [ "$WALLPAPER" == "$PREVIOUS" ]
then
if [ "$WALLPAPER" == "$PREVIOUS" ]; then
WALLPAPER=$(find ${wallpaperDir} -name '*' | awk '!/.git/' | tail -n +2 | shuf -n 1)
else
PREVIOUS=$WALLPAPER

View File

@ -25,9 +25,7 @@
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/0614aea1-bd66-4bad-b99e-853e99e0be23"; }
];
swapDevices = [ ];
# 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

View File

@ -23,8 +23,12 @@ cd
echo "-----"
backupname=$(date "+%Y-%m-%d-%H-%M-%S")
if [ -d "zaneyos" ]; then
# Check For Persistence. Backing up current flake files
# with it enabled is not yet implemented.
persistState=$(cat zaneyos/hardware.nix | grep persistence | wc -l)
if [ $persistState -eq 0 ]; then
backupname=$(date "+%Y-%m-%d-%H-%M-%S")
if [ -d "zaneyos" ]; then
echo "ZaneyOS exists, backing up to .config/zaneyos-backups folder."
if [ -d ".config/zaneyos-backups" ]; then
echo "Moving current version of ZaneyOS to backups folder."
@ -36,9 +40,10 @@ if [ -d "zaneyos" ]; then
mv $HOME/zaneyos .config/zaneyos-backups/$backupname
sleep 1
fi
else
else
echo "Thank you for choosing ZaneyOS."
echo "I hope you find your time here enjoyable!"
fi
fi
echo "-----"
@ -60,13 +65,20 @@ read -p "Enter Your Username [ $installusername ]: " userName
if [ -z "$userName" ]; then
userName=$(echo $USER)
else
echo "The username you choose is new to the system."
echo "This requires setting a new password."
read -p "Enter New User Password: " newPass
echo "Set password."
userPassword=$(mkpasswd -m sha-512 $newPass)
escaped_userPassword=$(echo "$userPassword" | sed 's/\//\\\//g')
sed -i "/^\s*hashedPassword[[:space:]]*=[[:space:]]*\"/s#\"\(.*\)\"#\"$escaped_userPassword\"#" ./system.nix
if [ $installusername != $userName ]; then
echo "This will create a hashedPassword for the new user in the options file."
while true; do
read -p "Enter New User Password: " newPass
read -p "Enter New User Password Again: " newPass2
if [ $newPass == $newPass2 ]; then
echo "Passwords Match. Setting password."
userPassword=$(mkpasswd -m sha-512 $newPass)
escaped_userPassword=$(echo "$userPassword" | sed 's/\//\\\//g')
sed -i "/^\s*hashedPassword[[:space:]]*=[[:space:]]*\"/s#\"\(.*\)\"#\"$escaped_userPassword\"#" ./system.nix
break
fi
done
fi
fi
sed -i "/^\s*username[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$userName\"/" ./options.nix
@ -80,12 +92,18 @@ sed -i "/^\s*hostname[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$hostName\"/" ./
echo "-----"
read -p "Enter Your New Git Username [Can Be Full Name]: " gitUserName
read -p "Enter Your New Git Username: [ John Smith ] " gitUserName
if [ -z "$gitUserName" ]; then
gitUserName="John Smith"
fi
sed -i "/^\s*gitUsername[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$gitUserName\"/" ./options.nix
echo "-----"
read -p "Enter Your New Git Email: " gitEmail
read -p "Enter Your New Git Email: [ johnsmith@gmail.com ] " gitEmail
if [ -z "$gitEmail" ]; then
gitEmail="johnsmith@gmail.com"
fi
sed -i "/^\s*gitEmail[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$gitEmail\"/" ./options.nix
echo "-----"
@ -234,3 +252,10 @@ echo "-----"
echo "Now Going To Build ZaneyOS, 🤞"
NIX_CONFIG="experimental-features = nix-command flakes"
sudo nixos-rebuild switch --flake .#$hostName
if [ $userName != $installusername ]; then
cd
cp -r zaneyos /home/$userName/
sudo chown -R $userName:users /home/$userName/zaneyos
echo "Ensuring ZaneyOS repository is in your users HOME directory."
fi

View File

@ -15,7 +15,7 @@ in {
hostname = "hyprnix";
gitUsername = "Tyler Kelley";
gitEmail = "tylerzanekelley@gmail.com";
theme = "3024";
theme = "atelier-cave";
slickbar = if waybarStyle == "slickbar" then true else false;
simplebar = if waybarStyle == "simplebar" then true else false;
bar-number = true; # Enable / Disable Workspace Numbers In Waybar