Skip to content

Commit cbbb1e4

Browse files
Merge pull request #22 from SpamixOfficial/dev
Merging dev into main, v0.5 time!!!!
2 parents 0cf6536 + e879d84 commit cbbb1e4

File tree

13 files changed

+1012
-66
lines changed

13 files changed

+1012
-66
lines changed

README.md

Lines changed: 120 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,26 @@ Thanks to the following persons for commiting to the project!
99
[![GitHub release](https://img.shields.io/github/release/SpamixOfficial/Openclick.svg)](https://GitHub.com/SpamixOfficial/Openclick/releases/)
1010

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

15-
**TO USE OPENCLICK WITH WINDOWS SUPPORT YOU'LL HAVE TO USE THE LATEST ALPHA VERSION, IN THIS CASE IT'S 0.4**
13+
OpenClick is an open source autoclicker for Debian and Arch based systems!
14+
Currently the only way you can run this autoclicker on Windows is by running the Module Edition (I'm going to fix this).
15+
16+
# LOOK HERE WAYLAND USERS!
17+
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.
18+
19+
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**
20+
21+
# The 2 different editions (READ ME!)
22+
There are 2 different editions/versions of this software.
23+
24+
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!
25+
26+
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.
27+
28+
A fix is coming!
29+
30+
There are guides for both editions.
31+
1632

1733
# Intro
1834
So, what is an autoclicker?
@@ -26,6 +42,7 @@ Have fun :D
2642
# Before you start...
2743
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!
2844
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!
45+
2946
## !IMPORTANT!
3047
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!
3148
Here is how to install it. If you can't find your distro's way to install it here, then search the internet.
@@ -39,8 +56,28 @@ Here is how to install it. If you can't find your distro's way to install it her
3956
sudo pacman -S tk
4057
```
4158

42-
4359
# How to install
60+
61+
**For Fedora based distros**
62+
```
63+
sudo dnf install python3-tkinter
64+
```
65+
66+
## Fedora
67+
68+
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.
69+
70+
**devel package**
71+
```
72+
sudo dnf install python3-devel
73+
```
74+
75+
# How to install Module Edition
76+
**Make sure you are in the right directory!**
77+
78+
## How to install
79+
**(Wayland users use sudo)**
80+
4481
Step 1:
4582
Run the installation script!
4683
```
@@ -55,22 +92,95 @@ Step 2:
5592
python3 main.py
5693
```
5794
You are done!
58-
# How to use
95+
## How to use
96+
**(Wayland users use sudo)**
97+
5998
Use the command
6099
```
61100
python3 main.py
62101
```
63-
to run the script!
102+
while in the correct folder to run the script!
64103
Use the command
65104
```
66105
python3 manager.py --c
67106
```
68-
to open up the customization menu! (Tip! Use -h instead of --c to get the help menu instead!)
107+
while in the correct folder to open up the customization menu! (Tip! Use -h instead of --c to get the help menu instead!)
69108
If you want to customize the constant click delay, then use the command
70109
```
71110
python3 main.py -cd [value]
72111
```
73112
The default value is 0,5 seconds!
113+
114+
115+
# How to install Full Edition
116+
## How to install
117+
118+
**Make sure you are in the right directory!**
119+
120+
**You will need sudo access for this**
121+
122+
Step 1:
123+
Install jq using your package manager.
124+
125+
For Ubuntu/Debian based distros.
126+
```
127+
sudo apt-get install jq
128+
```
129+
For Arch based distros:
130+
```
131+
sudo pacman -S jq
132+
```
133+
For Red-Hat based distros:
134+
```
135+
sudo dnf install jq
136+
```
137+
Step 2:
138+
Chmod the scripts and run the installer.
139+
```
140+
chmod +x install.sh && chmod +x uninstall.sh && ./install.sh
141+
```
142+
Step 3:
143+
When you get the message;
144+
> Installation Success!
145+
146+
you can run the software using the command:
147+
```
148+
openclick
149+
```
150+
You are done!
151+
## How to use
152+
Use this command to run the software.
153+
```
154+
openclick
155+
```
156+
157+
Use this command to open up the customization menu.
158+
```
159+
openclick --c
160+
```
161+
(Tip! Use -h instead of --c to get the help menu instead!)
162+
If you want to customize the constant click delay, then use the command
163+
```
164+
openclick -cd [value]
165+
```
166+
The default value is 0,5 seconds!
167+
168+
If you want to update manually:
169+
```
170+
openclick -u
171+
```
172+
If you want to turn off auto updates:
173+
```
174+
openclick -u auto=False
175+
```
176+
If you want to turn on auto updates:
177+
```
178+
openclick -u auto=True
179+
```
180+
181+
## IMPORTANT
182+
I would advise you to turn auto updates off if you dont have a stable internet connection.
183+
74184
# Extra info
75185
If you find any bugs, report them!
76186
The project is written in python.
@@ -85,6 +195,9 @@ It doesn't work on MacOS and Fedora because of issues regarding a module named p
85195
# To-do List!
86196
- [X] Add customization
87197
- [X] Add constant mode
198+
- [X] Partial Add Windows support
199+
- [X] Add auto updates
200+
- [X] Add auto updates for all editions
88201
- [ ] Add Windows support
89202
- [ ] Create aur package
90203
- [ ] (Maybe) Create deb package

install.py

Lines changed: 61 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,83 @@
1-
import os, json
1+
import os, json, requests
2+
3+
4+
#Easier way of checking if input was yes
5+
#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
6+
#Adding ye as an valid option due to user typos
7+
arr = {"yes", "y", "ye", ""}
8+
9+
#If the user input isnt in arr, it will just count as a no
10+
11+
12+
13+
214
installedPackeges = True
15+
# loading json data
16+
with open('settings.json') as f:
17+
data = json.load(f)
18+
19+
# Setting version ID
20+
idcheck = input("Is this the latest release? ([Y]es/[n]o): ").lower()
21+
22+
if idcheck in arr:
23+
response = requests.get("https://api.github.com/repos/SpamixOfficial/OpenClick/releases/latest")
24+
respdata = response.json()
25+
relid = respdata["id"]
26+
data['release']=str(relid)
27+
else:
28+
response = requests.get("https://api.github.com/repos/SpamixOfficial/OpenClick/tags")
29+
respdata = json.loads(response.text)
30+
print("\nReleases:")
31+
for tag in respdata:
32+
print(tag["name"])
33+
idcheck2 = input("Enter the tag of the release: ")
34+
response = requests.get("https://api.github.com/repos/SpamixOfficial/OpenClick/releases/tags/" + idcheck2)
35+
if response.status_code == 404:
36+
print("404 Error: Non-valid tag: " + idcheck2)
37+
quit()
38+
respdata = response.json()
39+
relid = respdata["id"]
40+
data['release']=str(relid)
41+
42+
43+
344
# Module checking!
445

46+
47+
48+
549
print("Checking for the modules on your system...")
650
## Checking if modules are installed and configuring settings.txt
751
try:
852
import colorama
953
print("Module \"colorama\" was found!")
1054
# cresult = True
1155
except ModuleNotFoundError:
12-
print("The module named \"colorama\" wasn't found! Do you want to install it? (y/n)")
13-
coloramainput = input().upper()
14-
if coloramainput == "Y":
56+
print("The module named \"colorama\" wasn't found! Do you want to install it? ([Y]es/[n]o)")
57+
#Default option for no input = Yes
58+
coloramainput = input().lower()
59+
if coloramainput in arr:
1560
os.system("pip install colorama")
1661
# cresult = True
17-
elif coloramainput == "N":
62+
else:
1863
installedPackeges = False
1964
print("Then you need to install it. Read the instructions on the github page or read the README.md!")
20-
else:
21-
print("That wasn't a N or an Y.")
22-
quit()
65+
2366

2467
try:
2568
import pynput
2669
print("Module \"pynput\" was found!")
2770
presult = True
2871
except ModuleNotFoundError:
29-
print("The module named \"pynput\" wasn't found! Do you want to install it? (y/n)")
30-
pynputinput = input().upper()
31-
if pynputinput == "Y":
72+
print("The module named \"pynput\" wasn't found! Do you want to install it? ([Y]es/[N]o)")
73+
pynputinput = input().lower()
74+
if pynputinput in arr:
3275
os.system("pip install pynput")
3376
# presult = True
34-
elif pynputinput == "N":
35-
installedPackeges = False
36-
print("Then you need to install it. Read the instructions on the github page or read the README.md!")
3777
else:
38-
print("That wasn't a N or an Y.")
39-
quit()
40-
#checking for flagser
41-
try:
42-
import flagser
43-
print("Module \"flagser\" was found!")
44-
presult = True
45-
except ModuleNotFoundError:
46-
print("The module named \"flagser\" wasn't found! Do you want to install it? (y/n)")
47-
pynputinput = input().upper()
48-
if pynputinput == "Y":
49-
os.system("pip install flagser")
50-
# presult = True
51-
elif pynputinput == "N":
5278
installedPackeges = False
5379
print("Then you need to install it. Read the instructions on the github page or read the README.md!")
54-
else:
55-
print("That wasn't a N or an Y.")
56-
quit()
80+
5781

5882
if installedPackeges:
5983
#f = open('./settings.txt','r')
@@ -70,15 +94,17 @@
7094
# f.write(line)
7195
#f.write("firststartup=true")
7296
#f.close()
73-
with open('settings.json') as f:
74-
data = json.load(f)
7597

7698
data['firststartup']=True
7799
with open('settings.json', 'w') as outfile:
78100
json.dump(data, outfile,indent=4)
79-
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!")
101+
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!")
80102

81103

82104
else:
83-
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!")
105+
try:
106+
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!")
107+
except:
108+
print("Sorry, but either one or both of the modules wasn't found. \n Read the instructions for help on how to install them!")
109+
84110
quit()

install.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/bash
2+
set -e
3+
4+
if [[ "$EUID" != 0 ]]; then
5+
echo "Sudo was not enabled."
6+
7+
sudo -k
8+
if sudo true; then
9+
echo "Correct password, running installation."
10+
else
11+
echo "Wrong Password, exiting."
12+
exit 1
13+
fi
14+
fi
15+
pkgname="openclick"
16+
17+
python install.py || python3 install.py || echo 'Python is not installed, exiting...'
18+
19+
sudo install -Dm755 linux/cli.py /usr/bin/openclick
20+
sudo install -Dm444 LICENSE "/usr/share/licenses/$pkgname/LICENSE"
21+
sudo install -Dm444 README.md "/usr/share/doc/$pkgname/README.md"
22+
sudo install -Dm666 settings.json "/etc/$pkgname/settings.json"
23+
24+
echo "Install Success!"
25+
exit 0

0 commit comments

Comments
 (0)