slitaz-tools rev 967

Add tazbox vnc
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Mar 15 22:50:01 2016 +0100 (2016-03-15)
parents 9b12f3318e8d
children d03619dfe1bf
files applications/tazbox-vnc.desktop tazbox/tazbox
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/applications/tazbox-vnc.desktop	Tue Mar 15 22:50:01 2016 +0100
     1.3 @@ -0,0 +1,6 @@
     1.4 +[Desktop Entry]
     1.5 +Type=Application
     1.6 +Name=VNC viewer
     1.7 +Exec=tazbox vnc
     1.8 +Icon=video-display
     1.9 +Categories=Utility;
     2.1 --- a/tazbox/tazbox	Sun Feb 14 09:57:57 2016 +0100
     2.2 +++ b/tazbox/tazbox	Tue Mar 15 22:50:01 2016 +0100
     2.3 @@ -55,7 +55,8 @@
     2.4  new-file	$(_ 'Create a new file or folder on the desktop')
     2.5  all-apps	$(_ 'Display icons of all installed applications')
     2.6  notify		$(_ 'Notify user with a desktop centered box')
     2.7 -tazapps		$(_ 'Configure SliTaz default applications')"
     2.8 +tazapps		$(_ 'Configure SliTaz default applications')
     2.9 +vnc		$(_ 'Launch a framebuffer VNC viewer')"
    2.10  	newline
    2.11  }
    2.12  
    2.13 @@ -602,6 +603,42 @@
    2.14  }
    2.15  
    2.16  
    2.17 +vnc_main() {
    2.18 +	icon='video-display'
    2.19 +	yad --title="$(_n 'Framebuffer VNC viewer')" --window-icon="$icon" \
    2.20 +		--width='460' --height='160' --on-top --center \
    2.21 +		--image="$icon" --image-on-top \
    2.22 +		--icon="$icon" \
    2.23 +		--text="<b>$(_n 'Remote display connection')</b>" \
    2.24 +		--entry --entry-label="$(_n 'Server')" \
    2.25 +		--always-print-result \
    2.26 +		--button="$(_n 'Via a SSH tunnel')!application-x-shellscript:2" \
    2.27 +		--button="$(_n 'On this console')!xterm:1" \
    2.28 +		--button="$(_n 'In a new console')!computer:0"
    2.29 +}
    2.30 +
    2.31 +
    2.32 +newvt()
    2.33 +{
    2.34 +	ask_root newvt $@ || return
    2.35 +	openvt -sw $@
    2.36 +	deallocvt
    2.37 +}
    2.38 +
    2.39 +
    2.40 +vnc() { 
    2.41 +	server=$(vnc_main)
    2.42 +	status=$?
    2.43 +	# Deal with --button values
    2.44 +	[ -n "$server" ] &&
    2.45 +	case "$status$server" in
    2.46 +	2*|*@*)	newvt sshfbvnc $server ;;
    2.47 +	1*)	fbvnc $server ;;
    2.48 +	0*)	newvt fbvnc $server ;;
    2.49 +	esac
    2.50 +}
    2.51 +
    2.52 +
    2.53  #
    2.54  # Commands
    2.55  #
    2.56 @@ -777,6 +814,14 @@
    2.57  			--button 'OK' < /usr/share/licenses/gpl.txt
    2.58  		;;
    2.59  
    2.60 +	vnc)
    2.61 +		vnc
    2.62 +		;;
    2.63 +
    2.64 +	newvt)
    2.65 +		$@
    2.66 +		;;
    2.67 +
    2.68  	*)
    2.69  		usage
    2.70  		;;