Skip to content

Service that automatically changes your telegram avatar during the day.

License

Notifications You must be signed in to change notification settings

GenZmeY/TG-Avatar-Alteration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TG-Avatar-Alteration

Service that automatically changes your telegram avatar during the day.

Description

The service is a small python3 script (and config for it) that changes the avatar and systemd timer that is configured to run this script every minute.

For the initial session setup, a bash wrapper for the python script is used.

Requirements

Any OS from the list:

  • RHEL7;
  • RHEL8;
  • CentOS7;
  • CentOS8.

Install

  1. Download the rpm package for your operating system or build it yourself;
  2. Copy it to the target system;
  3. Install the package:
    yum install <rpm_filename> # RHEL7/CentOS7
    or
    dnf install <rpm_filename> # RHEL8/CentOS8

Build (manual)

  1. Install build dependencies:
    yum install git rpm-build # RHEL7/CentOS7
    or
    dnf install git rpm-build # RHEL8/CentOS8
  2. Download sources:
    git clone https://github.com/GenZmeY/TG-Avatar-Alteration ~/rpmbuild
  3. Build packages:
    rpmbuild ~/rpmbuild/SPECS/tg-avatar-alteration.spec
  4. The source package will be here:
    ~/rpmbuild/SRPMS/
    The installation package will be here:
    ~/rpmbuild/RPMS/noarch/

Setup & Usage

  1. Open config /etc/tg-avatar-alteration/config.py and edit it:
  2. Get API_ID and API_HASH here, add them to config.
  3. Change PHONE to your phone number (you will receive a confirmation code to this number during the initial session setup).
  4. Change TIMEZONE to your timezone.
  5. Change IMG_DIR to the directory where your avatars will be located.
  6. In the IMG_EXT parameter, specify the extension for your avatar files.
  7. Put 1440 images (one picture for every minute) to the directory you previously specified in IMG_DIR. Images must have names in the range 0000 - 1339 (eg 0000.png, 0001.png, etc). 0000 corresponds to the first minute of the day, 0001 corresponds to the second minute of the day, and so on.
  8. If you need to adjust the display time, you can use the OFFSET parameter in the config. It is added to the file index. For example, if you want the image 0060 to be displayed instead of 0000 in the first minute of the day, you need to set OFFSET="60".
  9. Run the tg-avatar-alteration command to establish a session.
  10. Start a timer that will change your avatar every minute:
    sudo systemctl start tg-avatar-alteration.timer
  11. If you need the timer to work after a reboot, enable it:
    sudo systemctl enable tg-avatar-alteration.timer

Now you can turn your avatar into something like this:

License

GNU GPLv3

About

Service that automatically changes your telegram avatar during the day.

Resources

License

Stars

Watchers

Forks