Skip to content

Latest commit

 

History

History
96 lines (68 loc) · 4.03 KB

README.md

File metadata and controls

96 lines (68 loc) · 4.03 KB

💻 TyRemote

Python3 Version 1.0.0

TyRemote (Telegram + Python + Remote) is a remote control tool for laptops. It allows you to control your PC with a Telegram Bot. You can:

  • shut down
  • sleep 💤
  • get location 📌
  • controls the multimedia (volume, play, pause, ...) 🎵
  • take webcam photo 📷
  • take a screenshot 💻
  • lock/unlock 🔓
  • and check your PC status

It is compatible with Windows and Linux. Note that I built this program for personal purposes, may not be compatible with all Linux distributions. See later the VirtualPC section.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

Clone this repository and run this command to install all dependencies

$ pipenv install --ignore-pipfile

It requires that on Linux you have "iwlist", "iw" and "awk" installed. And on Windows "WifiInfoView.exe" (see below).

Besides, it is required to have installed the dependencies related to the implementation of VirtualPC.

Installing

First, you create a new Here API key by following these steps.

Next, create a new .env file with the format:

TYR_HERE_API_KEY=<YOUR_HERE_NETWORK_POSITION_API_KEY>
TYR_TELEGRAM_BOT_TOKEN=<YOUR_TELEGRAM_BOT_TOKEN>
TYR_TELEGRAM_USER_ID=<YOUR_TELEGRAM_USER_ID>

Last, you need to create a cron that runs the TyRemote.py script with administrator privileges when starting the laptop.

TODOs

I want to add 🤔 the next functionalities to TyRemote:

  • Full Windows compatibility
  • Upload and download files from Laptop
  • File system navigation
  • Record a video from the webcam
  • Run CLI commands

Built With

TyRemote uses the next dependencies:

  • pyTelegramBotAPI (see here)
  • python-dotenv
  • requests
  • pyautogui
  • opencv-python
  • psutil
  • iwlist.py (see here). It is included with the source code in this repository.

And it is built-in Python 3.

About

Telegram Bot

TyRemote requires a Telegram Bot to works. You can create one by following the steps below. Further, it is necessary to know your Telegram chat' id, for this you can use bot @getmyid_bot.

Localization

To locate your laptop TyRemote uses the Wi-Fi networks and/or the public IP. It first scans all nearby networks and sends this to the HERE Network Positioning API v1 to get an approximate location. If it fails, locates the PC using ip-api.

Note: In Linux the program uses iwlist that require root permissions.

VirtualPC

For some commands like shutdown, their implementation is different on Windows and Linux. To facilitate its implementations, I created the VirtualPC class that defines the methods that you must implement to achieve compatibility with your system. Currently, the program has an implementation for Xubuntu using:

  • amixer to control volume
  • xdotool to control multimedia
  • systemctl to shutdown and sleep.

WifiInfoView

In windows, to get Wi-Fi networks TyRemote uses WifiInfoView.exe. You can download it from here and copy it.

Contributing

I am not currently aiming to achieve a professional tool, this is only for simple uses, but this does not limit you to contribute by submitting pull requests for improvements and bug fixes.

License

This project is licensed under the MIT License - see the LICENSE.md file for details. It does not include the file iwlist.py of the repository that does not specify a license.