#! /bin/bash

# Copy VSCodium settings
mkdir -p ./general/configs/VSCodium/User
cp ~/.config/VSCodium/product.json ./general/configs/VSCodium/
cp -r ~/.config/VSCodium/User/snippets ./general/configs/VSCodium/User/
cp -r ~/.config/VSCodium/User/globalStorage ./general/configs/VSCodium/User/
cp ~/.config/VSCodium/User/keybindings.json ./general/configs/VSCodium/User/
cp ~/.config/VSCodium/User/settings.json ./general/configs/VSCodium/User/
cp ~/.config/VSCodium/User/syncLocalSettings.json ./general/configs/VSCodium/User/
rm -rf ./general/configs/VSCodium/User/globalStorage

rm ./pc/installedPackages.txt
pacman -Qq > ./pc/installedPackages.txt
sudo cat /etc/pacman.conf > ./general/pacman.conf
sudo cat /etc/mkinitcpio.conf > ./general/mkinitcpio.conf
sudo cat /etc/environment > ./pc/environment
sudo cat /etc/default/grub > ./pc/grub
mkdir ./general/docker
sudo cat /etc/docker/daemon.json > ./general/docker/daemon.json

cp ~/.bash_history ./general
cp ~/.bashrc ./general

# copy other config files
mkdir ./pc/configs/OpenRGB
mkdir ./pc/configs/Portmaster
cp -r ~/.config/hypr ./pc/configs/
cp -r ~/.config/waybar ./pc/configs/
cp -r ~/.config/OpenRGB/OpenRGB.json ./pc/configs/OpenRGB/OpenRGB.json
cp ~/.config/Portmaster/Preferences ./pc/configs/Portmaster/
cp -r ~/.config/mpv ./general/configs
cp -r ~/.config/wlogout ./general/configs/
cp -r ~/.config/fish ./general/configs/
cp -r ~/.config/dunst ./general/configs/
cp -r ~/.config/rofi ./general/configs/
cp -r ~/.config/kitty ./general/configs/
cp -r ~/.config/terminator ./general/configs/
cp -r ~/.config/Thunar ./general/configs/
cp -r ~/.config/yazi ./general/configs/
cp -r ~/.config/mpv ./general/configs/
rm -rf ./pc/configs/hypr/hyprland/
cp -r ~/.config/hypr/hyprland/* ./general/hyprland/

# Get systemd mount jobs
sudo cp -r /etc/systemd/system/mnt* ./pc/mnt
sudo chmod -R 777 ./pc/mnt


vscodium --list-extensions > ./general/vscode-extensions


echo "Collected. Also consider running nvim-collect!"
