Introduction
KeymouseGo is a open source software based on python, which can imitate the operation on mouse and keyboard. This article will introduce how to install it and start up it on Ubuntu according to github/taojy123/KeymouseGo.
Installation
Clone the project from github and
pip install -r requirements-universal.txt
pip install pyinstaller
pyinstaller -F -w --add-data "./assets:assets" KeymouseGo.py
In this project, it uses requirements-universal.txt to configure the rely packages instead of the .toml file, which can be directly recognized by pip. It is mainly because the rely packages varies from Windows to Linux. The file used as the parameter of pip install -r has a requirement on its format. For example, the code below is the requirements-universal.txt
# Python3.10
pynput==1.7.6
pyperclip==1.8.0
pyautogui==0.9.53
future==0.18.3
PySide6==6.4.3
qt-material==2.11
loguru==0.6.0
In this file it mainly use the format
PackageName==Version
however, there are some other formats which can describe more circumstances
PackageNmae==Version1-Version2
PackageName>=Version1,<Version2
After installing the rely packages, the project instructs us to use pyinstaller to build this project to one file. According to the documentation of pyinstaller, -F indicates Build to One File, -w indicates the project will be built as a windowed executable, which means that the executable will have a graphical user interface (GUI) and can be run on a machine without a console. To use this mode, your Python script should use a GUI framework that is compatible with PyInstaller, such as Tkinter, PyQt, and wxPython. Then it comes to --add-data, which is used to add the files not under this folder to the project, however, the example added ./assets and assets, which is under the path (I tested without --add-data and found nothing wrong). To be mentioned, in the Windows system and Linux system, we use ; and : respectively to identify various additional paths.
Start Up
To start up this project, according to the instruction, we have two methods.
GUI Mode
To open KeumouseGo in GUI mode, enter the code below in the current directory
python KeymouseGo.py
The name of the file is directly linked with the file name we typed after pyinstaller -w, which is the specific file for the GUI mode. Therefore, if we don't use -w mode, we don't need to enter the file name.
Command Line Mode
To execute the script with the terminal, enter the code below the current directory
./dist/KeymouseGo script
With --runtimes/-rt, we can repeat the script for n times. With -speed/-sp, we can set the speed as n%. With --module/-m, we can set the personal extension.