2023-10-12 13:58:03 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
parseNurl() {
|
|
|
|
REV=$(nurl -j "$1" | jq '.["args"].["rev"]')
|
|
|
|
HASH=$(nurl -j "$1" | jq '.["args"].["hash"]')
|
|
|
|
|
2023-10-25 15:20:04 -04:00
|
|
|
sed -i "s,rev = .*,rev = $REV;," "$2"
|
|
|
|
sed -i "s,hash = .*,hash = $HASH;," "$2"
|
2023-10-25 14:29:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
updateVencord() {
|
|
|
|
parseNurl https://github.com/Vendicated/Vencord /home/matt/.nix/common/overlays/vencord.nix
|
2023-10-12 13:58:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# TODO
|
2023-10-25 14:29:31 -04:00
|
|
|
#parseNurl "https://github.com/lukas-reineke/indent-blankline.nvim"
|
2023-10-12 13:58:03 -04:00
|
|
|
|
|
|
|
# https://github.com/dracula/xresources
|
|
|
|
# https://github.com/dracula/plymouth
|
|
|
|
# https://github.com/dracula/gtk
|
|
|
|
|
|
|
|
# https://gitlab.com/mishakmak/pam-fprint-grosshack
|
|
|
|
# https://github.com/tio/input-emulator
|
|
|
|
|
2023-10-21 15:40:22 -04:00
|
|
|
# https://extension.7tv.gg/manifest.moz.json
|
2023-10-12 13:58:03 -04:00
|
|
|
updateFirefoxAddons() {
|
|
|
|
echo "Updating firefox addons using mozilla-addons-to-nix"
|
|
|
|
|
2023-10-20 00:35:03 -04:00
|
|
|
(cd /home/matt/.nix/modules/firefox/addons || return;
|
2023-10-12 13:58:03 -04:00
|
|
|
|
|
|
|
file=generated-firefox-addons.nix
|
|
|
|
if [[ -f $file ]]; then
|
|
|
|
printf "\nOld versions: \n"
|
|
|
|
|
|
|
|
grep -A 1 --no-group-separator 'pname' "$file" |
|
|
|
|
awk '{ gsub(/"/, ""); gsub(/;/, ""); print $3 }' |
|
|
|
|
awk 'NR%2{printf $0" version ";next;}1' | paste -sd'\n' -
|
|
|
|
|
|
|
|
printf "\nNew versions: \n"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mozilla-addons-to-nix addons.json generated-firefox-addons.nix)
|
|
|
|
}
|
|
|
|
|
|
|
|
doAll() {
|
|
|
|
updateFirefoxAddons
|
|
|
|
}
|
|
|
|
|
|
|
|
[[ "$1" == "-a" || "$1" == "--all" ]] && doAll
|
2023-10-25 14:29:31 -04:00
|
|
|
[[ "$1" == "-v" || "$1" == "--vencord" ]] && updateVencord
|
2023-10-12 13:58:03 -04:00
|
|
|
[[ "$1" == "-f" || "$1" == "--firefox" ]] && updateFirefoxAddons
|