1
0
Fork 0
mirror of synced 2024-11-22 18:15:37 -05:00
garuda-common-settings/usr/bin/setup-assistant

322 lines
11 KiB
Text
Raw Normal View History

2020-11-11 08:58:21 -05:00
#!/bin/bash
2020-10-03 11:50:23 -04:00
function goto
{
label=$1
cmd=$(sed -n "/^:[[:blank:]][[:blank:]]*${label}/{:a;n;p;ba};" $0 |
grep -v ':$')
eval "$cmd"
exit
}
2020-11-11 08:58:21 -05:00
function upgrade2ultimate
{
rm -rf /tmp/setup-assistant
mkdir -p /tmp/setup-assistant
2020-10-27 08:02:51 -04:00
2020-11-11 08:58:21 -05:00
clear
if ! yad \
--image='font-manager' \
--title="Upgrade to ULTIMATE 👾" \
--geometry=700x100 \
--button=No:0 \
--button=Yes:1 \
--text-align=center \
--center \
--text "Do you need asian font support?"; then
echo "garuda-asian" >> /tmp/setup-assistant/pkgs.txt
2020-11-11 08:58:21 -05:00
fi
if ! yad \
--image='AppImageLauncher' \
--title="Upgrade to ULTIMATE 👾" \
--geometry=700x100 \
--button=No:0 \
--button=Yes:1 \
--text-align=center \
--center \
--text "What about Snaps, Flatpak and Appimage support?"; then
echo "sudo pacman -R pamac-aur pamac-tray-appindicator" >> /tmp/setup-assistant/prepare.sh
echo "pamac-all
appimagelauncher
fwupd
apparmor
snapd
snapd-glib
flatpak" >> /tmp/setup-assistant/pkgs.txt
echo "sudo systemctl enable --now snapd.socket" >> /tmp/setup-assistant/setup.sh
echo "sudo systemctl enable --now apparmor.service" >> /tmp/setup-assistant/setup.sh
echo "sudo systemctl enable --now snapd.apparmor.service" >> /tmp/setup-assistant/setup.sh
fi
2020-11-11 08:58:21 -05:00
if ! yad \
--image='pattern-games' \
--title="Upgrade to ULTIMATE 👾" \
--geometry=700x100 \
--button=No:0 \
--button=Yes:1 \
--text-align=center \
--center \
--text "Are you a gamer? The Garuda Gamer app will be installed for further configuration."; then
echo "garuda-gamer" >> /tmp/setup-assistant/pkgs.txt
echo "systemctl --user enable --now gamemoded >/dev/null 2>&1 &" >> /tmp/setup-assistant/setup.sh
echo "sudo setup_dxvk install 2>&1 &" >> /tmp/setup-assistant/setup.sh
fi
2020-11-11 08:58:21 -05:00
yad \
--image='org.pulseaudio.pavucontrol' \
--title="Upgrade to ULTIMATE 👾" \
--text "We have metapkgs for these audio systems:" \
--geometry=600x400 \
--list \
--checklist \
--column=Install \
--column=Software \
--center < /usr/lib/setup-assistant/audio.txt > /tmp/setup-assistant/audio.txt
if grep -R "PulseAudio" /tmp/setup-assistant/audio.txt; then
echo "garuda-pulse
pulseaudio-ctl
playerctl" >> /tmp/setup-assistant/pkgs.txt
echo "sudo systemctl enable --now bluetooth-autoconnect" >> /tmp/setup-assistant/setup.sh
echo "systemctl enable pulseaudio-bluetooth-autoconnect --user" >> /tmp/setup-assistant/setup.sh
2020-11-11 08:58:21 -05:00
fi
if grep -R "Alsa" /tmp/setup-assistant/audio.txt; then
echo "garuda-alsa" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Pipewire" /tmp/setup-assistant/audio.txt; then
echo "garuda-pipewire" >> /tmp/setup-assistant/pkgs.txt
fi
2020-11-11 08:58:21 -05:00
yad \
--image='cupsprinter' \
--title="Upgrade to ULTIMATE 👾" \
--text "We have metapkgs for these audio systems:" \
--geometry=600x400 \
--list \
--checklist \
--column=Install \
--column=Software \
--center < /usr/lib/setup-assistant/printing.txt > /tmp/setup-assistant/printing.txt
if grep -R "Printing" /tmp/setup-assistant/printing.txt; then
echo "garuda-printer" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Scanning" /tmp/setup-assistant/printing.txt; then
echo "garuda-scanner" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Samba" /tmp/setup-assistant/printing.txt; then
echo "garuda-settings-samba
system-config-samba" >> /tmp/setup-assistant/pkgs.txt
2020-11-11 08:58:21 -05:00
fi
yad \
--image='libreoffice-main' \
--title="Upgrade to ULTIMATE 👾" \
--text "There are a lot of office suites to choose from!" \
--geometry=600x400 \
--list \
--checklist \
--column=Install \
--column=Office \
--center < /usr/lib/setup-assistant/office.txt > /tmp/setup-assistant/office.txt
if grep -R "LibreOffice Fresh" /tmp/setup-assistant/office.txt; then
echo "libreoffice-fresh
libmythes" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "LibreOffice Still" /tmp/setup-assistant/office.txt; then
echo "libreoffice-still
libmythes" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "OnlyOffice" /tmp/setup-assistant/office.txt; then
echo "onlyoffice-bin" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "WPS Office" /tmp/setup-assistant/office.txt; then
echo "wps-office
wps-office-mime
ttf-wps-fonts" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Free Office" /tmp/setup-assistant/office.txt; then
echo "freeoffice" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Yozo Office" /tmp/setup-assistant/office.txt; then
echo "yozo-office
yozo-office-fonts" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Calligra Office" /tmp/setup-assistant/office.txt; then
echo "calligra" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Abiword" /tmp/setup-assistant/office.txt; then
echo "abiword" >> /tmp/setup-assistant/pkgs.txt
2020-11-11 08:58:21 -05:00
fi
2020-10-27 08:02:51 -04:00
yad \
--image='telegram-desktop' \
--title="Upgrade to ULTIMATE 👾" \
--text "Here are some desktop apps that might be useful to you:" \
--geometry=600x400 \
--list \
--checklist \
--column=Install \
--column=Applications \
--center < /usr/lib/setup-assistant/desktop-apps.txt > /tmp/setup-assistant/desktop-apps.txt
if grep -R "Telegram" /tmp/setup-assistant/desktop-apps.txt; then
echo "telegram-desktop" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Joplin" /tmp/setup-assistant/desktop-apps.txt; then
echo "joplin" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Murmur" /tmp/setup-assistant/desktop-apps.txt; then
echo "murmur" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Discord" /tmp/setup-assistant/desktop-apps.txt; then
echo "discord" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Twitch GUI" /tmp/setup-assistant/desktop-apps.txt; then
echo "streamlink-twitch-gui" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Syncthing-GTK" /tmp/setup-assistant/desktop-apps.txt; then
echo "syncthing-gtk" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Nextcloud-client" /tmp/setup-assistant/desktop-apps.txt; then
echo "nextcloud-client" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Firefox Bitwarden" /tmp/setup-assistant/desktop-apps.txt; then
echo "firefox-extension-bitwarden" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Firefox XDM" /tmp/setup-assistant/desktop-apps.txt; then
echo "firefox-extension-xdm-browser-monitor" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Fractal" /tmp/setup-assistant/desktop-apps.txt; then
echo "fractal" >> /tmp/setup-assistant/pkgs.txt
fi
yad \
--image='gimp' \
--title="Upgrade to ULTIMATE 👾" \
--text "What about multimedia software?" \
--geometry=600x400 \
--list \
--checklist \
--column=Install \
--column=Applications \
--center < /usr/lib/setup-assistant/multimedia.txt >> /tmp/setup-assistant/multimedia.txt
if grep -R "Converseen" /tmp/setup-assistant/multimedia.txt; then
echo "converseen" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Transmageddon" /tmp/setup-assistant/multimedia.txt; then
echo "transmageddon" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Soundconverter" /tmp/setup-assistant/multimedia.txt; then
echo "soundconverter" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Piviti" /tmp/setup-assistant/multimedia.txt; then
echo "piviti" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Kdenlive" /tmp/setup-assistant/multimedia.txt; then
echo "kdenlive" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Audacity" /tmp/setup-assistant/multimedia.txt; then
echo "audacity" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Easytag" /tmp/setup-assistant/multimedia.txt; then
echo "easytag" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "GIMP" /tmp/setup-assistant/multimedia.txt; then
echo "gimp" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Inkscape" /tmp/setup-assistant/multimedia.txt; then
echo "inkscape" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Blender" /tmp/setup-assistant/multimedia.txt; then
echo "blender" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Gcolor3" /tmp/setup-assistant/multimedia.txt; then
echo "gcolor3" >> /tmp/setup-assistant/pkgs.txt
fi
yad \
--image='virtualbox' \
--title="Upgrade to ULTIMATE 👾" \
--text "Are you rather a fan of Virtualbox or virt-manager?" \
--geometry=600x400 \
--list \
--checklist \
--column=Install \
--column=Applications \
--center < /usr/lib/setup-assistant/virtualisation.txt >> /tmp/setup-assistant/virtualisation.txt
if grep -R "Virtalbox" /tmp/setup-assistant/virtualisation.txt; then
echo "garuda-virtualbox" >> /tmp/setup-assistant/pkgs.txt
fi
if grep -R "Virt-manager" /tmp/setup-assistant/virtualisation.txt; then
echo "garuda-virt-manager" >> /tmp/setup-assistant/pkgs.txt
2020-11-11 08:58:21 -05:00
fi
2020-11-11 08:58:21 -05:00
clear
sh /tmp/setup-assistant/prepare.sh
cat /tmp/setup-assistant/pkgs.txt | sed '/^$/d;s/[[:blank:]]//g' > /tmp/setup-assistant/pkgs-install.txt
sudo pacman --needed -S - < /tmp/setup-assistant/pkgs-install.txt
sh /tmp/setup-assistant/setup.sh
rm -rf /tmp/setup-assistant
2020-11-11 08:58:21 -05:00
}
2020-10-27 08:02:51 -04:00
systemctl --user enable psd >/dev/null 2>&1 &
systemctl --user start psd >/dev/null 2>&1 &
libinput-gestures-setup autostart >/dev/null 2>&1 &
libinput-gestures-setup start >/dev/null 2>&1 &
2020-10-03 11:50:23 -04:00
: start
2020-11-11 08:58:21 -05:00
clear
2020-10-03 11:50:23 -04:00
echo "What do you want to do?"
echo ""
echo "1) Get initial mirrorlist & download list of packages"
2020-11-11 08:58:21 -05:00
echo "2) Update the system"
2020-11-10 13:53:33 -05:00
echo "3) Enable systemwide adblocking / HiDPI mode"
echo "4) Disable CPU migitations / change boot options"
2020-11-11 08:58:21 -05:00
echo "5) Install additional (Ultimate) packages by choosing which ones you need"
2020-10-03 11:50:23 -04:00
echo ""
2020-11-11 08:58:21 -05:00
echo "6) Exit"
2020-10-03 11:50:23 -04:00
read selection
if [ $selection = "1" ]; then
2020-11-10 13:53:33 -05:00
clear
2020-11-10 14:04:01 -05:00
echo "Select the right mirrors in Reflector Simple!"
echo "If no mirrors were found select german servers. ☝🏻"
2020-10-03 11:50:23 -04:00
reflector-simple >/dev/null 2>&1
sudo pacman -Syy
goto "start"
elif [ $selection = "2" ]; then
2020-11-10 13:53:33 -05:00
clear
2020-10-03 11:50:23 -04:00
sudo pacman -Syu
goto "start"
2020-11-10 13:53:33 -05:00
elif [ $selection = "3" ]; then
clear
2020-10-06 09:42:47 -04:00
echo "Find it in the settings tab. 🖥"
2020-10-03 11:50:23 -04:00
garuda-welcome >/dev/null 2>&1
goto "start"
2020-11-10 13:53:33 -05:00
elif [ $selection = "4" ]; then
clear
2020-11-10 14:04:01 -05:00
echo "Disabling CPU mitiations increases performance but can possibly lead to security issues."
2020-10-06 09:42:47 -04:00
echo "Use it with caution! 🛑"
sudo garuda-boot-options >/dev/null 2>&1
2020-10-03 11:50:23 -04:00
goto "start"
2020-11-10 13:53:33 -05:00
elif [ $selection = "5" ]; then
2020-11-11 08:58:21 -05:00
upgrade2ultimate
elif [ $selection = "6" ]; then
2020-10-03 11:50:23 -04:00
exit
else "Thats not a valid choice! ❌"
2020-10-03 11:50:23 -04:00
goto "start"
fi