Projects / Dear Shelly

Dear Shelly

projects javafx productivity

DEARSHELLY_GITHUB

Dear Shelly is productivity tool - economical personal assitant and it has helped me a lot in my journey. I wanted my days to be logged, which helps while you retrospect yourself. Either you can maintain a physical diary or something digital like this. I also use Google Calendar, to create tasks, which is synced across all the devices.

Releases

There are 3 version that I created

Name About
Dear Shelly - My Day Shell script - way back when I was into scripting
ShellyInPie PyQt while I was working on computer vision using python
ShellyFx - Make Your Day Count JavaFx, just wanted to make it cross platform, easy to deploy

ShellyFX

Let’s talk about the current version that I currently use. This is very robust when compared to the other versions.

Core Stack JavaFx, JGit, Gson, Sl4j, BouncyCastle

JGit is a lightweight, pure Java library implementation of the Git version control system – including repository access routines, network protocols, and core version control algorithms. To know how to use, check this vogella_tutorial.

To get started with BouncyCastle, you can check this baeldung_blog.

Main UI

ShellyInPie

This was designed using PyQT. There are two reasons that I created in this framework, Firstly, I was a bit curious how QT behaves in python as I had used it in C/C++, well its fine but so legacy as its in native. Secondly, during that time I was learning Computer Vision using Python, so I wanted to develop this tool so as to get into groove. The challenge here was piping the commands, while I was developing in shell script, this was not at all a problem as it directly communicates with kernel. Another challenge was about Waiting For A Signal, as when you are saving or commiting, you want to know whether the event has happened or not keeping the GUI alive. So, if you see in the below screen captures you can find some error dialog’s that tell you the state of event.

Core Stack PyQt5, QtWidgets, QtGui, QtCore, sqlite3, subprocess (PIPE), QThread, pyqtSignal

Main UI

Dialogs

Dear Shelly - El Clásico

This was designed using pure shell script but for dialog boxes I used Zenity. To get started with Zenity, you can refer this blog.

Core Stack Shell, Zenity

Main UI

Quick tips

Some Quick tips, that can help you while writing your bash script

  • To check for empty fields in the user input
if [[ -z "$userInput" ]]; then
   printf '%s\n' "No input entered"
   exit 1
  • Setting Internal Field Separator (IFS), read more on this blog
IFS='|'                             # | is set as delimiter
read -ra ADDR <<< "$mRawFormData"   # str is read into an array as tokens separated by IFS
arraylength=${#ADDR[@]}             # get length of an array
  • It is easy to format the date, check this blog. This was useful for me to create the directories structure like /diary/2020/Apr/05_Apr_2020_044159.json
CURRENT_DATE="`date "+%d_%b_%Y_%H:%M:%S"`" # 08_Aug_2021_01:47:53
CURRENT_MONTH="`date "+%b"`"               #Aug
CURRENT_YEAR="`date "+%Y"`"                #2017
echo $CURRENT_YEAR

< > Code