GoRandomCaps is a fun and harmless prank application written in Go. It toggles the Caps Lock key randomly at intervals, and provides a system tray interface with additional features like enabling startup on boot and rebooting the application.
Disclaimer: This project was built and tested on Windows. While compatibility with Linux and macOS is intended, these platforms are currently untested. Use at your own discretion.
- Randomly toggles Caps Lock at intervals.
- Runs as a system tray application.
- Options to enable the application to start on boot.
- Cross-platform support for Windows, Linux, and macOS (Windows tested, others untested).
-
Clone the repository:
git clone https://github.com/your-username/gorandomcaps.git cd gorandomcaps
-
Build the project:
build.bat
The executable will be created in the
build/
directory. -
Run the application:
./build/gorandomcaps.exe
-
Clone the repository:
git clone https://github.com/your-username/gorandomcaps.git cd gorandomcaps
-
Make the build script executable:
chmod +x build.sh
-
Build the project:
./build.sh
The executables for Linux and macOS will be created in the
build/
directory. -
Run the application:
./build/gorandomcaps-linux # For Linux ./build/gorandomcaps # For macOS
- When the application is started, it will appear in the system tray. By default the icon is a clock and says "Alarms" but that's just sneaky stuff.
- Options in the system tray menu:
- Reboot: Kills the application.
- Start on Boot: Adds the application to startup on your system.
The main functionality toggles the Caps Lock key at random intervals (between 0 and 10 minutes) in the background. Platform-specific implementations handle the Caps Lock toggle and startup options:
- Windows: Uses
keybd_event
from the Windows API. - Linux: Utilizes
xdotool
for key simulation. - macOS: Leverages AppleScript for key toggling.
The project uses custom icons for the system tray. Icons are converted into Go arrays using the 2goarray
tool. Scripts (generate.bat
and generate.sh
) handle the conversion.
To generate icons:
- Place your
.ico
files in theicon/
directory. - Run the appropriate script:
- Windows:
generate.bat <WINDOWS.ico> <MAC.ico> <LINUX.ico>
(if you only do one image it will apply to all, two images will make mac apply to mac and linux) - Linux/macOS:
generate.sh <WINDOWS.ico> <MAC.ico> <LINUX.ico>
(if you only do one image it will apply to all, two images will make mac apply to mac and linux)
- Windows:
Feel free to contribute to this project! Report issues, suggest features, or submit pull requests.
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Make your changes and commit:
git commit -m "Description of changes"
- Push to your fork and open a pull request.
This project is intended for entertainment purposes only. The developer is not responsible for any unintended consequences arising from the use of this application. Also a quick prank is fun, leaving this on someone's computer is just being a dick.
This project is licensed under the MIT License. See the LICENSE file for details.