From c95de587df08ace43b75c3cbb60dfad6f707c4da Mon Sep 17 00:00:00 2001 From: mollusk Date: Sun, 31 Dec 2017 04:33:54 -0700 Subject: [PATCH] Added: teamviewer-installer.sh --- teamviewer-installer.sh | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 teamviewer-installer.sh diff --git a/teamviewer-installer.sh b/teamviewer-installer.sh new file mode 100755 index 0000000..b4a7478 --- /dev/null +++ b/teamviewer-installer.sh @@ -0,0 +1,62 @@ +#!/bin/bash + + +pkgname="teamviewer" +arch="amd64" +deps="wget xz hicolor-icon-theme qt5-declarative qt5-quickcontrols qt5-webkit qt5-x11extras" +src="https://download.${pkgname}.com/download/linux/${pkgname}_${arch}.tar.xz" +installdir="/home/${USER}/.teamviewer" + +prepare_(){ + echo "Preparing directories..." + if [ ! -d ${installdir} ];then + mkdir -pv ${installdir} + fi +} + +deps_(){ + echo "Installing dependencies..." + sudo xbps-install -Sy ${deps} +} + +download_(){ + echo "Downloading source file..." + if [ ! -f /tmp/${pkgname}_${arch}.tar.xz ];then + wget ${src} -P /tmp + fi +} + +extract_(){ + echo "Extracting archive..." + if [ -f /tmp/${pkgname}_${arch}.tar.xz ];then + tar -xvf /tmp/${pkgname}_${arch}.tar.xz -C ${installdir} + fi +} + +install_(){ + echo "Installing desktop file..." + sudo cp ${installdir}/${pkgname}/${pkgname}.desktop /usr/share/applications/ + echo "Linking binaries..." + sudo ln -s ${installdir}/${pkgname}/tv_bin/script/${pkgname} /usr/bin/${pkgname} + sudo ln -s ${installdir}/${pkgname}/tv_bin/${pkgname}d /usr/bin/${pkgname}d + echo +} + +init_(){ + echo "Launching Teamviewer to create desktop file..." + ${installdir}/${pkgname}/${pkgname} & + +} + +finished_(){ + echo "All finished! Look for the desktop icon in your applications menu." + +} + +prepare_ +deps_ +download_ +extract_ +init_ +install_ +finished_ \ No newline at end of file