aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/commands/:weekly-review37
-rwxr-xr-xscripts/open-project.sh10
-rwxr-xr-xscripts/rate-sx.sh32
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;
+