default:
    just --list

# inits
init-alpine: install-alpine stow build-wayfreeze

install-alpine:
    doas apk update
    doas apk upgrade
    xargs -a packages doas apk add

# my apps
install-stabs-apps:
	doas apk add flatpak
	doas flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
	@echo "installing my apps"
	doas flatpak install -y flathub dev.vencord.Vesktop com.valvesoftware.Steam

	@echo "Permissionizing..."
	flatpak override --user --filesystem=home dev.vencord.Vesktop

stow:
    mkdir -p ~/.config/
    stow -t ~/.config config
    @echo "Stoweed"

unstow:
    stow -D -t ~/.config config

setup-displays:
    mkdir -p ~/.config/mute/
    python3 init/swaysetupmonitors.py
    mv mute/monitors.conf ~/.config/mute/

restow:
    stow -R -t ~/.config config

# builds
build-wayfreeze:
    @echo "Ensuring compilation dependencies are met..."
    doas apk add git cargo
    rm -rf /tmp/wayfreeze
    git clone https://github.com/Jappie3/wayfreeze.git /tmp/wayfreeze
    cd /tmp/wayfreeze && cargo build --release
    mkdir -p  ~/.local/bin
    mv /tmp/wayfreeze/target/release/wayfreeze ~/.local/bin/wayfreeze
