# HG changeset patch # User Aleksej Bobylev # Date 1418606847 -7200 # Node ID 58f001f8e2bcf477fc888b468a4c074fc3557d4e # Parent ed94753379126edbae32e0712a92a3d45023f982 Makefile: move icons to icons (i.e. clean pixmaps); tazpkg: typo; tazpkg-notify: fix messages. diff -r ed9475337912 -r 58f001f8e2bc Makefile --- a/Makefile Sun Dec 14 15:08:25 2014 +0000 +++ b/Makefile Mon Dec 15 03:27:27 2014 +0200 @@ -7,6 +7,7 @@ LINGUAS?=el es fr pl pt_BR ru sv zh_CN zh_TW VERSION:=$(shell grep ^VERSION=[0-9] tazpkg | cut -d '=' -f 2) +ICONS = $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32 tmpdir = tar-install/tazpkg-$(VERSION) tarball = tazpkg-$(VERSION).tar.gz @@ -79,7 +80,15 @@ mkdir -p $(DESTDIR)$(PREFIX)/share cp -a applications $(DESTDIR)$(PREFIX)/share #cp -a mime $(DESTDIR)$(PREFIX)/share # moved to shared-mime-info package - cp -a pixmaps $(DESTDIR)$(PREFIX)/share + + # Default icons + install -m 0755 -d $(ICONS)/apps + install -m 0644 pixmaps/tazpkg.png $(ICONS)/apps + ln -fs tazpkg.png $(ICONS)/apps/TazPkg.png # icon for Yad + install -m 0755 -d $(ICONS)/actions + install -m 0644 pixmaps/tazpkg-up.png $(ICONS)/actions + install -m 0755 -d $(ICONS)/status + install -m 0644 pixmaps/tazpkg-installed.png $(ICONS)/status # TazPkg Notify XDG autostart mkdir -p $(DESTDIR)/etc/xdg @@ -108,7 +117,9 @@ rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpkg-*.desktop rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpanel-pkgs.desktop - rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/tazpkg*.png + rm -f $(ICONS)/apps/tazpkg.png + rm -f $(ICONS)/actions/tazpkg-up.png + rm -f $(ICONS)/status/tazpkg-installed.png rm -f $(DESTDIR)/etc/xdg/autostart/tazpkg-notify.desktop diff -r ed9475337912 -r 58f001f8e2bc README --- a/README Sun Dec 14 15:08:25 2014 +0000 +++ b/README Mon Dec 15 03:27:27 2014 +0200 @@ -1,4 +1,4 @@ -README for TazPKG - Tiny autonomous packages manager +README for TazPkg - Tiny autonomous packages manager =============================================================================== diff -r ed9475337912 -r 58f001f8e2bc tazpkg --- a/tazpkg Sun Dec 14 15:08:25 2014 +0000 +++ b/tazpkg Mon Dec 15 03:27:27 2014 +0200 @@ -2241,7 +2241,7 @@ else footer "$(longline "$(_ "Last %s is ready to use. Note that \ next time you recharge the list, a list of differences will be displayed to \ -show new and upgradeable packages.") packages.list")" +show new and upgradeable packages." packages.list)")" fi done ;; diff -r ed9475337912 -r 58f001f8e2bc tazpkg-notify --- a/tazpkg-notify Sun Dec 14 15:08:25 2014 +0000 +++ b/tazpkg-notify Mon Dec 15 03:27:27 2014 +0200 @@ -12,35 +12,45 @@ # Authors : Christophe Lincoln # +. /lib/libtaz.sh +. /etc/slitaz/slitaz.conf + # I18n -. /lib/libtaz.sh export TEXTDOMAIN='tazpkg' +_() { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; } +_n() { local T="$1"; shift; printf "$(gettext "$T")" "$@"; } +_p() { + local S="$1" P="$2" N="$3"; shift; shift; shift; + printf "$(ngettext "$S" "$P" "$N")" "$@"; } + fifo=/tmp/$(basename $0).fifo panel="http://tazpanel:82/pkgs.cgi" -db="/var/lib/tazpkg" doc="file:///usr/share/doc/tazpkg/tazpkg.html" -installed=$(ls $db/installed | wc -l) +installed=$(wc -l < $PKGS_DB/installed.info) text="$(_p \ '%s installed package' \ '%s installed packages' $installed \ "$installed")" -icon="/usr/share/pixmaps/tazpkg.png" -[ -f "$db/packages.list" ] && mtime=$(find $db/packages.list -mtime +10;) -[ -f "$db/packages.up" ] && up=$(cat $db/packages.up | wc -l) + +[ -f "$PKGS_DB/packages.list" ] && mtime=$(find $PKGS_DB/packages.list -mtime +10;) +up=0; [ -f "$PKGS_DB/packages.up" ] && up=$(cat $PKGS_DB/packages.up | wc -l) # Notification icon listen() { # Manage the I/O redirection from SHell - rm -f $fifo && mkfifo $fifo + rm -f $fifo; mkfifo $fifo + # Attach a file descriptor exec 3<> $fifo + # Notification icon - yad --notification --listen --image=$icon \ - --text="$(_ 'Checking packages lists - %s' $text)" <&3 + yad --notification --listen --image='TazPkg' \ + --text="$(_ 'Checking packages lists - %s' "$text")" <&3 + # Clean-up rm -f $fifo } @@ -51,19 +61,19 @@ menu() { cat << EOT menu:\ -$(_ 'My packages' )!tazweb $panel?list!tazpkg|\ -$(_ 'Recharge lists' )!tazweb $panel?recharge!tazpkg-up|\ -$(_ 'Check upgrade' )!tazweb $panel?up!tazpkg-up|\ -$(_ 'TazPkg SHell' )!terminal -e tazpkg shell!xterm|\ -$(_ 'TazPkg manual' )!tazweb $doc!text-html|\ -$(_ 'Close notification')!quit!gtk-close +$(_n 'My packages' )!tazweb $panel?list!TazPkg|\ +$(_n 'Recharge lists' )!tazweb $panel?recharge!tazpkg-up|\ +$(_n 'Check upgrade' )!tazweb $panel?up!tazpkg-up|\ +$(_n 'TazPkg SHell' )!terminal -e tazpkg shell!utilities-terminal|\ +$(_n 'TazPkg manual' )!tazweb $doc!slitaz-doc|\ +$(_n 'Close notification')!quit!gtk-close EOT } case $1 in usage|help|*-h) - _ "Usage:"; echo " $(basename $0)" + _n "Usage:"; echo " $(basename $0)" ;; *) # Sleep before displaying the notification icon and @@ -73,35 +83,39 @@ sleep 2 menu > $fifo sleep 6 + # Missing packages list - if [ ! -f $db/packages.list ]; then - tooltip="$(_ 'No packages list found - %s' $text)" - echo "action:tazweb $panel?recharge" > $fifo - echo "tooltip:$tooltip" > $fifo - echo "icon:tazpkg-up" > $fifo + if [ ! -f $PKGS_DB/packages.list ]; then + tooltip="$(_ 'No packages list found - %s' "$text")" + (echo "action:tazweb $panel?recharge" + echo "tooltip:$tooltip" + echo "icon:tazpkg-up") > $fifo exit 0 fi + # Too old packages list if [ "$mtime" ]; then tooltip="$(_ 'Your packages list is older than 10 days')" - echo "action:tazweb $panel?recharge" > $fifo - echo "tooltip:$tooltip" > $fifo - echo "icon:tazpkg-up" > $fifo + (echo "action:tazweb $panel?recharge" + echo "tooltip:$tooltip" + echo "icon:tazpkg-up") > $fifo exit 0 fi + # Available upgrades if [ "$up" -gt 0 ]; then tooltip="$(_p \ 'There is %s upgradeable package' \ 'There are %s upgradeable packages' $up \ "$up")" - echo "action:tazweb $panel?up" > $fifo - echo "tooltip:$tooltip" > $fifo - echo "icon:tazpkg-up" > $fifo + (echo "action:tazweb $panel?up" + echo "tooltip:$tooltip" + echo "icon:tazpkg-up") > $fifo exit 0 fi + # Nothing to do, close notification - tooltip="$(_ 'System is up to date - %s' $text)" + tooltip="$(_ 'System is up to date - %s' "$text")" echo "tooltip:$tooltip" > $fifo sleep 10 echo "quit" > $fifo