You are not logged in.
Hello!
I was looking for an utility that would quickly show the Arch Linux news feed in command line before I upgrade my system. A long time ago I tried pacmatic, but did not like it. Also other utilities I found did not suit my needs. So I wrote this one:
https://github.com/mjiricka/archnews
It's in pure Python 3 and has many command line options. So maybe somebody else would be interested? :-)
MJ
Offline
This is pretty cool, clean and simple. I like it and very useful. I seldom look at the news before updating, usually I end up looking after I encounter some issue Hopefully this tool will help me doing it the other way round.
Offline
Yes, I also like it. Would be great to have an aur package for it;-)
Offline
I have never packed anything, but if there is demand for it, I will try to do it!
Only problem I see is that I will have to rename it, because in AUR is already a package named "archnews".
Offline
@mjiricka, nice
I've written a wrapper that uses archnews to show the most recent news when -Syu is passed.
#!/bin/bash
#
# pacman wrapper that uses archnews python script
# to show most recent Arch news when passing -Syu
#
# <https://github.com/mjiricka/archnews>
#
# Usage: copy archnews to /usr/local/bin/
# save this script as /usr/local/bin/pacnews
# alias pacman='pacnews'
blue='\033[01;34m'
white='\033[01;37m'
normal='\033[0m'
news_file="${HOME}/.archnews.txt"
# create news file at first usage
[[ ! -f "$news_file" ]] && touch "${news_file}"
if [[ "$1" == "-Syu" ]]; then
# get most recent news
archnews -n 1 > /tmp/archnews.txt
# compare with stored
cmp /tmp/archnews.txt "${news_file}" > /dev/null 2>&1
if (($? != 0)); then
cat /tmp/archnews.txt
printf "\n${blue}:: ${white}"
read -p "Mark this news read? [Y,n] " answer
printf "${normal}\n"
answer=${answer,,} # tolower
if [[ "$answer" =~ ^(yes|y ) || -z "$answer" ]]; then
mv /tmp/archnews.txt "${news_file}"
fi
exit 0
fi
fi
exec pacman "$@"
Last edited by mis (2017-04-21 12:06:32)
Offline
Hello!
I was looking for an utility that would quickly show the Arch Linux news feed in command line before I upgrade my system. A long time ago I tried pacmatic, but did not like it. Also other utilities I found did not suit my needs. So I wrote this one:
https://github.com/mjiricka/archnews
It's in pure Python 3 and has many command line options. So maybe somebody else would be interested? :-)
MJ
FYI
There's a package in AUR called "cylon" that does that.
Type cylon -u for update report, needs pacaur and arch-audit installed also.
It shows you last 4 items of news feed and output of Arch-audit -q -u (CVE data)
Then number and names of all updates and then asks if you want to update system with pacaur.
Also here's a link to a thread on how to get the news feed in Bash.
https://bbs.archlinux.org/viewtopic.php?id=146850
Offline
FYI
There's a package in AUR called "cylon" that does that.
Type cylon -u for update report, needs pacaur and arch-audit installed also.
Thanks for the info! I did not know about "cylon". But it looks like a overkill for me to use it, I wouldn't use 99% of its functionality
Also here's a link to a thread on how to get the news feed in Bash.
https://bbs.archlinux.org/viewtopic.php?id=146850
I really think these days Python is much much better than Bash for things like this. Those `sed` commands are really hard to read. And in general HTML cannot be processed this way without making a lot of assumptions.
Last edited by mjiricka (2017-04-22 09:37:07)
Offline
I've written a wrapper that uses archnews to show the most recent news when -Syu is passed.
Hello mis! I liked your idea and I have decided to integrate these things a little bit more together. In repo is also script `archnews_wrap`. It must be run from the directory with `archnews` (it is temporary, archnews should be global one day).
It can show only unread messages, messages can be mark as read and I think it is quite complete solution.
It would be great if you check it and give me a feedback what you think about it!
Offline
I am very happy to announce I finally finished the tool and made AUR package for it!
AUR package: https://aur.archlinux.org/packages/archnews2/
once again the source repo: https://github.com/mjiricka/archnews
Feel free upvoting it! )
Offline