Showing Slackware/Salix changelog in Xfce.

Other talk about Salix
Post Reply
User avatar
JRD
Salix Warrior
Posts: 950
Joined: 7. Jun 2009, 22:52
Location: Lyon, France

Showing Slackware/Salix changelog in Xfce.

Post by JRD »

Here is my way of showing the changelog of Slackware/Salix in Xfce:
Image
Image
First script (I put mine in /home/jrd/bin). changelog:

Code: Select all

#!/bin/bash
# vim: set syn=sh tw=0:
VER=0.1

URLS=(http://salix.enialis.net/i486/13.1/ChangeLog.txt http://salix.enialis.net/i486/slackware-13.1/ChangeLog.txt)
MAX_LINES=30
# colors:
#   0: black
#   1: red
#   2: green
#   3: brown
#   4: blue
#   5: magenta
#   6: cyan
#   7: grey
#   8: white
#   9: normal (white for FG, transparent for BG)
# bold: 1 if true, else 0
ADDED_COLORBG=9
ADDED_COLORFG=2
ADDED_BOLD=1
UPGRADED_COLORBG=9
UPGRADED_COLORFG=3
UPGRADED_BOLD=1
REMOVED_COLORBG=9
REMOVED_COLORFG=1
REMOVED_BOLD=1
REBUILT_COLORBG=9
REBUILT_COLORFG=6
REBUILT_BOLD=1
RELEASED_COLORBG=5
RELEASED_COLORFG=3
RELEASED_BOLD=1

help() {
	echo 'changelog: display the changelogs of Salix & Slackware.'
	echo 'syntax: changelog [-h|--help] [-v|--version] [-l|--lines NB_LINES]'
}

while [ ! -z "$1" ]; do
	case "$1" in
		'-h'|'--help')
			shift
			help
			exit 0
			;;
		'-v'|'--version')
			shift
			echo 'changelog: by Cyrille Pontvieux <jrd@enialis.net>'
			echo 'licence: GPLv3+'
			echo "version: $VER"
			exit 0
			;;
		'-l'|'--lines')
			shift
			[ -z "$1" ] || MAX_LINES=$1
			shift
			;;
		'-'*)
			shift
			help
			exit 1
			;;
		*)
			shift
			;;
	esac
done

COLOR_NONE=$(echo -en "\\033[0;0m")
COLOR_ADDED=$(echo -en "\\033[$((40 + $ADDED_COLORBG));$((30 + $ADDED_COLORFG));${ADDED_BOLD}m")
COLOR_UPGRADED=$(echo -en "\\033[$((40 + $UPGRADED_COLORBG));$((30 + $UPGRADED_COLORFG));${UPGRADED_BOLD}m")
COLOR_REMOVED=$(echo -en "\\033[$((40 + $REMOVED_COLORBG));$((30 + $REMOVED_COLORFG));${REMOVED_BOLD}m")
COLOR_REBUILT=$(echo -en "\\033[$((40 + $REBUILT_COLORBG));$((30 + $REBUILT_COLORFG));${REBUILT_BOLD}m")
COLOR_RELEASED=$(echo -en "\\033[$((40 + $RELEASED_COLORBG));$((30 + $RELEASED_COLORFG));${RELEASED_BOLD}m")
for u in ${URLS[*]}; do
	echo -en "\\033[0;46;34m"
	echo -en '/————————————————————————————————————————————————————————————————————————————\'
	echo -e "\\033[0;0m"
	echo -en "\\033[0;46;34m"
	echo -en '|                                                                            |'
	echo -en "\r|   $u"
	echo -e "\\033[0;0m"
	echo -en "\\033[0;46;34m"
	echo -en '\————————————————————————————————————————————————————————————————————————————/'
	echo -e "\\033[0;0m\n"
	wget "$u" -q -O - | head -n$MAX_LINES | sed "s/^[^A-Z+]/    \\0/;s/^/  /;
	s/Added\./$COLOR_ADDED\\0$COLOR_NONE/;
	s/Upgraded\./$COLOR_UPGRADED\\0$COLOR_NONE/;
	s/Removed\./$COLOR_REMOVED\\0$COLOR_NONE/;
	s/Rebuilt\./$COLOR_REBUILT\\0$COLOR_NONE/;
	s/[^ ].*released.*/$COLOR_RELEASED\\0$COLOR_NONE/;"
	echo ''
done
Second script. changelogX:

Code: Select all

#!/bin/sh
cd $(dirname $0)
terminal --title='Salix changelogs' --icon=salix-web --maximize --hide-menubar --hide-toolbars --hold -x ./changelog -l 100
Then create a launcher in the Xfce panel who run changelogX.
Image
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: Showing Slackware/Salix changelog in Xfce.

Post by thenktor »

And now let's do a freedesktop compatible version that lives in the systray ;)
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
JRD
Salix Warrior
Posts: 950
Joined: 7. Jun 2009, 22:52
Location: Lyon, France

Re: Showing Slackware/Salix changelog in Xfce.

Post by JRD »

Why not :) Myabe If I have time, or maybe somebody could try ;-)
Image
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: Showing Slackware/Salix changelog in Xfce.

Post by thenktor »

Probably the salix-update-notifier can be adopted for this.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
zAchAry
Posts: 804
Joined: 11. May 2010, 09:02
Location: Israel

Re: Showing Slackware/Salix changelog in Xfce.

Post by zAchAry »

That's really cool!
Image
Help to make Slackware easier Donate to Salix
Post Reply