Skip to content

Instantly share code, notes, and snippets.

@squizduos
Forked from David256/multiTelegram.sh
Last active November 25, 2019 18:46
Show Gist options
  • Save squizduos/15a62364853fba0845ca9596d33092b0 to your computer and use it in GitHub Desktop.
Save squizduos/15a62364853fba0845ca9596d33092b0 to your computer and use it in GitHub Desktop.
A bash script to multiple accounts with Telegram GNU/Linux
#!/bin/bash
# Usage:
# $ ./multiTelegram myUSERNAME
TELEGRAM_BIN="/usr/bin/telegram-desktop"
TELEGRAM_DIR_RAW=$HOME"/.multiTelegram"
if [ ! -z $1 ]
then
WORKDIR="$TELEGRAM_DIR_RAW/$1"
echo "Launching instance $1 with working directory $WORKDIR"
if [ ! -d $WORKDIR ]
then
echo "Working directory $WORKDIR does not exist and will be created before start."
mkdir -p $WORKDIR
fi
$TELEGRAM_BIN -many -workdir "$WORKDIR"
else
echo "Launching default Telegram instance"
$TELEGRAM_BIN
fi
[Desktop Entry]
Version=1.0
Name=Telegram @${USERNAME}
Comment=Official desktop application for the Telegram messaging service
TryExec=${TELEGRAM_BIN}
Exec=${TELEGRAM_BIN} -workdir ${WORKDIR} -- %u
Icon=telegram
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
Categories=Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;
Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;
X-GNOME-UsesNotifications=true
X-Desktop-File-Install-Version=0.23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment