Dotfiles/LEGACY/i3/blocks/archNews
2019-07-30 15:10:03 +01:00

34 satır
968 B
Bash
Çalıştırılabilir Dosya
Ham Suçlama Geçmiş

Bu dosya muğlak Evrensel Kodlu karakter içeriyor

Bu dosya, başka karakterlerle karıştırılabilecek evrensel kodlu karakter içeriyor. Eğer bunu kasıtlı olarak yaptıysanız bu uyarıyı yok sayabilirsiniz. Gizli karakterleri göstermek için Kaçış Karakterli düğmesine tıklayın.

#!/usr/bin/sh
# This shows the most recent part news article in the arch news rss feed
# Left-clicking will open the web page in the browser
# Right clicking will dismiss the feed by putting the title in the ~/.archNewsDismiss file
# Deleting / changing this file will un-dismiss the news item
title=$(rsstail -u https://www.archlinux.org/feeds/news/ -n 1 -1 | sed -e "s/^Title: //")
dismissed=""
if [ -f ~/.archNewsDismiss ]; then
dismissed=$(head -n 1 ~/.archNewsDismiss)
fi
case $BLOCK_BUTTON in
1)
url=$(rsstail -u https://www.archlinux.org/feeds/news/ -l -n 1 -1 | tail -n 1 | sed -e "s/^Link: //")
case $( uname -s ) in
Darwin) open=open;;
MINGW*) open=start;;
CYGWIN*) open=cygstart;;
MSYS*) open="powershell.exe NoProfile Start";;
*) open=${BROWSER:-xdg-open};;
esac
$open $url > /dev/null
;;
3)
echo $title > ~/.archNewsDismiss
dismissed=$title
esac
if [ "$dismissed" != "$title" ]; then
echo $title
fi