solbuilds/setup-solus.sh
2018-02-02 16:23:36 +01:00

68 lines
2.2 KiB
Bash

#!/bin/bash
if [[ $EUID -ne 0 ]] || [ -z ${SUDO_USER+x} ]; then
echo "This script must be run as sudo under your main user" 1>&2
exit 1
fi
cd
eopkg up -y
snap install spotify
eopkg it -c system.devel -y
eopkg it xrdb zsh git git-lfs telegram htop etcher golang zip unzip cava neofetch aria2 acpi ncmpcpp rxvt-unicode vim epson-inkjet-printer-escpr flatpak texlive-all solbuild pip discord -y
sudo -u $SUDO_USER git lfs install
eopkg lr | grep solbuilds -q
if [[ $? -ne 1 ]]; then
eopkg rr solbuilds
fi
eopkg ar solus.sh https://repo.solus.sh/eopkg-index.xml.xz
eopkg er solus.sh
eopkg it chrome cli-visualizer dotnet-sdk geogebra insync jetbrains-toolbox libspotify libspotify-devel sublime-text-dev xarchiver -y
if [[ ! -f "/usr/bin/vis-real" ]]; then
mv /usr/bin/vis /usr/bin/vis-real
echo '#!/bin/bash' > /usr/bin/vis
echo 'xrdb -load ~/.Xresources' >> /usr/bin/vis
echo 'bash -c "urxvt -e ~/.vis.sh" &' >> /usr/bin/vis
fi
if [[ $? == 1 ]]; then
solbuild init
solbuild update
else
solbuild update
fi
pip install mopidy mopidy-spotify mopidy-spotify-web mopidy-iris
sudo -u $SUDO_USER flatpak install --user --from https://download.mono-project.com/repo/monodevelop.flatpakref -y
if [[ ! -f /home/$SUDO_USER/".dotfiles_installed" ]]; then
wget https://solus.sh/dotfiles.zip -O /tmp/dotfiles.zip
unzip -o /tmp/dotfiles.zip -d /home/$SUDO_USER/
touch /home/$SUDO_USER/".dotfiles_installed"
fi
sudo -u $SUDO_USER bash -c "$(curl -fsSL solus.sh/solus-ohmyz.sh)"
cat /home/$SUDO_USER/.zshrc | grep transfer.sh -q
if [[ $? -ne 0 ]]; then
curl -fsSL https://gist.githubusercontent.com/anonymous/c2a9e0ea86b5fb9c7971182f461e33e4/raw/567a15b8491cb9106c53835c731e583d3b12d7b5/gistfile1.txt >> /home/$SUDO_USER/.zshrc
fi
cat /home/$SUDO_USER/.zshrc | grep "alias gst=" -q
if [[ $? -ne 0 ]]; then
printf "\n" >> .zshrc
echo "alias gst='git status'" >> /home/$SUDO_USER/.zshrc
echo "alias gad='git add'" >> /home/$SUDO_USER/.zshrc
echo "alias gcm='git commit'" >> /home/$SUDO_USER/.zshrc
echo "alias gcmm='git commit -m'" >> /home/$SUDO_USER/.zshrc
echo "alias gps='git push'" >> /home/$SUDO_USER/.zshrc
echo "alias gpl='git pull'" >> /home/$SUDO_USER/.zshrc
echo "alias grm='git rm'" >> /home/$SUDO_USER/.zshrc
fi