<---- template headericclude ----->
Bash Scripts using Zenity
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2005
    Location
    NKY
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Bash Scripts using Zenity

    Everyone,

    im trying to learn bash+zenity

    help me by......

    posting your favorite bash script (or 2,3, etc).......

    preferably ones that use Zenity .......

    ----- MAKE SURE YOU GIVE US SOME IDEA OF WHAT IT DOES PLEASE!!!--------

    remote2someone

    this script lets a user
    --1 - Make Remote Connection--- via ssh
    --2 - display Remote Desktop---- via vncviewer
    --3 - Remote X11 tunnel -----------via ssh -X

    can be called from command line or from a custom launcher

    it opens a new terminal and leaves it open with the connect dialog
    until USER exits

    thanks fedora-jim

    Code:
    #!/bin/bash  
    # Written by wtg_photos
    # Edited from fedora-jim's original
    #
    #
    # enter the IP address ofthe remote PC 
    IPADDRESS="$(zenity --entry --title "Enter IP Address" --text "Enter the IP Address of the remote PC:")"
    echo $IPADDRESS
    #Enter the username you aregoing to login with 
    UserName="$(zenity --entry --title "Enter User  Name" --text "Enter the User Name to connect with:")"
    echo $UserName
    # opens a new terminal window and connects to remote PC
    function ssh_Remote_PC
    {
    gnome-terminal -x ssh -L 5911:$IPADDRESS:5901 $UserName@$IPADDRESS
    }
    function View_Remote_PC
    {
    gnome-terminal -x vncviewer $IPADDRESS:0
    }
    function X11_Remote_PC
    {
    gnome-terminal -x ssh -X $UserName@$IPADDRESS
    }
    #################################################
    selection=
    until [ "$selection" = "0" ]; do
    echo ""
    echo "######################"
    echo "1 - Make Remote Connection"
    echo "2 - display Remote Desktop"
    echo "3 - Remote X11 tunnel"
    echo "0 - exit program"
    echo ""
    echo -n "Enter selection: "
    read selection
    echo ""
    #####################
    # Commands executed #
    #####################
    case $selection in
    1 ) $(ssh_Remote_PC) ;;
    2 ) $(View_Remote_PC) ;;
    3 ) $(X11_Remote_PC) ;;
    0 ) exit ;;
    * ) echo "Please enter 1, 2, 3  or 0"
    esac
    done

  2. #2
    Join Date
    Aug 2007
    Location
    London Postbox (the red one)
    Age
    58
    Posts
    3,868
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi
    there is very good examples and instructions for zenity already on your machine
    press F1 to bring up help and look under applications

  3. #3
    Join Date
    May 2005
    Location
    NKY
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you ....... that is useful

    i was just curious
    if anyone had some
    that they wrote/ edited themselves

    and use (at least on occasion)

    of course you (DM)have your install helper autoeight and autonine .......
    very nice work........

Similar Threads

  1. xinetd and bash scripts
    By fc6n27 in forum Security and Privacy
    Replies: 2
    Last Post: 15th July 2009, 06:06 PM
  2. bash script/zenity question
    By daviddoria in forum Using Fedora
    Replies: 4
    Last Post: 20th October 2008, 07:15 PM
  3. bash scripts
    By oblufire in forum Programming & Packaging
    Replies: 11
    Last Post: 11th August 2008, 12:28 PM
  4. Zenity + bash script question
    By Duli in forum Programming & Packaging
    Replies: 14
    Last Post: 6th January 2008, 07:15 PM
  5. ls -ltrG with bash scripts
    By n3twrkm4n in forum Using Fedora
    Replies: 2
    Last Post: 17th April 2006, 01:19 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]