tazpkg rev 555
tazpkg-box: Improove desktop integration, output tazpkg cmd to a GTK box
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Mar 02 11:21:19 2012 +0100 (2012-03-02) |
parents | 25ebb1a6e665 |
children | b52c1a1105e2 |
files | applications/tazpkg-box.desktop tazpkg-box |
line diff
1.1 --- a/applications/tazpkg-box.desktop Thu Mar 01 18:22:00 2012 +0000 1.2 +++ b/applications/tazpkg-box.desktop Fri Mar 02 11:21:19 2012 +0100 1.3 @@ -2,7 +2,7 @@ 1.4 Encoding=UTF-8 1.5 Name=Tazpkg Manager 1.6 Name[fr]=Gestionnaire de TazPKG 1.7 -Exec=tazbox su "tazpkg-box actions ""%f""" 1.8 +Exec=tazbox su tazpkg-box actions ""%f"" 1.9 Icon=tazpkg 1.10 NoDisplay=True 1.11 Type=Application
2.1 --- a/tazpkg-box Thu Mar 01 18:22:00 2012 +0000 2.2 +++ b/tazpkg-box Fri Mar 02 11:21:19 2012 +0100 2.3 @@ -1,7 +1,7 @@ 2.4 #!/bin/sh 2.5 # 2.6 -# Small GTK boxes to TazPKG for deep desktop integration. PcmanFM 0.5.x has a 2.7 -# patch to extract TazPKG file but not Thunar and other FM. TazPKGbox tries to 2.8 +# Small GTK boxes to TazPKG for deep desktop integration. PcmanFM 0.5.x have a 2.9 +# patch to extract TazPKG file but not Thunar and othet FM. TazPKGbox try to 2.10 # follow freedesktop standards. 2.11 # 2.12 # Copyright (C) 2012 SliTaz GNU/Linux - GNU gpl v2 2.13 @@ -9,13 +9,15 @@ 2.14 # Authors : Christophe Lincoln <pankso@slitaz.org> 2.15 # 2.16 2.17 +icon="/usr/share/pixmaps/tazpkg.png" 2.18 + 2.19 # Main GUI box function with pure Yad spec 2.20 actions_main() { 2.21 title=$(gettext "TazPKG actions") 2.22 - text=$(gettext "Package file name:") 2.23 - yad --text="$text <b>$pkg</b>" \ 2.24 - --width=520 --height=80 --dialog-sep \ 2.25 - --center --on-top --window-icon="tazpkg" \ 2.26 + text=$(gettext "Package name:") 2.27 + yad --text="$text <b>${pkg%.tazpkg}</b>" \ 2.28 + --title="$title" --width=480 --height=100 \ 2.29 + --center --on-top --window-icon=$icon \ 2.30 --image="tazpkg" --image-on-top \ 2.31 --button="Install:3" --button="Extract:2" \ 2.32 --button="gtk-close:1" 2.33 @@ -29,8 +31,8 @@ 2.34 # Deal with --button values 2.35 case $ret in 2.36 1) exit 0 ;; 2.37 - 2) terminal -e "tazpkg extract $pkg" && exit 0 ;; 2.38 - 3) terminal -e "tazpkg -i $pkg --forced" && exit 0 ;; 2.39 + 2) tazpkg extract $pkg | $0 output ;; 2.40 + 3) tazpkg -i $pkg --forced | $0 output ;; 2.41 esac 2.42 } 2.43 2.44 @@ -39,10 +41,19 @@ 2.45 # 2.46 2.47 case "$1" in 2.48 - usage) 2.49 - echo "Usage: $(basename $0) [command]" ;; 2.50 + usage|help|-u|-h) 2.51 + echo "Usage: $(basename $0) [command] [pkg|cmd]" ;; 2.52 + output) 2.53 + # Nice GTK output for install and extract. 2.54 + sed -e s'/\[^Gm]*./ /g' -e s'/^=.*//' | \ 2.55 + yad --text-info \ 2.56 + --width=480 --height=260 --center --on-top \ 2.57 + --title="TazPKG" --window-icon=$icon \ 2.58 + --fore="#ffffff" --back="#000000" --wrap \ 2.59 + --margins=4 --button="gtk-close:0" ;; 2.60 actions) 2.61 - pkg="$2" 2.62 + pkg=$(basename $2) 2.63 + cd $(dirname $2) 2.64 actions ;; 2.65 esac 2.66