tazpkg rev 791
pkgs.cgi: fix package icon in the Live mode (when no way to determine current user session); tazpkg: show short package description when package installed.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Apr 28 18:10:22 2015 +0300 (2015-04-28) |
parents | 282a7aa2c41b |
children | 853e31a1523d |
files | applications/tazpanel-pkgs.desktop tazpanel/pkgs.cgi tazpkg |
line diff
1.1 --- a/applications/tazpanel-pkgs.desktop Sun Apr 26 19:18:53 2015 +0200 1.2 +++ b/applications/tazpanel-pkgs.desktop Tue Apr 28 18:10:22 2015 +0300 1.3 @@ -5,6 +5,6 @@ 1.4 Name[pt_BR]=Gerenciador de Pacotes 1.5 Name[ru]=Менеджер пакетов 1.6 TryExec=tazweb 1.7 -Exec=sh -c 'W=$HOME/.config/slitaz/subox.conf;[ -f $W ]||subox -;tazweb root:$(head $W)@tazpanel:82/pkgs.cgi' 1.8 +Exec=sh -c 'W=$HOME/.config/slitaz/subox.conf;[ -f $W ]||subox -;tazweb root:$(head $W)@127.0.0.1:82/user/pkgs.cgi' 1.9 Icon=tazpkg 1.10 Categories=Settings;System;PackageManager;
2.1 --- a/tazpanel/pkgs.cgi Sun Apr 26 19:18:53 2015 +0200 2.2 +++ b/tazpanel/pkgs.cgi Tue Apr 28 18:10:22 2015 +0300 2.3 @@ -98,6 +98,8 @@ 2.4 *\ app_img\ * ) 2.5 # Show application image 2.6 pkg=$(GET app_img) 2.7 + 2.8 + # check for icons defined with packages.icons file 2.9 if [ -f "$PKGS_DB/packages.icons" ]; then 2.10 predefined_icon="$(awk -F$'\t' -vpkg="$pkg" '{if ($1 == pkg) print $2}' $PKGS_DB/packages.icons)" 2.11 fi 2.12 @@ -106,18 +108,30 @@ 2.13 current_user="$(who | cut -d' ' -f1)" 2.14 if [ -n "$current_user" ]; then 2.15 current_user_home="$(awk -F: -vu=$current_user '{if($1==u) print $6}' /etc/passwd)" 2.16 - current_icon_theme="/usr/share/icons/$(grep gtk-icon-theme-name $current_user_home/.gtkrc-2.0 | cut -d'"' -f2)" 2.17 - default_pkg_icon="$(find -L $current_icon_theme -type f -path '*48*' -name $predefined_icon | head -n1)" 2.18 - pkg_icon="$(find -L $current_icon_theme -type f -path '*48*' -name "$pkg.png" | head -n1)" 2.19 - if [ -z "$pkg_icon" ]; then 2.20 - pkg_icon="$(find -L /usr/share/pixmaps -type f -name "$pkg.png" | head -n1)" 2.21 - fi 2.22 + current_icon_theme="$(grep gtk-icon-theme-name $current_user_home/.gtkrc-2.0 | cut -d'"' -f2)" 2.23 + fi 2.24 + current_icon_theme="/usr/share/icons/$current_icon_theme" 2.25 2.26 - header "Content-Type: image/png" 2.27 - cat "${pkg_icon:-$default_pkg_icon}" 2.28 - else 2.29 - default_pkg_icon="$(find -L /usr/share/icons -type f -name $predefined_icon | sort | tail -n1)" 2.30 + # Preferred default icon is 48px package-x-generic 2.31 + default_pkg_icon="$(find -L $current_icon_theme -type f -path '*48*' -name $predefined_icon | head -n1)" 2.32 + # ... or package-x-generic with the bigger size 2.33 + if [ -z "$default_pkg_icon" ]; then 2.34 + default_pkg_icon="$(find -L $current_icon_theme -type f -name $predefined_icon | sort | tail -n1)" 2.35 fi 2.36 + 2.37 + # Preferred package icon size is 48px 2.38 + pkg_icon="$(find -L $current_icon_theme -type f -path '*48*' -name "$pkg.png" | head -n1)" 2.39 + # ... or just bigger one 2.40 + if [ -z "$pkg_icon" ]; then 2.41 + pkg_icon="$(find -L $current_icon_theme -type f -name "$pkg.png" | sort | tail -n1)" 2.42 + fi 2.43 + # ... or one from pixmaps 2.44 + if [ -z "$pkg_icon" ]; then 2.45 + pkg_icon="$(find -L /usr/share/pixmaps -type f -name "$pkg.png" | head -n1)" 2.46 + fi 2.47 + 2.48 + header "Content-Type: image/png" 2.49 + cat "${pkg_icon:-$default_pkg_icon}" 2.50 exit 0 ;; 2.51 2.52
3.1 --- a/tazpkg Sun Apr 26 19:18:53 2015 +0200 3.2 +++ b/tazpkg Tue Apr 28 18:10:22 2015 +0300 3.3 @@ -691,6 +691,9 @@ 3.4 3.5 title 'Installation of package "%s"' $PACKAGE 3.6 3.7 + longline "$(awk -F$'\t' -vp="$PACKAGE" '{if($1==p){print $4;exit}}' $PKGS_DB/packages.info)" 3.8 + separator | tr -c $'\n' '-' 3.9 + 3.10 action 'Copying package...' 3.11 cp $PACKAGE_FILE $TMP_DIR 3.12 status