tazpkg view tazpkg-box @ rev 579
Update docs
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Sun Apr 01 16:48:06 2012 +0100 (2012-04-01) |
parents | da3bd3962a3e |
children | 59ac27af090d |
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) 2012 SliTaz GNU/Linux - GNU gpl v2
8 #
9 # Authors : Christophe Lincoln <pankso@slitaz.org>
10 #
12 icon="/usr/share/pixmaps/tazpkg.png"
14 # Main GUI box function with pure Yad spec
15 actions_main() {
16 title=$(gettext "TazPKG actions")
17 text=$(gettext "Package name:")
18 yad --text="$text <b>${pkg%.tazpkg}</b>" \
19 --title="$title" --width=480 --height=100 \
20 --center --on-top --window-icon=$icon \
21 --image="tazpkg" --image-on-top \
22 --button="Install:3" --button="Extract:2" \
23 --button="gtk-close:1"
24 }
26 # Actions user can do when clicking on a package.
27 actions() {
28 # Store box results
29 main=$(actions_main)
30 ret=$?
31 # Deal with --button values
32 case $ret in
33 1) exit 0 ;;
34 2) tazpkg extract $pkg | $0 output ;;
35 3) tazpkg -i $pkg --forced | $0 output ;;
36 esac
37 }
39 #
40 # Script commands
41 #
43 case "$1" in
44 usage|help|-u|-h)
45 echo "Usage: $(basename $0) [command] [pkg|cmd]" ;;
46 output)
47 # Nice GTK output for install and extract.
48 sed -e s'/\[^Gm]*./ /g' -e s'/^=.*//' | \
49 yad --text-info \
50 --width=480 --height=260 --center --on-top \
51 --title="TazPKG" --window-icon=$icon \
52 --margins=4 --button="gtk-close:0" ;;
53 actions)
54 pkg=$(basename $2)
55 cd $(dirname $2)
56 actions ;;
57 esac
59 exit 0