# #!/usr/bin/bash

trap "echo Aborted." SIGINT

echo "ATTENZIONE: Questo script farà un po' di cose che Ala ha scritto, potrebbero essere cose belle ma anche crimini informatici quindi eseguire con cautela!"

# echo "
# Questo script dovrebbe:
# - installare qdbus-runner e kwin-ktoggle
# - impostare qdbus-runner in autorun
# - rimuovere PackageKit-command-not-found
# - aggiungere al menu la voce 'run-script-ala' per poter eseguire questo script più comodamente
# - installare Micro text editor
# "

read -p "Se sei proprio sicuro sicuro che sia il caso di eseguire questo script, digita 'DAJE CAZZO': 
> " confirm

if ! [[ $confirm == "DAJE CAZZO" || $confirm == "daje cazzo" ]] then
    echo "Va bin, termino l'esecuzione..."
    exit
fi



# ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #

# 
# 
# # go to temp folder
# mkdir -p /tmp/ktoggle-installer-tuttecose
# cd /tmp/ktoggle-installer-tuttecose
# 
# # install dependencies
# sudo dnf install -y cmake gcc-c++ qt6-qtbase-devel
# 
# # build and install qdbus-runner
# git clone https://codeberg.org/tubbadu/qdbus-runner.git
# cd qdbus-runner
# mkdir build
# cd build
# cmake ..
# make
# sudo make install
# 
# # come back to /tmp/ktoggle-installer-tuttecose
# cd /tmp/ktoggle-installer-tuttecose
# 
# # set qdbus-runner to autostart
# echo "[Desktop Entry]
# Exec=/usr/local/bin/qdbus-runner
# Icon=application-x-executable
# Name=qdbus-runner
# Type=Application
# X-KDE-AutostartScript=true" > ~/.config/autostart/qdbus-runner.desktop
# 
# # install kwin-ktoggle
# git clone https://codeberg.org/tubbadu/kwin-ktoggle.git
# kpackagetool6 -t KWin/Script -i ./kwin-ktoggle
# 
# # remove PackageKit-command-not-found
# sudo dnf remove -y PackageKit-command-not-found
# 
# # install desktop file to run https://www.tubbadu.freeddns.org/nobara-alesauro-script.sh
# mkdir -p  ~/.local/share/applications/
# echo "[Desktop Entry]
# Comment=Non lanciare a meno che non si sia sicuri che Ala non abbia messo un sacco di virus!
# Exec=curl -s https://www.tubbadu.freeddns.org/nobara-alesauro-script.sh > /tmp/nobara-alesauro-script.sh && bash /tmp/nobara-alesauro-script.sh
# GenericName=Lancia lo script che Ala ha messo sul server
# Icon=application-x-shellscript
# Name=run-script-ala
# NoDisplay=false
# Path=
# PrefersNonDefaultGPU=false
# StartupNotify=true
# Terminal=true
# TerminalOptions=--hold
# Type=Application
# X-KDE-SubstituteUID=false
# X-KDE-Username=
# " > ~/.local/share/applications/run-script-ala.desktop
# chmod +x ~/.local/share/applications/run-script-ala.desktop
# 
# # install Micro text editor
# cd /usr/local/bin
# curl https://getmic.ro | sudo bash

mkdir -p ~/.bin
echo "
#!/usr/bin/bash
flatpak run com.ktechpit.whatsie" > ~/.bin/whatsapp
chmod +x ~/.bin/whatsapp

echo "

### DAJE CAZZO TUTTO FATTO ### 

"