dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

commit af3e5e2d4aeb3b917701b3a9728b355401592952
parent 7165938168fc3b5a358c15b888e8d356aeeae02f
Author: pyratebeard <root@pyratebeard.net>
Date:   Thu,  7 May 2020 13:45:18 +0100

display news headlines in first tmux window

Diffstat:
Mzsh/.zsh/welcome.zsh | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/zsh/.zsh/welcome.zsh b/zsh/.zsh/welcome.zsh @@ -19,8 +19,24 @@ script() { tmux new -s main -n '~' } +getnews() { + curl 'https://newsapi.org/v2/top-headlines' -s -G \ + -d sources=$1 \ + -d pageSize=5 \ + -d apiKey=$NEWS_API_KEY | jq -r '.articles[] | .title, .url, ""' | tr -d '\t' +} + set -o vi cat ~/tmp/pyratebeard_ansi_md + if [[ ${PTS} -lt "2" ]] ; then script fi + +if [[ ${TMUX_PANE} == '%0' ]] ; then + echo -e "\n// WELCOME $(whoami | tr 'a-z' 'A-Z')\n" + echo -e "\nIRISH NEWS HEADLINES:" + getnews the-irish-times + echo -e "\nHACKER NEWS HEADLINES:" + getnews hacker-news +fi