tazpkg view tazpkg-box @ rev 633

Add Polish translation (thanks Pawel Pyrczak); merge tazpkg, tazpkg-notify and other *pkg* translations into one; simplify plural translations using $num; normalize name (Tazpkg, TazPKG -> TazPkg); move markup outside translations; re-use categories names in tazpkg and tazpanel; other tiny improvements.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Jul 25 01:47:48 2013 +0300 (2013-07-25)
parents de952705379e
children 192b971ccc93
line source
1 #!/bin/sh
2 #
3 # Small GTK boxes to TazPkg for deep desktop integration. PcmanFM 0.5.x has a
4 # patch to extract a TazPkg file but not Thunar and other FM. TazPkgBox tries
5 # to follow freedesktop standards.
6 #
7 # Copyright (C) 2011-2013 SliTaz GNU/Linux - GNU GPL v2
8 #
9 # Authors: Christophe Lincoln <pankso@slitaz.org>
10 #
12 # Internationalization.
13 . /usr/bin/gettext.sh
14 TEXTDOMAIN='tazpkg'
15 export TEXTDOMAIN
17 title=$(gettext "TazPkg Action")
18 icon="/usr/share/pixmaps/tazpkg.png"
19 opts="--image=tazpkg --image-on-top --center --on-top"
21 # Nice GTK output for install and extract.
22 output() {
23 yad --text-info $opts --text="<b>$title</b>" \
24 --height=260 --width=520 --title="$title" --window-icon=$icon \
25 --tail --margins=4 --button="gtk-close:0"
26 }
28 # Main GUI box function with pure Yad spec
29 actions_main() {
30 pkgname=${pkg%.tazpkg}
31 text=$(eval_gettext 'Package name: <b>$pkgname</b>')
32 yad --text="$text" $opts \
33 --title="$title" \
34 --window-icon=$icon \
35 --button="$(gettext 'Install'):3" --button="$(gettext 'Extract'):2" \
36 --button="gtk-cancel:1"
37 }
39 # Actions user can do when clicking on a package.
40 actions() {
41 # Store box results
42 main=$(actions_main)
43 ret=$?
44 # Deal with --button values
45 case $ret in
46 1) exit 0 ;;
47 2) tazpkg extract $pkg . --output="raw" | output ;;
48 3) tazpkg -i $pkg . --forced --output="raw" | output ;;
49 esac
50 }
52 # TazPkg URL Handler.
53 dl_inst() {
54 pkg=$(basename $url)
55 eval_gettext "Downloading: \$pkg"; echo -e "\n"
56 cd /tmp && wget $url 2>&1
57 tazpkg -i $pkg --forced --output="raw" 2>&1
58 rm -f $pkg
59 }
61 #
62 # Script commands
63 #
65 case "$1" in
66 usage|help|-u|-h)
67 echo "$(gettext 'Usage:') $(basename $0) [actions|$(gettext 'URL')] \
68 [$(gettext 'package')]" ;;
69 tazpkg://*)
70 # TazPkg URL's handler.
71 url="http://${1#tazpkg://}"
72 dl_inst | output ;;
73 actions)
74 pkg=$(basename $2)
75 cd $(dirname $2)
76 actions ;;
77 esac
79 exit 0