slitaz-tools diff boxes/scp-box @ rev 945

Add Name[fr] in .desktop
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jul 12 17:58:23 2015 +0200 (2015-07-12)
parents c79e656b37a5
children bffe37afb546
line diff
     1.1 --- a/boxes/scp-box	Sat Jan 04 14:32:42 2014 +0000
     1.2 +++ b/boxes/scp-box	Sun Jul 12 17:58:23 2015 +0200
     1.3 @@ -2,32 +2,40 @@
     1.4  #
     1.5  # SCP Box - Small front end to the secure file copy utility.
     1.6  #
     1.7 -# Copyright (C) 2008-2014 SliTaz GNU/Linux - BSD License
     1.8 +# Copyright (C) 2008-2015 SliTaz GNU/Linux - BSD License
     1.9  #
    1.10  # Author: Christophe Lincoln <pankso@slitaz.org>
    1.11  #
    1.12 +
    1.13  . /lib/libtaz.sh
    1.14  export TEXTDOMAIN='slitaz-boxes' # i18n
    1.15  
    1.16  [ "$file" ] || file="$HOME"
    1.17  [ "$dir" ] || dir="$HOME"
    1.18  
    1.19 +
    1.20  # Internal variables (we need a space before options).
    1.21 +
    1.22  config=$HOME/.config/scpbox
    1.23  term="terminal -geometry 80x16"
    1.24  scpopts=" -r -P 22"
    1.25  
    1.26 +
    1.27  # Make sure we have config files.
    1.28 +
    1.29  if [ ! -d "$config" ] || [ -f "$config/hosts" ]; then
    1.30  	mkdir -p $config
    1.31  	touch $config/hosts && chmod 0600 $config/hosts
    1.32  fi
    1.33  
    1.34 +
    1.35  #
    1.36  # Functions
    1.37  #
    1.38  
    1.39 +
    1.40  # Help and usage
    1.41 +
    1.42  usage() {
    1.43  	cat << EOT
    1.44  
    1.45 @@ -49,16 +57,20 @@
    1.46  EOT
    1.47  }
    1.48  
    1.49 +
    1.50  # List last used hosts.
    1.51 +
    1.52  list_hosts() {
    1.53  	for h in $(cat $config/hosts); do
    1.54  		echo -n "!$h"
    1.55  	done
    1.56  }
    1.57  
    1.58 +
    1.59  # Main GUI box function with pure Yad spec
    1.60 +
    1.61  scpbox_main() {
    1.62 -	icon=folder-remote
    1.63 +	icon='folder-remote'
    1.64  	yad --title="$(_n 'SCP Box')" --window-icon=$icon \
    1.65  		--width=400 \
    1.66  		--image=$icon --image-on-top \
    1.67 @@ -76,7 +88,9 @@
    1.68  		--button="gtk-close:1"
    1.69  }
    1.70  
    1.71 +
    1.72  # Main function
    1.73 +
    1.74  scpbox() {
    1.75  	# Store box results
    1.76  	main=$(scpbox_main)
    1.77 @@ -129,6 +143,7 @@
    1.78  	esac
    1.79  }
    1.80  
    1.81 +
    1.82  #
    1.83  # Commands
    1.84  #