Skip to content

Commit

Permalink
Merge pull request #22 from SpamixOfficial/dev
Browse files Browse the repository at this point in the history
Merging dev into main, v0.5 time!!!!
  • Loading branch information
SpamixOfficial authored Mar 31, 2023
2 parents 0cf6536 + e879d84 commit cbbb1e4
Show file tree
Hide file tree
Showing 13 changed files with 1,012 additions and 66 deletions.
127 changes: 120 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,26 @@ Thanks to the following persons for commiting to the project!
[![GitHub release](https://img.shields.io/github/release/SpamixOfficial/Openclick.svg)](https://GitHub.com/SpamixOfficial/Openclick/releases/)

Welcome to OpenClick!
OpenClick is an open source autoclicker for Debian and Arch based systems using **XORG**!
Currently it does not work on windows, but a fix is on the way!

**TO USE OPENCLICK WITH WINDOWS SUPPORT YOU'LL HAVE TO USE THE LATEST ALPHA VERSION, IN THIS CASE IT'S 0.4**
OpenClick is an open source autoclicker for Debian and Arch based systems!
Currently the only way you can run this autoclicker on Windows is by running the Module Edition (I'm going to fix this).

# LOOK HERE WAYLAND USERS!
The only way to run OpenClick on Wayland is by using Sudo. I've implemented a "feature" that checks for Wayland, and notifies you if you need to use it.

There are also a limited amount of application that can use openclick on wayland. **The only applications that can use Openclick on Wayland is the applications running xwayland**

# The 2 different editions (READ ME!)
There are 2 different editions/versions of this software.

Either you use the "Module" Edition, which consists of the install.py, the main.py and the manager.py file, or you run the "Full Edition". The "Module" Edition is cross-platform, since it works on Linux and Windows!

The "Full" Edition is the 2 files (main.py and manager.py) made into one file that's also installed as a command on your system. The "Full" Edition isn't cross-platform, it does not work on windows.

A fix is coming!

There are guides for both editions.


# Intro
So, what is an autoclicker?
Expand All @@ -26,6 +42,7 @@ Have fun :D
# Before you start...
Make sure you have python installed! Most linux distros comes with python out of the box, but check so its installed just in case it isn't!
Also make sure you have "pip" installed! Most linux distros comes with pip out of the box, but once again, check so its installed just in case it isn't!

## !IMPORTANT!
And lastly, make sure you have tKinter installed. It comes prebundled with python, though sometimes the module named "pynput" needs a manual installation of tKinter to work!
Here is how to install it. If you can't find your distro's way to install it here, then search the internet.
Expand All @@ -39,8 +56,28 @@ Here is how to install it. If you can't find your distro's way to install it her
sudo pacman -S tk
```


# How to install

**For Fedora based distros**
```
sudo dnf install python3-tkinter
```

## Fedora

On some distros the python3-devel package is not installed by default, and this package is needed for many python modules, which causes the installation to fail if the python3-devel package isn't installed. This issue can be resolved though by installing the python3-devel package.

**devel package**
```
sudo dnf install python3-devel
```

# How to install Module Edition
**Make sure you are in the right directory!**

## How to install
**(Wayland users use sudo)**

Step 1:
Run the installation script!
```
Expand All @@ -55,22 +92,95 @@ Step 2:
python3 main.py
```
You are done!
# How to use
## How to use
**(Wayland users use sudo)**

Use the command
```
python3 main.py
```
to run the script!
while in the correct folder to run the script!
Use the command
```
python3 manager.py --c
```
to open up the customization menu! (Tip! Use -h instead of --c to get the help menu instead!)
while in the correct folder to open up the customization menu! (Tip! Use -h instead of --c to get the help menu instead!)
If you want to customize the constant click delay, then use the command
```
python3 main.py -cd [value]
```
The default value is 0,5 seconds!


# How to install Full Edition
## How to install

**Make sure you are in the right directory!**

**You will need sudo access for this**

Step 1:
Install jq using your package manager.

For Ubuntu/Debian based distros.
```
sudo apt-get install jq
```
For Arch based distros:
```
sudo pacman -S jq
```
For Red-Hat based distros:
```
sudo dnf install jq
```
Step 2:
Chmod the scripts and run the installer.
```
chmod +x install.sh && chmod +x uninstall.sh && ./install.sh
```
Step 3:
When you get the message;
> Installation Success!
you can run the software using the command:
```
openclick
```
You are done!
## How to use
Use this command to run the software.
```
openclick
```

Use this command to open up the customization menu.
```
openclick --c
```
(Tip! Use -h instead of --c to get the help menu instead!)
If you want to customize the constant click delay, then use the command
```
openclick -cd [value]
```
The default value is 0,5 seconds!

If you want to update manually:
```
openclick -u
```
If you want to turn off auto updates:
```
openclick -u auto=False
```
If you want to turn on auto updates:
```
openclick -u auto=True
```

## IMPORTANT
I would advise you to turn auto updates off if you dont have a stable internet connection.

# Extra info
If you find any bugs, report them!
The project is written in python.
Expand All @@ -85,6 +195,9 @@ It doesn't work on MacOS and Fedora because of issues regarding a module named p
# To-do List!
- [X] Add customization
- [X] Add constant mode
- [X] Partial Add Windows support
- [X] Add auto updates
- [X] Add auto updates for all editions
- [ ] Add Windows support
- [ ] Create aur package
- [ ] (Maybe) Create deb package
Expand Down
96 changes: 61 additions & 35 deletions install.py
Original file line number Diff line number Diff line change
@@ -1,59 +1,83 @@
import os, json
import os, json, requests


#Easier way of checking if input was yes
#Instead of manually checking if user input string is "Y" etc., the programm will just check whether user input is in the array or not
#Adding ye as an valid option due to user typos
arr = {"yes", "y", "ye", ""}

#If the user input isnt in arr, it will just count as a no




installedPackeges = True
# loading json data
with open('settings.json') as f:
data = json.load(f)

# Setting version ID
idcheck = input("Is this the latest release? ([Y]es/[n]o): ").lower()

if idcheck in arr:
response = requests.get("https://api.github.com/repos/SpamixOfficial/OpenClick/releases/latest")
respdata = response.json()
relid = respdata["id"]
data['release']=str(relid)
else:
response = requests.get("https://api.github.com/repos/SpamixOfficial/OpenClick/tags")
respdata = json.loads(response.text)
print("\nReleases:")
for tag in respdata:
print(tag["name"])
idcheck2 = input("Enter the tag of the release: ")
response = requests.get("https://api.github.com/repos/SpamixOfficial/OpenClick/releases/tags/" + idcheck2)
if response.status_code == 404:
print("404 Error: Non-valid tag: " + idcheck2)
quit()
respdata = response.json()
relid = respdata["id"]
data['release']=str(relid)



# Module checking!




print("Checking for the modules on your system...")
## Checking if modules are installed and configuring settings.txt
try:
import colorama
print("Module \"colorama\" was found!")
# cresult = True
except ModuleNotFoundError:
print("The module named \"colorama\" wasn't found! Do you want to install it? (y/n)")
coloramainput = input().upper()
if coloramainput == "Y":
print("The module named \"colorama\" wasn't found! Do you want to install it? ([Y]es/[n]o)")
#Default option for no input = Yes
coloramainput = input().lower()
if coloramainput in arr:
os.system("pip install colorama")
# cresult = True
elif coloramainput == "N":
else:
installedPackeges = False
print("Then you need to install it. Read the instructions on the github page or read the README.md!")
else:
print("That wasn't a N or an Y.")
quit()


try:
import pynput
print("Module \"pynput\" was found!")
presult = True
except ModuleNotFoundError:
print("The module named \"pynput\" wasn't found! Do you want to install it? (y/n)")
pynputinput = input().upper()
if pynputinput == "Y":
print("The module named \"pynput\" wasn't found! Do you want to install it? ([Y]es/[N]o)")
pynputinput = input().lower()
if pynputinput in arr:
os.system("pip install pynput")
# presult = True
elif pynputinput == "N":
installedPackeges = False
print("Then you need to install it. Read the instructions on the github page or read the README.md!")
else:
print("That wasn't a N or an Y.")
quit()
#checking for flagser
try:
import flagser
print("Module \"flagser\" was found!")
presult = True
except ModuleNotFoundError:
print("The module named \"flagser\" wasn't found! Do you want to install it? (y/n)")
pynputinput = input().upper()
if pynputinput == "Y":
os.system("pip install flagser")
# presult = True
elif pynputinput == "N":
installedPackeges = False
print("Then you need to install it. Read the instructions on the github page or read the README.md!")
else:
print("That wasn't a N or an Y.")
quit()


if installedPackeges:
#f = open('./settings.txt','r')
Expand All @@ -70,15 +94,17 @@
# f.write(line)
#f.write("firststartup=true")
#f.close()
with open('settings.json') as f:
data = json.load(f)

data['firststartup']=True
with open('settings.json', 'w') as outfile:
json.dump(data, outfile,indent=4)
print("You are ready to go! \nPlease make sure you have tKinter installed manually. If it isn't installed then your can read the readme for examples on how to install it!\nRead the docs over at https://github.com/SpamixOfficial/OpenClick/blob/main/README.md for more information!")
print("You are ready to go!\n \nPlease make sure you have tKinter installed manually. If it isn't installed then you can read the readme for examples on how to install it!\nRead the docs over at https://github.com/SpamixOfficial/OpenClick/blob/main/README.md for more information!")


else:
print(Back.RED + "Sorry, but either one or both of the modules wasn't found. \n Read the instructions for help on how to install them!")
try:
print(Back.RED + "Sorry, but either one or both of the modules wasn't found. \n Read the instructions for help on how to install them!")
except:
print("Sorry, but either one or both of the modules wasn't found. \n Read the instructions for help on how to install them!")

quit()
25 changes: 25 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/bash
set -e

if [[ "$EUID" != 0 ]]; then
echo "Sudo was not enabled."

sudo -k
if sudo true; then
echo "Correct password, running installation."
else
echo "Wrong Password, exiting."
exit 1
fi
fi
pkgname="openclick"

python install.py || python3 install.py || echo 'Python is not installed, exiting...'

sudo install -Dm755 linux/cli.py /usr/bin/openclick
sudo install -Dm444 LICENSE "/usr/share/licenses/$pkgname/LICENSE"
sudo install -Dm444 README.md "/usr/share/doc/$pkgname/README.md"
sudo install -Dm666 settings.json "/etc/$pkgname/settings.json"

echo "Install Success!"
exit 0
Loading

0 comments on commit cbbb1e4

Please sign in to comment.