tazpkg view tazpkg-box @ rev 554

Tiny edits
author Paul Issott <paul@slitaz.org>
date Thu Mar 01 18:22:00 2012 +0000 (2012-03-01)
parents 552f89fab93a
children ab830ecf3a8a
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 TazPKG file but not Thunar and other FM. TazPKGbox tries to
5 # follow freedesktop standards.
6 #
7 # Copyright (C) 2012 SliTaz GNU/Linux - GNU gpl v2
8 #
9 # Authors : Christophe Lincoln <pankso@slitaz.org>
10 #
12 # Main GUI box function with pure Yad spec
13 actions_main() {
14 title=$(gettext "TazPKG actions")
15 text=$(gettext "Package file name:")
16 yad --text="$text <b>$pkg</b>" \
17 --width=520 --height=80 --dialog-sep \
18 --center --on-top --window-icon="tazpkg" \
19 --image="tazpkg" --image-on-top \
20 --button="Install:3" --button="Extract:2" \
21 --button="gtk-close:1"
22 }
24 # Actions user can do when clicking on a package.
25 actions() {
26 # Store box results
27 main=$(actions_main)
28 ret=$?
29 # Deal with --button values
30 case $ret in
31 1) exit 0 ;;
32 2) terminal -e "tazpkg extract $pkg" && exit 0 ;;
33 3) terminal -e "tazpkg -i $pkg --forced" && exit 0 ;;
34 esac
35 }
37 #
38 # Script commands
39 #
41 case "$1" in
42 usage)
43 echo "Usage: $(basename $0) [command]" ;;
44 actions)
45 pkg="$2"
46 actions ;;
47 esac
49 exit 0