- commit
- 5d023c4
- parent
- e15c541
- author
- xxwhirlpool
- date
- 2026-04-17 14:57:02 -0400 EDT
ical & blogroll scripts
2 files changed,
+52,
-0
R config/.local/bin/eunoia_blogroll =>
scripts/Scripts/eunoia_blogroll
+0,
-0
+52,
-0
1@@ -0,0 +1,52 @@
2+#!/usr/bin/env bash
3+
4+# don't take args
5+if [[ "$#" -gt 0 ]]; then
6+ echo "Usage: ical_add [FOLLOW PROMPTS]"
7+ exit 1
8+fi
9+
10+# basic functions
11+die() {
12+ echo "canceled" && exit 1
13+}
14+
15+ginput() {
16+ gum input --placeholder "$@"
17+}
18+
19+# define calendar file
20+calfile="/home/kat/Documents/Git/-mine/ladyflash/public/feeds/cal/Music_Releases.ics"
21+
22+# remove vcalend for now
23+sed -i '/END:VCALENDAR/d' "$calfile"
24+
25+# read/take input and store in variables
26+summary=$(ginput "Artist Type 'NAME'") || die
27+dtstart=$(ginput "format: 20260417") || die
28+dtend=$(ginput "format: 20260418") || die
29+dtstamp=$(date -d "$(ginput "format: 20260417")" +'%Y%m%dT%H%M%SZ') || die
30+uuid=$(uuidgen | tr "[:lower:]" "[:upper:]") || die
31+categories=$(ginput "K-Pop,Pop") || die
32+
33+# idk if this does anything but
34+# it's here just in case lol
35+if [[ -z "$summary" || -z "$dtstart" || -z "$dtend" || -z "$dtstamp" || -z "$uuid" || -z "$categories" ]]; then
36+ die
37+fi
38+
39+# add everything to the calendar
40+cat << EOF | perl -pe "chomp if eof" >> "$calfile"
41+BEGIN:VEVENT
42+SUMMARY:$summary
43+DTSTART;VALUE=DATE:$dtstart
44+DTEND;VALUE=DATE:$dtend
45+DTSTAMP:$dtstamp
46+UID:$uuid
47+SEQUENCE:0
48+CATEGORIES:$categories
49+END:VEVENT
50+EOF
51+
52+# add back in the vcalend
53+echo -e "\nEND:VCALENDAR" >> "$calfile"