diff options
author | Xiao Pan <gky44px1999@gmail.com> | 2024-02-23 03:08:52 -0800 |
---|---|---|
committer | Xiao Pan <gky44px1999@gmail.com> | 2024-02-23 03:08:52 -0800 |
commit | dd78faaf40862bd1552ec36c41374b527f747284 (patch) | |
tree | b914f890c545db7168984f7bcc15cfc7c976c1d3 /sh/news | |
parent | c808bb6ee7f77f077308a1f06f63dbee6a928f6d (diff) |
Reorganize shell scripts into sh dir, consider in the future fsh will have different kinds of files
Diffstat (limited to 'sh/news')
-rwxr-xr-x | sh/news | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -0,0 +1,39 @@ +#!/bin/sh + +daily () { + # mail.yahoo.com/d/folders/6 is spam folder + o "$BROWSER" \ + https://github.com/notifications \ + 'https://mail.google.com/mail/u/0/#inbox' \ + 'https://mail.google.com/mail/u/0/#spam' \ + 'https://mail.google.com/mail/u/1/#inbox' \ + 'https://mail.google.com/mail/u/1/#spam' \ + https://mail.yahoo.com \ + https://mail.yahoo.com/d/folders/6 \ + https://en.wikipedia.org/wiki/Portal:Current_events + # alacritty --hold must be before -e + # full window: -w156, am and pm in one line: -w114 + o alacritty --hold -e rem -cu+2 -@ -w114 + o alacritty --hold -e wtr + o alacritty -e newsboat + o alacritty --hold -e rate + o alacritty --hold -e pass practice_password2 +} + +monthly () { + o "$BROWSER" https://smtp.cheogram.com/ http://download.huzheng.org + # Show 3 months' remind. I use 3 months because it is better to know I20 deadline 3 months earlier so I have 2 months to prepare the money for extension. + # (2*31+30+6)/7=14. Consider month 1 day 1 is on Sunday and make sure month 3 day 31 is shown. Tested with `rem -cu+14 -@ -w114 2025-03-01` + o alacritty --hold -e sh -c 'rem -cu+14 -@ -w114 | $PAGER' +} + +if [ $# -eq 0 ]; then + daily +else + while getopts m opt; do + case $opt in + m) monthly;; + \?) exit 1;; + esac + done +fi |