diff --git a/bashrc b/bashrc index 100194f..09ab0a8 100755 --- a/bashrc +++ b/bashrc @@ -143,3 +143,9 @@ PS1="$PS1\$(parse_git_branch)" ## Finalizing section PS1="$PS1\$ "; + + + +#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! +export SDKMAN_DIR="/home/tony/.sdkman" +[[ -s "/home/tony/.sdkman/bin/sdkman-init.sh" ]] && source "/home/tony/.sdkman/bin/sdkman-init.sh" diff --git a/bin/nux-note b/bin/nux-note new file mode 100755 index 0000000..6b2cf56 --- /dev/null +++ b/bin/nux-note @@ -0,0 +1,8 @@ +#!/bin/sh +DATE_FORMAT="%Y-%m-%d %H:%M" +NOTE_FILE=$1; +shift; + +# FIXME: Add possibility to specify note aliases & help + +echo $(date "+$DATE_FORMAT") $* ">> $NOTE_FILE"; diff --git a/bin/tdm-media-cbz b/bin/tdm-media-cbz index 027ac42..c3883cc 100755 --- a/bin/tdm-media-cbz +++ b/bin/tdm-media-cbz @@ -3,7 +3,7 @@ ## ## Creates cbz archive from supplied folder. ## - +SELF=$0 FILENAME=$(basename $0) show_help() { echo $FILENAME @@ -42,8 +42,9 @@ while getopts "hp:s:d" opt; do SUFFIX="$OPTARG"; ;; h) - show_help;exit 1;; - \?) show_help;exit 1;; + tdm-show-help $SELF;exit 1;; + \?) + tdm-show-help $SELF;exit 1;; :) echo "Option -$OPTARG requires an argument." >&2 ; exit 1;; esac done diff --git a/bin/tdm-note b/bin/tdm-note new file mode 100644 index 0000000..6b2cf56 --- /dev/null +++ b/bin/tdm-note @@ -0,0 +1,8 @@ +#!/bin/sh +DATE_FORMAT="%Y-%m-%d %H:%M" +NOTE_FILE=$1; +shift; + +# FIXME: Add possibility to specify note aliases & help + +echo $(date "+$DATE_FORMAT") $* ">> $NOTE_FILE"; diff --git a/bin/tdm-show-help b/bin/tdm-show-help new file mode 100755 index 0000000..42c244a --- /dev/null +++ b/bin/tdm-show-help @@ -0,0 +1,14 @@ +#!/bin/sh + +## +## Creates cbz archive from supplied folder. +## +SCRIPT_PATH=$1 +FILENAME=$(basename $1) + +echo $FILENAME +grep "\#\#" $1 | cut -d\# -f3- +echo + + + diff --git a/bin/todoist b/bin/todoist new file mode 100755 index 0000000..3b06b95 --- /dev/null +++ b/bin/todoist @@ -0,0 +1,31 @@ +#!/bin/sh + +# Source http://www.dib0.nl/code/524-add-todoist-item-from-the-commandline-in-linux-revised + +# check commandline arguments +if [ $# -eq 0 ] +then + echo "No arguments." + echo "Usage addtodoist.sh <Date/time: optional> <Project ID: optional>" + exit 1 +fi + +# Login and get the token +token=`wget -qO- --no-check-certificate "https://api.todoist.com/API/login?email=$1&password=$2"|awk -F'api_token":"' '{print $2}'|awk -F'"' '{print $1}'` + +# Add the todo item +url="https://api.todoist.com/API/addItem?token=$token&content=$3&priority=1" + +# Add the date if available +if [ ! -z "$4" ] +then + url=$url"&date_string=$4" +fi + +# Add the project_id if available +if [ ! -z "$5" ] +then + url=$url"&project_id=$5" +fi + +wget -qO- --no-check-certificate "$url" >/dev/null