Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OleksiyRudenko/1a8ae5a97dbadcce6db5ec8c0c27316b to your computer and use it in GitHub Desktop.
Save OleksiyRudenko/1a8ae5a97dbadcce6db5ec8c0c27316b to your computer and use it in GitHub Desktop.
Add multiple accounts in Telegram Desktop [Linux | MacOSX | Windows]

How to add multiple accounts to Telegram Desktop

Table of Contents

Introduction

ATM of writing this, there is no way inside the Telegram Client to switch accounts (event though this feature exists in the offical mobile clients and there is a long running issue here: telegramdesktop/tdesktop#4261).

Thought the Official Telegram Desktop client has the feature to set the working directory with a command line argument - -workdir. This enables the use of multiple accounts.

In this guide I will show you a way to use this feature on MacOSX, Linux and Windows. We will be working with the -workdir argument provided by the client to create more instances.

❗ Everywhere I use {{...}} replace the wole thing with what is written in there. So eg. for me and my TG account @Nachtalb I replace {{MyUsername}} with Nachtalb.

Instructions

Linux

  • Create a folder here ~/.local/share/TelegramDesktop/{{MyUsername}}
  • Create a new .desktop file here ~/.local/share/applications/telegramdesktop-{{myusername}}.desktop.
  • Put in your data in here
[Desktop Entry]
Version=1.0
Name=Telegram MyUsername
Comment=Official desktop application for the Telegram messaging service
TryExec=/opt/Telegram/Telegram
Exec=/opt/Telegram/Telegram -workdir /home/{{your_user}}/.local/share/TelegramDesktop/{{MyUsername}} -- %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

OSX

  • Create a folder here: ~/.local/share/TelegramDesktop/{{MyUsername}}
  • Open Automator
  • Create a new Application

    image

  • Add an apple script by drag & drop from the left-hand side
  • Add the following text:
do shell script "Applications/Telegram.app/Contents/MacOS/Telegram -workdir '/Users/{{your_user}}/.local/share/TelegramDesktop/{{MyUsername}}'"

image

  • Save to /Applications/Telegram {{MyUsername}}.app
  • Now lastly if you want the have the same icon for your new app, open the file info of both apps (the original telegram and yours) with CMD + I and click on the icon in the top left of the original application. Hit copy CMD + C, click on yours and hit past CMD + V.

Windows

  • Create a folder here: C:\Users\{{your_user}}\AppData\Roaming\Telegram Desktop\{{MyUsername}}
  • Rightclick on your desktop and create a new shortcut
  • Put this in the location field
"C:\Users\{{your_user}}\AppData\Roaming\Telegram Desktop\Telegram.exe" -workdir "C:\Users\{{your_user}}\AppData\Roaming\Telegram Desktop\{{MyUsername}}"
  • Click next and type in a name for the shortcut, usually something like Telegram {{MyUsername}}
  • Lastly to find the application via the start menu you have to copy the link in here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment