# HG changeset patch # User Christophe Lincoln # Date 1330524127 -3600 # Node ID 1eb660b3a57acb337ee5a3785ab97ad9d765b955 # Parent b93153a8023f5c6561b3b0a6c01eabb9746d3dc7 Add tazpkg-box (replace tazpkgbox-install to perform actions on package from file managers) diff -r b93153a8023f -r 1eb660b3a57a applications/tazpkg-box.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/applications/tazpkg-box.desktop Wed Feb 29 15:02:07 2012 +0100 @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Tazpkg Manager +Name[fr]=Gestionnaire de TazPKG +Exec=tazbox su "tazpkg-box actions ""%f""" +Icon=tazpkg +NoDisplay=True +Type=Application +Terminal=false +MimeType=application/x-tazpkg; diff -r b93153a8023f -r 1eb660b3a57a applications/tazpkg-install.desktop --- a/applications/tazpkg-install.desktop Sun Feb 19 10:43:48 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Package install -Name[fr]=Installation de paquet -Comment=Manage software packages -Exec=subox "tazpkgbox-install ""%f""" -Icon=tazpkg -NoDisplay=True -Type=Application -Terminal=false -MimeType=application/x-tazpkg; diff -r b93153a8023f -r 1eb660b3a57a oldstuff/tazpkg-install.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oldstuff/tazpkg-install.desktop Wed Feb 29 15:02:07 2012 +0100 @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Package install +Name[fr]=Installation de paquet +Comment=Manage software packages +Exec=subox "tazpkgbox-install ""%f""" +Icon=tazpkg +NoDisplay=True +Type=Application +Terminal=false +MimeType=application/x-tazpkg; diff -r b93153a8023f -r 1eb660b3a57a oldstuff/tazpkgbox-install --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oldstuff/tazpkgbox-install Wed Feb 29 15:02:07 2012 +0100 @@ -0,0 +1,46 @@ +#!/bin/sh +# +# GTKdialog interface to SliTaz Packages Manager aka Tazpkg. Note: +# Notebook tabs are vbox, tabs are used to indent and functions are +# split and found in $LIB. +# +# (C) GNU gpl v3 - SliTaz GNU/Linux 2010. +# + +export PKG="$@" +export PKG_SHORT_NAME=$(basename $PKG) + + +# Tazpkgbox is only for root. +if test $(id -u) != 0 ; then + exec subox tazpkgbox-install $PKG + exit 0 +fi + + + +# English/French help dialog. +export MAIN_DIALOG=" + + + + + + + + + + + +" + +gtkdialog --center --program=MAIN_DIALOG >/dev/null + +exit 0 diff -r b93153a8023f -r 1eb660b3a57a tazpkg-box --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-box Wed Feb 29 15:02:07 2012 +0100 @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Small GTK boxes to TazPKG for deep desktop integration. PcmanFM 0.5.x have a +# patch to extract TazPKG file but not Thunar and othet FM. TazPKGbox try to +# follow freedesktop standards. +# +# Copyright (C) 2012 SliTaz GNU/Linux - GNU gpl v2 +# +# Authors : Christophe Lincoln +# + +# Main GUI box function with pure Yad spec +actions_main() { + title=$(gettext "TazPKG actions") + text=$(gettext "Package file name:") + yad --text="$text $pkg" \ + --width=520 --height=80 --dialog-sep \ + --center --on-top --window-icon="tazpkg" \ + --image="tazpkg" --image-on-top \ + --button="Install:3" --button="Extract:2" \ + --button="gtk-close:1" +} + +# Actions user can do when clicking on a package. +actions() { + # Store box results + main=$(actions_main) + ret=$? + # Deal with --button values + case $ret in + 1) exit 0 ;; + 2) tazpkg extract $pkg && exit 0 ;; + 3) tazpkg -i $pkg --forced | tazbox out && exit 0 ;; + esac +} + +# +# Script commands +# + +case "$1" in + usage) + echo "Usage: $(basename $0) [command]" ;; + actions) + pkg="$2" + actions ;; +esac + +exit 0 + diff -r b93153a8023f -r 1eb660b3a57a tazpkgbox-install --- a/tazpkgbox-install Sun Feb 19 10:43:48 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -#!/bin/sh -# -# GTKdialog interface to SliTaz Packages Manager aka Tazpkg. Note: -# Notebook tabs are vbox, tabs are used to indent and functions are -# split and found in $LIB. -# -# (C) GNU gpl v3 - SliTaz GNU/Linux 2010. -# - -export PKG="$@" -export PKG_SHORT_NAME=$(basename $PKG) - - -# Tazpkgbox is only for root. -if test $(id -u) != 0 ; then - exec subox tazpkgbox-install $PKG - exit 0 -fi - - - -# English/French help dialog. -export MAIN_DIALOG=" - - - - - - - - - - - -" - -gtkdialog --center --program=MAIN_DIALOG >/dev/null - -exit 0