٩(⊙‿⊙)۶ Aww Tools

A collection of productivity tools

Embrace the aww!

We have such sights to show you!

But, don't get your hopes too high. How many times have you found a simple code snippet that was helpful? Aww tools aim to collect such snippets and make them handy and easy to use when you need them. Most of aww tools are very simple and minimalist projects. For example, you may need a new GUID once in a while... not very often… but when you do, aww guid is there for you!

Want to know how it was implemented on Windows and Linux?

Ha-ha. Spoiler alert! It was a mix of pain and pleasure! Please, enjoy aww tools as a bunch of useful and fun samples, and don't expect too much ;)

Installation

One of the core ideas of aww tools is to make the contribution process as convenient as possible. This is why aww tools are distributed as a git repo. You are encouraged to open the github repository and fork the project:

https://github.com/dzharii/awwtools

Or you can postpone this decision and clone it now. I do not insist on forking. Just a suggestion ;)


git clone https://github.com/dzharii/awwtools

✨ Wow! Thank you for making this first step!

As Lao Tsu says "A journey of a thousand miles begins with a single step."

Next, let's get to the awwtools repo folder. You can do it!

And... let's make sure we have all dependencies installed

CMake

Installing CMake on Windows and Linux.

CMake alternative Windows 11:


winget install -e --id Kitware.CMake

C++ compiler

On Windows

Visual Studio Community would be the best choice. Please, enable C++ support during installation.

On GNU/Linux

Use GCC


I really appreciate you are still here after all these installations

Building

"Materialize" the build system with CMake

cmake . -B cmake-build -DCMAKE_BUILD_TYPE=DEBUG

cmake --build cmake-build

Aww tools!

aww git open

2022-01-01

aww git open
aww-git-open
aww git open [optional file or folder path]
aww-git-open [optional file or folder path]

Source code: /main/app/aww-git-open.cpp

This tool is useful when you want to share a link to the source file with your friend... or a 🧛colleague.

Opens the default system browser with the web version of the provided file or folder. The file path is optional and, when launched without parameters -- attempts to open the current directory.

aww date

2022-01-01

# returns current date as YYYY-MM-DD:
aww date
aww-date

# returns safe file name string with date
aww date [optional text]
aww-date [optional text]

# example:
aww date letter to my future self
# result
# 2022-10-24-letter-to-my-future-self (result is copied to clipboard)

Source code: /main/app/aww-date.cpp

This tool copies the current date to the clipboard. It is useful when you want to create a file with a date in the name.

If any text is provided as a command line argument, it will be appended to the date. The unsafe filename characters will be replaced with "-".

aww toast

2022-01-01

aww toast [message]
aww toast Hello, World!

# example:
sudo apt-get install -y cowsay && aww toast Installed! || aww toast Installation failed!
# result
# This example shows a desktop notification after command apt-get finishes the installation (or fails).

Source code: /main/app/aww-toast.cpp

Shows a simple operating system "toast" notification with the message provided as the command line arguments.

aww run

2022-01-01

aww run [command line]

# example:
aww run ffmpeg -i input.mp4 output.mp4
aww-run ffmpeg -i input.mp4 output.mp4

Source code: /main/app/aww-run.cpp

Wraps input command line and executes it as a child process. Echoes command line output and shows a notification when the command has finished. Measures execution time.

aww open

2023-02-15

aww open file.jpg # opens file.jpg in the default system application
aww-open .        # same as "aww open" (without parameters)
aww open          # opens current directory in the default system file manager
  

Source code: /main/app/aww-open.cpp

Opens file or folder in the default system "opener" - application associated with the file type.
No need to remember that "explorer file.jpg" on Windows and "xdg-open file.jpg" on Linux
do same thing. Just use "aww open file.jpg" and it will work on those environments.

aww term

2023-02-15

aww term # opens terminal in the current directory
aww-term
  

Source code: /main/app/aww-term.cpp

Opens new terminal window in the current directory.

aww guid

2023-02-15

aww guid # generates new GUID and copies it to the clipboard
aww-guid
  

Source code: /main/app/aww-guid.cpp

True cross-platform GUID generator. Generates new GUID and copies it to the clipboard.

aww create

2023-02-15

aww create [filename] [template-modifier] # creates new file using template

# creates new file with the name "filename.md" in the current directory
# uses template template.md
aww create filename.md

# creates new file with the name "filename.md" in the folder "parent01/parent02"
# uses template template.md
aww create parent01/parent02/filename.md

# creates new file with the name "myclass.cpp" in the current directory using
# the template "template.cpp"
aww create myclass.cpp

# creates new file with the name "myprogram.cpp" in the current directory using
# the template "template-main.cpp"
aww-create myprogram.cpp main

# Unknown file name. Will create an empty file with the name "secret.xxx"
aww-create secret.xxx

# since 2023-05-06 aww-create will create folders when the file extension is missing
# this will create folder src/main/java
aww create src/main/java

# since 2023-05-06 aww-create supports pseudo modifier "date", which
# allows to create files with the current date in the "leaf" name

# this will create: src/main/2023-05-06-java
aww create src/main/java date

# this will create: 2023-05-06-my-aww-project-notes
aww create my-aww-project-notes date

# this will create: 2023-05-06-my-notes.md
aww create my-notes.md date

  

Source code: /main/app/aww-create.cpp

Check folder aww-create-aww
Creates new file in the current directory or in the relative subfolder.
Uses template file (if exists) to fill the new file with the content.
Otherwise, creates an empty text file.
Alternative to "mkdir -p parent01/parent02" + "touch" command on Linux.

aww tag

2023-03-28

aww tag # generates unique alpha-numerical tag, like "svfg8hgix0i";
aww-tag
aww tag 20 # sets length of the generated tag to 20 chars "ddet1frpfzza20bzxsrf"
# default is 11
  

Source code: /main/app/aww-tag.cpp

generates unique alpha-numerical tag, 11 characters by default.

Notes

Q&A

Q: Why C++?

FOR THE GLORY!!!

C++ had been released in 1985, the year before I was born... And it is OLD, like me, but not OBSOLETE! (🤖)

In this project, we definitely do not take performance into the consideration. But look! In aw tools we don't have to manually manage the memory allocations; but we have this option, he-he!