Last active
May 11, 2022 06:56
-
-
Save ssaki/ce074aae9079c133e608 to your computer and use it in GitHub Desktop.
Script to setup a secondary skype on a Ubuntu/Mint box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# A simple script to create a skype launcher | |
# that will pass alternative data home directory | |
# thus making it easy to run two Skype instances alongside | |
# | |
# Tesed on Mint 18 | |
# Requires the latest skypeforlinux.deb (v.8) from Microsoft | |
SUFFIX='secondary' | |
# Ensure that Skype is actualy installed | |
if [ $(dpkg-query -W -f='${Status}\n' skypeforlinux 2>/dev/null | grep -c "ok installed") -eq 0 ]; then | |
# https://go.skype.com/skypeforlinux-64.deb | |
echo 'Please download the latest skype package from Microsoft and install it! Then rexecute the script' | |
exit | |
fi | |
SKYPE_BIN=`which skypeforlinux` | |
# Secondary Skype's data dir | |
SECONDARY_HOME=~/".Skype-${SUFFIX}" | |
mkdir -p $SECONDARY_HOME | |
# Create an "executable" for a second Skype instance with a different database | |
SECONDARY_BIN="/usr/local/bin/skype-${SUFFIX}.sh" | |
USER=`whoami` | |
sudo touch $SECONDARY_BIN | |
sudo chown $USER:root $SECONDARY_BIN | |
chmod u+w,+x $SECONDARY_BIN | |
cat <<EOF > $SECONDARY_BIN | |
#!/bin/sh | |
if [ ! -d "$SECONDARY_HOME" ]; then | |
mkdir -p $SECONDARY_HOME | |
fi | |
$SKYPE_BIN --secondary --datapath=$SECONDARY_HOME & | |
EOF | |
# Create an application shortcut for the secondary skype | |
SECONDARY_DESKTOP="/usr/share/applications/skype-${SUFFIX}.desktop" | |
sudo touch $SECONDARY_DESKTOP | |
sudo chown $USER:root $SECONDARY_DESKTOP | |
cat <<EOF > $SECONDARY_DESKTOP | |
[Desktop Entry] | |
Name=Skype ${SUFFIX} | |
Comment=Skype Internet Telephony | |
Exec=$SECONDARY_BIN | |
Icon=skypeforlinux | |
Terminal=false | |
Type=Application | |
Encoding=UTF-8 | |
Categories=Network;Application; | |
MimeType=x-scheme-handler/skype; | |
X-KDE-Protocols=skype | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment