
#!/bin/sh -

# run as root 

# ar is a shortcut for addrepo,  
# -f is a shortcut for --refresh and this is AUTO-refresh 

# to know which packages come from a certain repo query with 
# zypper pa -r <repo> -i
# As a result, obtain a flag i or i+
# While the former means, that it is installed as a depencency, 
# the latter indicates explicit installation 



# Note that there seems to be no simple way to add a repository if not yet present. 
# Thus except at first run this script displays errors on repos already added. 

# codecs
# Higher priority because packman should be preferred over codecs in suse repos. 
zypper ar -p 90 https://ftp.fau.de/packman/suse/openSUSE_Tumbleweed/ Packman

# for opi wich in turn in needed for codecs (in fact no idea where opi gets its repos from)
#zypper addrepo https://download.opensuse.org/repositories/home:alveus:plex/openSUSE_Tumbleweed/home:alveus:plex.repo
# seems no longer working 

# for whatsapp 
# currently not used. 
#zypper ar -https://download.opensuse.org/repositories/home:plater/Tumbleweed/home:plater.repo
#zypper ar https://download.opensuse.org/repositories/network:im:whatsapp/openSUSE_Tumbleweed/network:im:whatsapp.repo
zypper ar https://download.opensuse.org/repositories/network:im:whatsapp/openSUSE_Tumbleweed/ WhatsApp

# for skype
#zypper addrepo https://download.opensuse.org/repositories/home:alveus:main/openSUSE_Tumbleweed/home:alveus:main.repo
#zypper addrepo https://repo.skype.com/rpm/stable/skype-stable.repo

# for hddtemp (diagnosis tool)
#zypper ar https://download.opensuse.org/repositories/home:netmax:distribution:openSUSE_Tumbleweed/openSUSE_Tumbleweed/home:netmax:distribution:openSUSE_Tumbleweed.repo

# for visual code
rpm --import https://packages.microsoft.com/keys/microsoft.asc
zypper ar https://packages.microsoft.com/yumrepos/vscode vscodeOrg
# for updates 
#echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\nautorefresh=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" |sudo tee /etc/zypp/repos.d/vscode.repo > /dev/null
zypper mr -k vscodeOrg

# codium
rpm --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg
zypper ar -f https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/rpms/ vscodium
# for updates 
#echo -e "[vscodium]\nname=vscodium\nbaseurl=https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/rpms/\nenabled=1\nautorefresh=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg" | sudo tee /etc/zypp/repos.d/vscodium.repo > /dev/null
zypper mr -k vscodium

# The suse version is preferred, also it is much smaller. 
# But at time of this writing, it does not work: problems with verification of signatures of extensions. 
#zypper ar https://download.opensuse.org/repositories/devel:/tools:/ide:/vscode/openSUSE_Tumbleweed vscode

# priority raised, because base repo offers partially the same packages but with older versions. 
# High priority prevents downgrade 
zypper ar -p 50 https://download.opensuse.org/repositories/Education/openSUSE_Tumbleweed/Education.repo

zypper ar https://download.opensuse.org/repositories/system:/snappy/openSUSE_Tumbleweed snappy


zypper --gpg-auto-import-keys refresh

## javafx, also needed for jabref

#zypper addrepo https://download.opensuse.org/repositories/home:fstrba:maven/openSUSE_Tumbleweed/home:fstrba:maven.repo


zypper ar https://pkg.jenkins.io/opensuse/ jenkins


# for google chrome 
zypper ar https://dl.google.com/linux/chrome/rpm/stable/x86_64 google-chrome

rpm --import https://dl.google.com/linux/linux_signing_key.pub
# if ! test linux_signing_key.pub ;
# then
#   wget -nc https://dl.google.com/linux/linux_signing_key.pub
# fi
# rpm --import linux_signing_key.pub



# for epstool only 
zypper ar https://download.opensuse.org/repositories/home:syntron/15.6/home:syntron.repo

# for julia, octave 
zypper ar https://download.opensuse.org/repositories/science/openSUSE_Tumbleweed/science.repo



# for scala 

#zypper addrepo https://download.opensuse.org/repositories/devel:/languages:/scala/openSUSE_Tumbleweed/ scala

# the following are no longer needed because they are replaced by according repos managed by the service openSUSE 
# like 
# http://cdn.opensuse.org/tumbleweed/repo/non-oss/
#zypper addrepo http://download.opensuse.org/tumbleweed/repo/non-oss/ openSUSE-Tumbleweed-Non-Oss
#zypper addrepo http://download.opensuse.org/tumbleweed/repo/oss/ openSUSE-Tumbleweed-Oss
#zypper addrepo http://download.opensuse.org/source/tumbleweed/repo/oss/ openSUSE-Tumbleweed-Source
#zypper addrepo http://download.opensuse.org/update/tumbleweed/ openSUSE-Tumbleweed-Update
#zypper addrepo -f http://codecs.opensuse.org/openh264/openSUSE_Tumbleweed repo-openh264
#zypper addrepo --refresh https://download.nvidia.com/opensuse/tumbleweed NVIDIA

# for stress-ng
zypper addrepo https://download.opensuse.org/repositories/benchmark/openSUSE_Tumbleweed/benchmark.repo




zypper refresh -f


