Skip to content

Commit

Permalink
some small and major changes
Browse files Browse the repository at this point in the history
Other.pyw now uses a dictionary with all settings saved in it
Font outlining is working good now
Sparkles and Other no longer have taskbar buttons
some smaller things
  • Loading branch information
LtqxWYEG authored May 30, 2022
1 parent 80c25dc commit d91fc80
Show file tree
Hide file tree
Showing 10 changed files with 359 additions and 245 deletions.
Binary file added GUI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GUI2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GUI3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GUI4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 32 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,69 +8,72 @@
```
Yea boy! It's the 90s again! Get some _*very elegant*_ poop stuck to your mouse - *like ppl did in the 90s! Yay!!* Waste some CPU-cycles with nice visuals! ... The 90s!! Who cares about 5% CPU! Get this poop stuck to your mouse cursor! Now! NOW!

Draws mouse-cursor-following text, cursor coordinates, color of pixel under cursor, pictures or a clock - for when you really need to keep an eye on the time. Uses PyGame for 'low' resource usage. Works by creating a transparent full-screen window that is click-through, on top of the z-order. (But not on top of the context menus, start menu and all these things.)
Draws a very nice looking sparkle/glitter/smoke/fire effect following/on your mouse.
Can also draw mouse-cursor-following text, CPU and RAM usage, pictures or a clock with milliseconds - for when you really need to keep an eye on the time.
It can also show you the color of the pixel under the cursor in real RGB, complementary RGB or complementary RYB. (RYB is kinda inaccurate between the r, y, and b colors)
Uses PyGame for 'low' resource usage. Works by creating a TOPMOST transparent full-screen window that is click-through and has no taskbar button. (But not on top of the context menus, start menu and all these things.)

The intention for this is to build upon it to create something interesting - like cellular automata to draw fancy graphics over/around mouse cursor. Something like that. We'll see.
(Hahaha, a year ago I wrote "cellular automata". Pffff.)

---

Usage:
- Run PoopStuckToYourMouse.exe for a heavily configurable, nice sparkle effect with velocity and gravity and more. (not optimized)
- Run PoopStuckToYourMouse.exe for a heavily configurable, very nice sparkle effect with velocity and gravity and more. (not optimized)
- ^--- "Do it!" - Palpatine
- Other possibilities:
- Display color under mouse cursor
- RGB, RGB complementary and RYB complementary (With caveats)
- Display a clock
- CPU usage
- RAM usage
- Both/All
- An image
- You can also run 'other.exe' or 'sparkles.exe' alone. (Or the .py versions) They'll use the settings stored in the 'config.ini' - or if the files doesn't exist, create it with the values saved in 'defaults.ini'.

Important notice:
- If you execute PoopStuckToYourMouse.exe, (or main.pyw) don't have any other programs running that are also named "other.exe" or "sparkles.exe", otherwise they'll be terminated. So far this is the only working solution to kill the spawned processes. :(
- ^-- Maybe not?
- You can also run 'other.exe' or 'sparkles.exe' alone. (Or the .py versions) They'll use the settings stored in the 'config.ini' - or if that file doesn't exist, create it with the values saved in 'defaults.ini'.

---

Special features:
- Name is stupid! (Now less vulgar!)
- Single core capable
- Single core capable, but sometimes with threads!
- Fancy colors!
- Basically just experimentation
- Basically just an experimentation!
- It's at least something. *shrugs*
- Rainbow colors!
- I completely disregard all Linux users.
- I completely disregard all Linux users!
- Good performance!

---

Sparkles:
Performance with 20 particles per frame @60fps: (runs only on a single core)
- Laptop with AMD A4-6210: 25% CPU usage. (max per core: 25%)
- Desktop with AMD Ryzen 5 2600 @4Ghz: 5.14% avg CPU usage. (max per core: 8.33%)

Performance of Clock, Color, Image, CPU, RAM ...:
- Laptop: 3 to 5% CPU usage. (max per core: 25%)
- Desktop: 0.00 to 0.20% avg CPU usage. (max per core: 8.33%)
(measured using Resource Monitor)
- Laptop with AMD A4-6210: 20 to 25% CPU usage. (max per core: 25%) Now with double the framerate!
- Desktop with AMD Ryzen 5 2600 @4Ghz: 1.7 to 3.5% CPU usage. (max per core: 8.33%)

Ah... currently using the sparkles increases the energy usage of my PC by 20W. Maybe don't use it untill I find a better suited package than PyGame.

For some reason, if no subprocesses are running, PoopStuckToYourMouse.exe (or main.pyw) uses 4 to 5% CPU on my laptop.

Also, running any of the executables for the first time in, maybe, 30 minutes, takes a long time because Windows Defender needs to scan the file again and again. (And, I guess, because they are basically ~15MB big archives full of pure code, they take a long time to scan) If you exclude the folder in the security center then the starting time is only 1/10th or less.

---

Prerequisites:
- Windows (I used Windows 10 21H1)
- PyGame
- PySimpleGUI
- psutil
- pywin32
- Windows (I used Windows 10 21H2)
- Pillow
- configparser
- pywin32
- psutil
- pygame
- pyinstaller
- pefile
- setuptools
- PySimpleGUI
- acrylic - Only for the RYB complemantary color

---

![Current GUI](https://i.imgur.com/u55J7IS.png?raw=true)
Here you can see what the GUI looks like. There are also small samples of the capabilities of this thing visible.

![Current GUI](https://i.imgur.com/eDaJJLI.png?raw=true)
![Current GUI](https://i.imgur.com/powKnfT.png?raw=true)
![Current GUI](https://i.imgur.com/E73vlHL.png?raw=true)
![Current GUI](https://i.imgur.com/PQeCyuU.png?raw=true)


---
Thank you, various netizens, for all the StackOverflow questions and answers that helped me grasp an incredibly rudimentary understanding of Python.
5 changes: 3 additions & 2 deletions defaults.ini
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ levelNumParticles = 5, 8, 14, 20
[OTHER]
# Used for other.py
fontColor = #00ff00
fontSize = 10
fontSize = 12
outlineColor = #010101
outlineThickness = 2
outlineThickness = 1
fontAntialiasing = False
showColor = False
complementaryColor = False
rgbComplement = False
Expand Down
5 changes: 4 additions & 1 deletion main.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def getVariablesFromConfig(window):
window['fontSize'].update(int(config.get("OTHER", "fontSize")))
window['outlineColor'].update(str(config.get("OTHER", "outlineColor")))
window['outlineThickness'].update(int(config.get("OTHER", "outlineThickness")))
window['fontAntialiasing'].update(config.getboolean("OTHER", "fontAntialiasing"))
window['showColor'].update(config.getboolean("OTHER", "showColor"))
window['complementaryColor'].update(config.getboolean("OTHER", "complementaryColor"))
window['rgbComplement'].update(config.getboolean("OTHER", "rgbComplement"))
Expand Down Expand Up @@ -166,6 +167,7 @@ def updateConfig(values):
config.set("OTHER", "fontSize", str(values['fontSize']))
config.set("OTHER", "outlineColor", str(values['outlineColor']))
config.set("OTHER", "outlineThickness", str(values['outlineThickness']))
config.set("OTHER", "fontAntialiasing", str(values['fontAntialiasing']))
config.set("OTHER", "showColor", str(values['showColor']))
config.set("OTHER", "complementaryColor", str(values['complementaryColor']))
config.set("OTHER", "rgbComplement", str(values['rgbComplement']))
Expand Down Expand Up @@ -345,6 +347,7 @@ def make_window(theme):
sg.T('Font size in pt.')],
[sg.Spin([i for i in range(0, 10)], initial_value = 1, font = ("Segoe UI", 16), k = 'outlineThickness', enable_events = True),
sg.T('Thickness of the outline in pixel. Use "0" to deactivate the outline')],
[sg.Checkbox("Enable antialiasing for the font. (''Pixel-smearing'' of the edges to reduce blockiness. Can be blurry)", default = False, k = 'fontAntialiasing', disabled = False, enable_events = True)],
[sg.HorizontalSeparator()],
[sg.T('Untick all in order to activate the sparkly particles again.', font = ("Segoe UI", 16))],
[sg.Checkbox('Show RGB value of the color of the pixel under the cursor. Also draws a 40x40 square in that color.', default = False, k = 'showColor', disabled = False, enable_events = True)],
Expand Down Expand Up @@ -800,6 +803,6 @@ if __name__ == '__main__':
outlineColor = str(config.get("OTHER", "outlineColor"))
ageColorSpeed = float(config.get("SPARKLES", "ageColorSpeed"))
imagePath = str(config.get("OTHER", "imagePath"))
# I forgot why those four up there were necessary...
# I forgot why those five up there were necessary...
main(config)
#dead
Loading

0 comments on commit d91fc80

Please sign in to comment.