diff options
| author | Akshay Nair <phenax5@gmail.com> | 2021-09-14 13:37:00 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2021-09-14 13:37:00 +0530 |
| commit | 69d464818c7a6e599771fe67d407c163c8a7a0c4 (patch) | |
| tree | b361000d0cbfa4609cc66a8a1c707e63d859990d /scripts | |
| parent | 4d89e28f26075ecf3a8d132fe5177eecef99b565 (diff) | |
| download | nixos-config-69d464818c7a6e599771fe67d407c163c8a7a0c4.tar.gz nixos-config-69d464818c7a6e599771fe67d407c163c8a7a0c4.zip | |
config changes sync
Diffstat (limited to '')
| -rwxr-xr-x | scripts/commands/:weekly-review | 37 | ||||
| -rwxr-xr-x | scripts/open-project.sh | 10 | ||||
| -rwxr-xr-x | scripts/rate-sx.sh | 32 |
3 files changed, 74 insertions, 5 deletions
diff --git a/scripts/commands/:weekly-review b/scripts/commands/:weekly-review new file mode 100755 index 0000000..9b16b12 --- /dev/null +++ b/scripts/commands/:weekly-review @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +REVIEWS_DIR="$HOME/nixos/extras/notes/weekly-reviews"; + +get_date() { date +"%Y-%m-%d"; } + +template() { + local date=$(get_date); +echo "# $date + +### What did you achieve this week? + - + +### What do I want to achieve next week? + - + +### What are you grateful for? + - + +### What went wrong? + - + +### How are you feeling? + + +"; +} + + +review_file="$REVIEWS_DIR/$(get_date).md"; + +if [[ ! -f "$review_file" ]]; then + template > $review_file; +fi + +sensible-terminal -e sensible-editor $review_file; + diff --git a/scripts/open-project.sh b/scripts/open-project.sh index f7a41ba..7fb9ca7 100755 --- a/scripts/open-project.sh +++ b/scripts/open-project.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash PROJECTS_DIR="$HOME/dev/projects"; -SUCKLESS_DIR="$HOME/.config/suckless"; +GODOT_DIR="$HOME/dev/godot"; get_projects() { ls -t "$PROJECTS_DIR" | sed 's/^/dev:/g'; - ls -t "$SUCKLESS_DIR" | sed 's/^/suckless:/g'; + ls -t "$GODOT_DIR" | sed 's/^/godot:/g'; } project=$(get_projects | dmenu -p "Project name :: "); @@ -20,9 +20,9 @@ projdir=$(echo "$project" | cut -d: -f2-); fulldir=""; case "$projtype" in - dev) fulldir="$PROJECTS_DIR/$projdir" ;; - suckless) fulldir="$SUCKLESS_DIR/$projdir" ;; - *) fulldir="$PROJECTS_DIR/$projdir" ;; + dev) fulldir="$PROJECTS_DIR/$projdir" ;; + godot) fulldir="$GODOT_DIR/$projdir" ;; + *) fulldir="$PROJECTS_DIR/$projdir" ;; esac if [ ! -z "$fulldir" ]; then diff --git a/scripts/rate-sx.sh b/scripts/rate-sx.sh new file mode 100755 index 0000000..baec270 --- /dev/null +++ b/scripts/rate-sx.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +rate_sx() { + [[ ! -z "$2" ]] \ + && curl $2.rate.sx/$1 \ + || curl rate.sx/$1; +} + +get_1() { cut -d' ' -f1; } +get_2() { cut -d' ' -f2; } + +help() { + echo " +::: Rate.sx repl ::: + btc: get graph for btc in usd + btc inr: get graph for btc in inr + 1btc inr: print the value of 1btc in inr + q: quit +"; +} + +help; + +while true; do + while IFS="" read -r -e -d $'\n' -p 'rate.sx $ ' command; do + case "$(echo $command | get_1)" in + q) exit 0 ;; + *) rate_sx $command ;; + esac; + done; +done; + |
