You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
2.9 KiB
119 lines
2.9 KiB
#!/usr/bin/env bash |
|
# AUTHOR: shaggy |
|
# FILE: updatecalcurse |
|
# ROLE: TODO (some explanation) |
|
# CREATED: 2014-12-21 18:17:01 |
|
# MODIFIED: 2015-04-28 01:52:58 |
|
|
|
function check { |
|
if (( $(pidof calcurse | wc -w) == 1 )); then |
|
echo -e "Calcurse is already Running... Killing" |
|
kill $(pidof calcurse | awk '{print $1}') |
|
else |
|
echo -e "Calcurse is Not Running... Safe to Continue" |
|
fi |
|
} |
|
|
|
function checkif { |
|
case "$(pidof calcurse | wc -w)" in |
|
|
|
0) echo "Calcurse not open, Proceding:" |
|
;; |
|
2) echo "Calcurse running, all OK" |
|
;; |
|
*) echo "Instances of Calcurse running. Stopping..." |
|
kill $(pidof calcurse | awk '{print $1}') |
|
;; |
|
esac |
|
} |
|
|
|
function loading { |
|
char="|" |
|
while :; do |
|
case "$char" in |
|
"|") |
|
char="/" |
|
;; |
|
"/") |
|
char="-" |
|
;; |
|
"-") |
|
char="\\" |
|
;; |
|
"\\") |
|
char="|" |
|
;; |
|
esac |
|
sleep .2s |
|
echo -en "\rLoading $char" |
|
done |
|
} |
|
|
|
checkif |
|
loading & |
|
pid=$! |
|
|
|
echo -e "\nDownloading Calendars" |
|
|
|
rm ~/.calcurse/apts && |
|
touch ~/.calcurse/apts && |
|
|
|
|
|
wget http://followshows.com/ical/agDBZ7tj -q -O ~/.calcurse/tv.ics && |
|
|
|
wget http://animecalendar.net/user/ical/11986/469cc8a1f781cffe56dd993294ad83c8 -q -O ~/.calcurse/anime.ics && |
|
|
|
wget https://www.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics -q -O ~/.calcurse/usholiday.ics && |
|
|
|
wget https://www.google.com/calendar/ical/en.mexican%23holiday%40group.v.calendar.google.com/public/basic.ics -q -O ~/.calcurse/mexicanholiday.ics && |
|
|
|
wget https://www.google.com/calendar/ical/pfutdblf1gi8jmfsvroh76f6jg%40group.calendar.google.com/public/basic.ics -q -O ~/.calcurse/firstshowingdotnet.ics && |
|
|
|
wget https://www.google.com/calendar/ical/en.japanese%23holiday%40group.v.calendar.google.com/public/basic.ics -q -O ~/.calcurse/japanholiday.ics && |
|
|
|
#wget https://www.google.com/calendar/ical/ht3jlfaac5lfd6263ulfh4tql8%40group.calendar.google.com/public/basic.ics -q -o ~/.calcurse/moon.ics && |
|
|
|
#wget http://otakucalendar.com/ical/releasedates-us.ics -q -O ~/.calcurse/otakucal.ics && |
|
|
|
sleep 2 && |
|
|
|
|
|
|
|
|
|
|
|
# do something |
|
|
|
echo -e "\nDownloading Complete Begin Importing" |
|
sleep 2s && |
|
|
|
|
|
|
|
calcurse -i ~/.calcurse/tv.ics && |
|
calcurse -i ~/.calcurse/anime.ics && |
|
calcurse -i ~/.calcurse/usholiday.ics && |
|
calcurse -i ~/.calcurse/mexicanholiday.ics && |
|
calcurse -i ~/.calcurse/firstshowingdotnet.ics && |
|
calcurse -i ~/.calcurse/japanholiday.ics && |
|
#calcurse -i ~/.calcurse/otakucal.ics && |
|
#calcurse -i ~/.calcurse/moon.ics && |
|
|
|
echo -e "\nImporting Local Cal" |
|
|
|
mv ~/.calcurse/apts ~/.calcurse/aptstemp && |
|
cat ~/.calcurse/myapts ~/.calcurse/aptstemp > ~/.calcurse/apts && |
|
sleep 2s |
|
|
|
clear && |
|
|
|
echo -e "\nComplete, opening calcurse..." |
|
|
|
clear && |
|
|
|
sleep 1s |
|
|
|
kill -9 $pid |
|
wait $pid 2>/dev/null # Supress "Killed" message |
|
echo -en "\r\033[K" # Completely overwrite last line |
|
|
|
echo "Done." |
|
#calcurse
|
|
|