How to manually create an Android theme for Telegram

Telegram just released a new Android client version with support for themes. The app includes a theme editor, but it’s always nice to know how to make one without the app. So let’s see how to make our own full Telegram theme, in this case using a Linux shell (you can find the example theme on GitHub):

Theme contents

Telegram for Android uses a different file formats for themes than Telegram Desktop, so the old howtos don’t work.

You need two sets of data, color defintions and a background image. The background image is JPEG file, the color definitions seem to be mostly identical to the Telegram Desktop file format.

In my case I just start with the default color definitions and write them into a file called colors.tdesktop-theme:

avatar_backgroundViolet=-7436818
dialogRadioBackground=-5000269
chat_replyPanelClose=-5723992
checkboxCheck=-1
avatar_subtitleInProfilePink=-4990985
chat_recordedVoiceProgressInner=-1
chat_emojiPanelTrendingDescription=-7697782
player_actionBarSelector=788529152
chat_inFileBackground=-1314571
chat_messagePanelVoicePressed=-1
contextProgressOuter3=-1
chat_secretTimerText=-1
actionBarActionModeDefaultSelector=-986896
chat_inFileNameText=-11625772
chat_stickerReplyNameText=-1
chat_inLoader=-9259544
windowBackgroundGray=-986896
windowBackgroundWhiteGreenText2=-13129447
dialogCheckboxSquareDisabled=-5197648
featuredStickers_buttonProgress=-1
chat_inBubble=-1
chat_outLoaderSelected=-9783964
chat_secretTimeText=-1776928
chat_emojiPanelIcon=-5723992
chat_inContactBackground=-9259544
chat_mediaSentCheck=-1
chat_recordTime=-11711413
chat_selectedBackground=1714664933
windowBackgroundWhiteRedText6=-39322
fastScrollText=-1
player_actionBarTitle=-14606047
chats_sentError=-2796974
actionBarActionModeDefault=-1
chat_serviceLink=-1
dialogBackground=-1
avatar_backgroundGreen=-8992691
dialogCheckboxSquareBackground=-12345121
chat_inPreviewInstantText=-12940081
windowBackgroundWhiteGrayText5=-6052957
musicPicker_checkboxCheck=-1
picker_badgeText=-1
changephoneinfo_image=-5723992
player_progressBackground=419430400
chat_inVoiceSeekbar=-2169365
chat_mediaSentClock=-1
chat_outFileNameText=-11162801
chat_stickerReplyLine=-1
chat_outFileIcon=-8011912
avatar_actionBarIconViolet=-1
chat_messagePanelCancelInlineBot=-5395027
avatar_nameInMessageRed=-3516848
chat_topPanelLine=-9658414
windowBackgroundWhiteRedText=-3319206
chat_outLoaderPhotoIcon=-2427453
checkboxSquareUnchecked=-9211021
musicPicker_buttonIcon=-1
chat_outBubbleShadow=-14781172
actionBarDefaultSearch=-1
chat_inContactIcon=-1
actionBarDefaultSearchPlaceholder=-1996488705
chat_inLoaderPhotoSelected=-6113849
featuredStickers_delButton=-2533545
actionBarActionModeDefaultTop=-1728053248
avatar_subtitleInProfileCyan=-4660496
avatar_nameInMessageGreen=-11488718
player_placeholder=-2500135
chat_outAudioSeekbarFill=-8863118
chat_inReplyNameText=-12940081
chats_nameIcon=-14408668
graySection=-855310
avatar_backgroundCyan=-10502443
chat_inLocationBackground=-1314571
picker_disabledButton=-6710887
chat_replyPanelMessage=-14540254
chat_outPreviewInstantText=-11162801
chat_emojiPanelTrendingTitle=-14606047
chat_inPreviewInstantSelectedText=-13600331
chat_stickerNameText=-1
chat_inFileInfoSelectedText=-7752511
chats_unreadCounter=-11613090
windowBackgroundWhiteGrayText=-5723992
actionBarDefaultSubmenuBackground=-1
windowBackgroundWhiteGrayText3=-6710887
checkbox=-10567099
chat_outSentCheckSelected=-10637232
contextProgressInner1=-4202506
chat_outTimeSelectedText=-9391780
chat_outFileSelectedIcon=-8011912
chat_messagePanelSend=-10309397
avatar_actionBarIconOrange=-1
dialogIcon=-7697782
windowBackgroundWhiteBlueHeader=-12676913
windowBackgroundGrayShadow=-16777216
chat_mediaLoaderPhotoSelected=2130706432
listSelector=788529152
files_iconText=-1
avatar_backgroundInProfileOrange=-615071
chat_messagePanelBackground=-1
actionBarDefaultSubtitle=-2758409
login_progressOuter=-10313520
chat_serviceText=-1
chat_searchPanelIcons=-10639908
dialogRadioBackgroundChecked=-13129232
switchThumbChecked=-12211217
avatar_actionBarIconPink=-1
dialogLinkSelection=862104035
windowBackgroundWhiteInputField=-2368549
chats_verifiedBackground=-13391642
chat_outContactPhoneText=-13286860
chat_outAudioDurationText=-10112933
chat_inVenueInfoText=-6182221
chats_actionBackground=-9788978
chats_date=-6710887
stickers_menu=-4801083
chat_outAudioSeekbarSelected=-5644906
avatar_nameInMessagePink=-11627828
chat_mediaViews=-1
chat_inSiteNameText=-12940081
chat_inFileProgressSelected=-3413258
chat_topPanelMessage=-6710887
chat_outVenueInfoSelectedText=-10112933
location_sendLocationBackground=-9592620
chat_inInstant=-12940081
chat_inReplyMediaMessageSelectedText=-7752511
chat_outAudioDurationSelectedText=-10112933
chat_mediaLoaderPhotoIconSelected=-2500135
chats_actionPressedBackground=-11038014
profile_verifiedCheck=-11959368
chat_outViewsSelected=-9522601
sharedMedia_startStopLoadIcon=-13196562
windowBackgroundWhiteRedText3=-2995895
chat_emojiPanelBackground=-657673
actionBarDefaultTitle=-1
chat_inPreviewLine=-9390872
dialogTextBlue=-13660983
chat_inInstantSelected=-13600331
chat_recordedVoiceProgress=-6107400
avatar_actionBarSelectorCyan=-13007715
windowBackgroundWhiteGrayText4=-8355712
files_folderIconBackground=-986896
profile_verifiedBackground=-5056776
dialogTextLink=-14255946
chat_fieldOverlayText=-12940081
avatar_nameInMessageViolet=-11627828
chat_inForwardedNameText=-13072697
groupcreate_onlineText=-12545331
chat_inSentClock=-6182221
chat_inAudioSeekbarSelected=-4399384
chats_nameMessage=-11697229
contextProgressOuter2=-1
chats_menuBackground=-1
groupcreate_offlineText=-8156010
windowBackgroundWhiteGrayText8=-9605774
chats_sentErrorIcon=-1
chat_messagePanelHint=-5066062
contextProgressOuter1=-13920542
avatar_subtitleInProfileViolet=-3291923
chat_outAudioSelectedProgress=-2820676
dialogCheckboxSquareUnchecked=-9211021
chat_inSentClockSelected=-7094838
chat_inBubbleShadow=-14862509
chat_inFileInfoText=-6182221
windowBackgroundWhiteGrayIcon=-9211021
chat_sentError=-2411211
avatar_backgroundInProfileBlue=-11500111
player_progress=-14438417
chat_outInstantSelected=-12019389
chat_outLoaderPhotoIconSelected=-4134748
chat_gifSaveHintBackground=-871296751
avatar_actionBarIconCyan=-1
chat_outBroadcast=-12146122
chat_inLoaderPhotoIcon=-197380
windowBackgroundWhiteRedText5=-1229511
chat_mediaBroadcast=-1
chats_menuPhone=-1
chats_draft=-2274503
chats_unreadCounterText=-1
chat_inLocationIcon=-6113849
chat_lockIcon=-1
chat_outPreviewLine=-7812741
avatar_actionBarIconBlue=-1
chat_inMenu=-4801083
chat_emojiPanelMasksIcon=-1
chats_sentClock=-9061026
chat_recordedVoiceBackground=-11165981
chat_unreadMessagesStartText=-11102772
windowBackgroundWhiteGrayText6=-9079435
location_markerX=-8355712
inappPlayerClose=-5723992
windowBackgroundWhiteBlueText5=-11759926
chats_menuName=-1
chat_searchPanelText=-11625772
chat_inAudioProgress=-1
windowBackgroundWhiteHintText=-6842473
chat_outInstant=-11162801
chat_emojiPanelNewTrending=-11688214
chat_outReplyMessageText=-16777216
listSelectorSDK21=251658240
chat_inLoaderPhotoIconSelected=-1314571
windowBackgroundWhiteBlueText4=-11697229
chat_inContactNameText=-11625772
actionBarDefaultIcon=-1
chat_inlineResultIcon=-11037236
avatar_actionBarSelectorPink=-2863493
chat_outContactNameText=-11162801
avatar_backgroundInProfilePink=-819290
chats_menuPhoneCats=-4004353
featuredStickers_addedIcon=-11491093
profile_title=-1
chat_botKeyboardButtonBackgroundPressed=-3354156
profile_creatorIcon=-11888682
avatar_subtitleInProfileGreen=-4133446
windowBackgroundWhiteValueText=-13660983
avatar_backgroundActionBarRed=-3514282
chat_previewGameText=-1
avatar_backgroundActionBarOrange=-947900
avatar_actionBarSelectorOrange=-1674199
actionBarActionModeDefaultIcon=-9211021
chat_outVenueNameText=-11162801
emptyListPlaceholder=-6974059
chat_inFileProgress=-1314571
avatar_actionBarIconGreen=-1
chats_muteIcon=-5723992
groupcreate_spanText=-14606047
windowBackgroundWhiteBlackText=-14606047
avatar_backgroundActionBarCyan=-12283220
chat_topPanelClose=-5723992
player_buttonActive=-14438417
chat_outSentCheck=-10637232
chat_recordedVoiceDot=-2468275
chat_outReplyLine=-7812741
chat_messagePanelText=-16777216
inappPlayerPlayPause=-10309397
calls_callReceivedRedIcon=-47032
chat_messagePanelVoiceDuration=-1
chat_outVenueInfoText=-10112933
sharedMedia_linkPlaceholderText=-1
chat_outTimeText=-9391780
switchTrack=-3684409
avatar_subtitleInProfileOrange=-139832
profile_adminIcon=-8026747
login_progressInner=-1971470
avatar_backgroundBlue=-11232035
dialogTextGray=-13333567
chat_previewDurationText=-1
chat_secretTimerBackground=-868326258
chats_menuCloud=-1
windowBackgroundWhiteBlueText2=-13333567
chat_emojiPanelIconSelected=-13920542
radioBackgroundChecked=-13129232
chats_menuItemIcon=-9211021
featuredStickers_addButton=-11491093
chat_inTimeText=-6182221
checkboxSquareDisabled=-5197648
avatar_backgroundGroupCreateSpanBlue=-4204822
chat_emojiPanelBackspace=-5723992
chat_outPreviewInstantSelectedText=-12019389
chat_outFileInfoSelectedText=-10112933
chats_pinnedIcon=-5723992
chat_muteIcon=-5124893
chat_mediaMenu=-1
picker_badge=-14043401
chat_addContact=-11894091
chat_outMenu=-7221634
fastScrollInactive=-10263709
avatar_backgroundRed=-1743531
chat_emojiPanelShadowLine=-1907225
avatar_nameInMessageBlue=-11627828
chat_messagePanelVoiceDelete=-9211021
chat_botKeyboardButtonBackground=-1775639
chat_stickerReplyMessageText=-1
chat_outVoiceSeekbarSelected=-5644906
stickers_menuSelector=788529152
chat_outForwardedNameText=-11162801
chat_outFileProgressSelected=-3806041
player_button=-7697782
avatar_actionBarSelectorRed=-4437183
chat_mediaLoaderPhoto=1711276032
fastScrollActive=-11361317
switchThumb=-1184275
chat_goDownButtonCounter=-1
chats_tabletSelectedOverlay=251658240
chats_menuItemText=-12303292
divider=-2500135
chat_outViews=-9522601
groupcreate_sectionText=-8617336
avatar_actionBarSelectorBlue=-11959891
chats_actionMessage=-11697229
chat_inLoaderSelected=-10114080
groupcreate_spanBackground=-855310
chat_inVenueNameText=-11625772
chat_outLoaderPhoto=-8011912
chat_messageTextIn=-16777216
dialogInputField=-2368549
inappPlayerBackground=-1
player_actionBar=-1
chat_outFileInfoText=-10112933
chat_messagePanelShadow=-16777216
player_time=-15095832
chat_unreadMessagesStartArrowIcon=-6113849
groupcreate_sectionShadow=-16777216
chat_outAudioProgress=-1048610
chats_verifiedCheck=-1
chat_inMenuSelected=-6766130
chat_messageTextOut=-16777216
chat_outAudioTitleText=-11162801
inappPlayerPerformer=-13683656
chats_actionIcon=-1
profile_actionBackground=-1
groupcreate_checkboxCheck=-1
chat_outSentClockSelected=-9061026
dialogCheckboxSquareCheck=-1
musicPicker_checkbox=-14043401
chat_messagePanelVoiceShadow=218103808
avatar_backgroundInProfileCyan=-11099461
chat_messagePanelIcons=-5723992
actionBarWhiteSelector=788529152
contextProgressInner2=-4202506
avatar_backgroundActionBarViolet=-8557884
chat_emojiPanelIconSelector=-13920542
chat_mediaProgress=-1
avatar_subtitleInProfileRed=-406587
chat_sentErrorIcon=-1
chat_outLocationIcon=-7880840
chat_inAudioPerfomerText=-13683656
chat_messageLinkIn=-14255946
chats_attachMessage=-11697229
windowBackgroundWhiteBlueText6=-12940081
sessions_devicesImage=-6908266
chats_secretIcon=-15093466
chats_pinnedOverlay=134217728
chat_outAudioPerfomerText=-13286860
chat_outContactIcon=-1048610
featuredStickers_delButtonPressed=-3782327
actionBarDefaultSelector=-12554860
sharedMedia_linkPlaceholder=-986896
chat_emojiPanelEmptyText=-7829368
chat_inViews=-6182221
windowBackgroundWhiteBlueText3=-14255946
windowBackgroundWhiteGrayText7=-3750202
chat_botKeyboardButtonText=-13220017
chats_secretName=-16734706
chat_inReplyLine=-9390872
windowBackgroundWhiteRedText4=-3198928
avatar_backgroundOrange=-881592
chat_inReplyMessageText=-16777216
avatar_actionBarSelectorGreen=-12020419
windowBackgroundWhiteGrayLine=-2368549
chat_inAudioTitleText=-11625772
chat_inFileIcon=-6113849
chat_inAudioDurationSelectedText=-7752511
chat_outSentClock=-9061026
actionBarDefault=-11371101
dialogInputFieldActivated=-13129232
checkboxSquareCheck=-1
chat_goDownButton=-1
profile_actionPressedBackground=-855310
chat_inAudioSelectedProgress=-1902337
windowBackgroundWhiteLinkText=-14255946
windowBackgroundWhiteLinkSelection=862104035
chat_botButtonText=-1
chat_outSiteNameText=-11162801
chat_inBubbleSelected=-1902337
chat_outFileProgress=-2427453
chat_recordedVoicePlayPause=-1
chat_outBubbleSelected=-2820676
progressCircle=-11371101
contextProgressInner3=-5000269
chats_unreadCounterMuted=-3684409
radioBackground=-5000269
chat_outVoiceSeekbar=-4463700
chat_topPanelBackground=-1
dialogTextBlack=-14606047
chat_inVoiceSeekbarSelected=-4399384
player_actionBarItems=-7697782
files_folderIcon=-6710887
chat_inViewsSelected=-7094838
groupcreate_cursor=-11361317
avatar_backgroundActionBarGreen=-11099828
switchTrackChecked=-6236422
windowBackgroundWhiteGrayText2=-7697782
chat_inFileSelectedIcon=-7883067
profile_actionIcon=-9211021
chat_secretChatStatusText=-8421505
windowBackgroundWhiteRedText2=-2404015
chat_inVoiceSeekbarFill=-9259544
chat_unreadMessagesStartBackground=-1
chat_mediaTimeText=-1
avatar_backgroundActionBarBlue=-10907718
chat_inViaBotNameText=-12940081
avatar_nameInMessageOrange=-2589911
chat_outFileBackground=-2427453
chat_inLoaderPhoto=-6113080
location_sendLocationIcon=-1
chats_name=-14606047
chat_outBubble=-1048610
windowBackgroundWhite=-1
checkboxSquareBackground=-12345121
chat_replyPanelLine=-1513240
chat_inReplyMediaMessageText=-6182221
calls_callReceivedGreenIcon=-16725933
chat_outReplyMediaMessageText=-10112933
avatar_backgroundActionBarPink=-11762506
chat_outLoader=-8863118
chat_outReplyNameText=-11162801
chat_stickersHintPanel=-1
chat_inAudioSeekbar=-1774864
windowBackgroundWhiteBlueText7=-13141330
chat_inContactPhoneText=-13683656
chat_linkSelectBackground=862104035
chat_stickerViaBotNameText=-1
chat_recordVoiceCancel=-6710887
chat_textSelectBackground=1717742051
chat_outAudioSeekbar=-4463700
avatar_backgroundInProfileRed=-2592923
avatar_backgroundInProfileViolet=-7570990
avatar_actionBarSelectorViolet=-9216066
chat_outVoiceSeekbarFill=-8863118
chat_gifSaveHintText=-1
musicPicker_buttonBackground=-10702870
chat_messagePanelVoiceBackground=-11037236
chat_goDownButtonShadow=-16777216
actionBarDefaultSubmenuItem=-14606047
chats_sentCheck=-12146122
chat_replyPanelIcons=-11032346
player_seekBarBackground=-436207617
chat_mediaLoaderPhotoIcon=-1
featuredStickers_buttonText=-1
chat_messageLinkOut=-14255946
featuredStickers_addButtonPressed=-12346402
chat_botProgress=-1
chat_outFileBackgroundSelected=-3806041
groupcreate_hintText=-6182221
chat_outContactBackground=-8863118
chat_inAudioDurationText=-6182221
avatar_text=-1
chat_goDownButtonIcon=-5723992
chats_menuCloudBackgroundCats=-12420183
chat_recordedVoicePlayPausePressed=-2495749
groupcreate_checkbox=-10567099
avatar_backgroundInProfileGreen=-9981091
chat_topPanelTitle=-12940081
chat_outLoaderPhotoSelected=-8538000
player_actionBarSubtitle=-7697782
chat_mediaInfoText=-1
chat_emojiPanelStickerPackSelector=-1907225
chat_editDoneIcon=-11420173
picker_enabledButton=-15095832
windowBackgroundWhiteInputFieldActivated=-13129232
chat_replyPanelName=-12940081
chat_reportSpam=-3188393
avatar_actionBarIconRed=-1
avatar_backgroundPink=-887654
inappPlayerTitle=-13683656
chat_outViaBotNameText=-11162801
featuredStickers_unread=-11688214
player_actionBarTop=-1728053248
chat_inFileBackgroundSelected=-3413258
chat_inVenueInfoSelectedText=-7752511
chats_message=-7368817
avatar_subtitleInProfileBlue=-2626822
player_duration=-7697782
chat_emojiPanelMasksIconSelected=-10305560
chat_outLocationBackground=-2427453
chat_inAudioSeekbarFill=-9259544
windowBackgroundWhiteBlueText=-12876608
chat_goDownButtonCounterBackground=-11689240
chat_outReplyMediaMessageSelectedText=-10112933
chat_outMenuSelected=-7221634
windowBackgroundWhiteGreenText=-14248148
avatar_nameInMessageCyan=-12406360
chat_inTimeSelectedText=-7752511
chat_botSwitchToInlineText=-12348980

I will this background image and store it in background.jpg:

These two files have to be concatenated into a single file with the extension .attheme, but the string “WPS” has to be present between both contents, so I use cat and echo to do this:

$ cat colors.tdesktop-theme > sturmi.attheme
$ echo "WPS" >> sturmi.attheme
$ cat background.jpg >> sturmi.attheme

Now sturmi.attheme contains the whole theme.

Installation

I simply send the file to myself, download and open it. Telegram pops up a preview and lets me install the theme: