This project allows you to generate QR codes locally on your machine. It provides a simple and efficient way to create QR codes without relying on online services.
To generate a QR code, use the following command in your terminal:
bin/qrCodeGenerator https://maciejgad.pl ~/qr.pngThis command will create a QR code for the URL https://maciejgad.pl and save it as qr.png in your home directory. You can replace the URL and the output file path as needed.
If you want to open the generated QR code in Preview immediately after creating it, you can use the qr.sh script. This script simplifies the process by generating the QR code and opening it in Preview with a single command. Use the following command in your terminal:
qr.sh https://maciejgad.plReplace https://maciejgad.pl with the URL you want to encode in the QR code. The script will generate the QR code and open it in Preview for you to view.
If you prefer to build the QRCodeGenerator project from source, you can do so using Xcode. Building from source allows you to customize the project and make any necessary modifications. Follow these steps to build the project from source:
- Ensure you have Xcode installed on your machine. You can download it from the Mac App Store if you don't have it already.
- Open the QRCodeGenerator project in Xcode by double-clicking the
.xcodeprojfile or using theFile > Openmenu in Xcode. - Select your target device or simulator from the toolbar at the top of the Xcode window.
- Click on the "Build" button in the toolbar or press
Cmd + Bon your keyboard to start the build process. - Wait for Xcode to compile the project. Once the build is complete, the necessary binaries will be generated in the project's build directory.
After building the project, you can use the generated binaries to create QR codes as described in the usage section. This approach gives you full control over the build process and allows you to make any desired changes to the project.
You can set up a watcher that will trigger QR code generation whenever you add a .webloc file (drag and drop from Safari address bar) to the CreateQR folder. Follow these steps to set up the watcher:
- Install
fswatchby running:brew install fswatch. - Run
./update_watch_plist.shto update the path towatch.shinpl.maciejgad.qrCode.watch.plist. - Move the plist file to the
~/Library/LaunchAgentsfolder with the command:mv pl.maciejgad.qrCode.watch.plist ~/Library/LaunchAgents/. - Load the agent in Terminal with:
launchctl load ~/Library/LaunchAgents/pl.maciejgad.qrCode.watch.plist. Your script will now run every time you log in. - To unload the agent later, use:
launchctl unload ~/Library/LaunchAgents/pl.maciejgad.qrCode.watch.plist.
By following these steps, you can automate the QR code generation process and ensure that it runs seamlessly in the background.
All steps in one place:
brew install fswatch
./update_watch_plist.sh
mv pl.maciejgad.qrCode.watch.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/pl.maciejgad.qrCode.watch.plist