Made New App and Some error i Don't understand...

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
Lord_Solrac2
Posts: 35
Joined: Thu 23 Dec 2010, 00:58
Location: Gurabo, Puerto Rico
Contact:

Made New App and Some error i Don't understand...

#1 Post by Lord_Solrac2 »

Hey, I was Making an app (I'm a total noob in the gktdialog3 so yea ^^") For iMount (1st Puppy App :D) When I Tried The Script (3 Tries) I Got the Same...

Here's The Code::
(I Still Own it xD)

The main (1st error) is removed and replaced with the sands line
The Main Error (Fixed Though)

Code: Select all

#iMount Process

#iDevice
if [ $IDEV = "iPod" ]; then
 fty=/mnt/$name-iPod
elif [ $IDEV = "iPhone" ]; then
 fty=/mnt/$name-iPhone
elif [ $IDEV = "iPad" ]; then
 fty=/mnt/$name-iPad
fi

#Mount
if [ $mnt2 = "/" ]; then
 mnt3=/
elif [ $mnt2 = "/var/mobile" ]; then
 mnt3=/var/mobile
fi
New Error::

Code: Select all

!/bin/bash
#iMount 1.7 
export CHOOSER="
<window title=\"iMount 1.7 by Lord_Solrac2\"icon-name=\"gtk-cdrom\">
<vbox>

<frame Select an iDevice>
 <combobox>
  <variable>IDEV</variable>
  <item>iPod</item>
  <item>iPhone</item>
  <item>iPad</item>
 </combobox>
</frame>

<frame Select Mount Area>
 <combobox>
  <variable>mnt2</variable>
   <item>/</item>
   <item>/var/mobile</item>
 </combobox>
</frame>

<frame What's Your Name?>
<hbox>
 <entry editable=\"true\">
 <variable>name</variable>
  </entry>
 </hbox>
</frame>

<frame IP Address (Settings > Wifi > Connection = DHCP) >
<hbox>
 <entry editable=\"true\">
 <variable>ipa</variable>
  </entry>
 </hbox>
</frame>

<hbox>
<button>
<variable>start</variable>
<input file icon=\"gkt0ok\"></imput>
<label>Start iMount (Remember Pass = alpine)<label>
<visible>true</visible>
<action type=\"exit\">EXIT_NOW</action>
</button>
</hbox>
</vbox>
</window>
"
CHOOSER2=='gtkdialog3 --program=CHOOSER --center'

if [ "`echo $CHOOSER2 | grep EXIT_NOW`" != "" ]; then 
exit 0 
fi

urxvt -e sshfs root@$ipa:$mnt2 /mnt/$name-$IDEV
Can Some one Explain? D: It Crashes the instant it opens... And No Error on the Terminal.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#2 Post by zigbert »

You could try this:

Code: Select all

#!/bin/bash
#iMount 1.7
export CHOOSER="
<window title=\"iMount 1.7 by Lord_Solrac2\"icon-name=\"gtk-cdrom\">
<vbox>

<frame Select an iDevice>
 <combobox>
  <variable>IDEV</variable>
  <item>iPod</item>
  <item>iPhone</item>
  <item>piece of crap</item>
 </combobox>
</frame>

<frame Select Mount Area>
 <combobox>
  <variable>mnt2</variable>
   <item>/</item>
   <item>/var/mobile</item>
 </combobox>
</frame>

<frame What's Your Name?>
<hbox>
 <entry editable=\"true\">
 <variable>name</variable>
  </entry>
 </hbox>
</frame>

<frame IP Address (Settings ... Wifi ... Connection = DHCP) >
<hbox>
 <entry editable=\"true\">
 <variable>ipa</variable>
  </entry>
 </hbox>
</frame>

<hbox>
<button>
<variable>start</variable>
<input file icon=\"gtk-ok\"></input>
<label>Start iMount (Remember Pass = alpine)</label>
<visible>true</visible>
<action type=\"exit\">EXIT_NOW</action>
</button>
</hbox>
</vbox>
</window>
"
CHOOSER2==`gtkdialog3 --program=CHOOSER --center`
[ ! "`echo $CHOOSER2 | grep EXIT_NOW`" ] && exit 0

urxvt -e sshfs root@$ipa:$mnt2 /mnt/$name-$IDEV 

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#3 Post by rcrsn51 »

Code: Select all

CHOOSER2==`gtkdialog3 --program=CHOOSER --center` 
Do you really want the double equal sign?

Lord_Solrac2
Posts: 35
Joined: Thu 23 Dec 2010, 00:58
Location: Gurabo, Puerto Rico
Contact:

#4 Post by Lord_Solrac2 »

zigbert wrote:You could try this:

Code: Select all

#!/bin/bash
#iMount 1.7
export CHOOSER="
<window title="iMount 1.7 by Lord_Solrac2"icon-name="gtk-cdrom">
<vbox>

<frame Select an iDevice>
 <combobox>
  <variable>IDEV</variable>
  <item>iPod</item>
  <item>iPhone</item>
  <item>piece of crap</item>
 </combobox>
</frame>

<frame Select Mount Area>
 <combobox>
  <variable>mnt2</variable>
   <item>/</item>
   <item>/var/mobile</item>
 </combobox>
</frame>

<frame What's Your Name?>
<hbox>
 <entry editable="true">
 <variable>name</variable>
  </entry>
 </hbox>
</frame>

<frame IP Address (Settings ... Wifi ... Connection = DHCP) >
<hbox>
 <entry editable="true">
 <variable>ipa</variable>
  </entry>
 </hbox>
</frame>

<hbox>
<button>
<variable>start</variable>
<input file icon="gtk-ok"></input>
<label>Start iMount (Remember Pass = alpine)</label>
<visible>true</visible>
<action type="exit">EXIT_NOW</action>
</button>
</hbox>
</vbox>
</window>
"
CHOOSER2==`gtkdialog3 --program=CHOOSER --center`
[ ! "`echo $CHOOSER2 | grep EXIT_NOW`" ] && exit 0

urxvt -e sshfs root@$ipa:$mnt2 /mnt/$name-$IDEV 
The GUI Works But Then The Terminal Doesn't D:

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#5 Post by zigbert »

The GUI Works But Then The Terminal Doesn't D:
you could probably do something like this:

Code: Select all

echo "urxvt -e sshfs root@$ipa:$mnt2 /mnt/$name-$IDEV" > /tmp/exec
chmod 722 /tmp/exec
/tmp/exec

Lord_Solrac2
Posts: 35
Joined: Thu 23 Dec 2010, 00:58
Location: Gurabo, Puerto Rico
Contact:

#6 Post by Lord_Solrac2 »

zigbert wrote:
The GUI Works But Then The Terminal Doesn't D:
you could probably do something like this:

Code: Select all

echo "urxvt -e sshfs root@$ipa:$mnt2 /mnt/$name-$IDEV" > /tmp/exec
chmod 722 /tmp/exec
/tmp/exec
Still The Same Problem :S
Attachments
imnt-2.0-alpha.tar.gz
Test.sh File
(683 Bytes) Downloaded 299 times

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#7 Post by zigbert »

hello Lord_Solrac2
I have rewritten the execution part to be similar the way I use gtkdialog. This is how I keep values from gtkdialog variables. There are sure many ways to do this. I don't have sshfs installed, so I couldn't check the output. To be sure the values are saved, I included the echo-line....

To hold on the terminal window when finished (to see result/errors.....) you should use the -hold switch

Code: Select all

I=$IFS; IFS=""
for STATEMENTS in  $(gtkdialog3 -p CHOOSER); do
   eval $STATEMENTS
done
IFS=$I 

if [ $EXIT = EXIT_NOW ]; then 
	urxvt -hold -e echo "$ipa:::$mnt2:::$name:::$IDEV"
	urxvt -hold -e sshfs root@$ipa:$mnt2 /mnt/$name-$IDEV
fi

good luck
Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#8 Post by zigbert »

Have you looked at this?

Lord_Solrac2
Posts: 35
Joined: Thu 23 Dec 2010, 00:58
Location: Gurabo, Puerto Rico
Contact:

#9 Post by Lord_Solrac2 »

zigbert wrote:Have you looked at this?
No, To Be Honest, I Didn't Use any Guide ^^" Anyways Thanks
EDIT: The GUI Works Fine Though... It's Actually When it reaches the Terminal where the error Occours... D:

Lord_Solrac2
Posts: 35
Joined: Thu 23 Dec 2010, 00:58
Location: Gurabo, Puerto Rico
Contact:

#10 Post by Lord_Solrac2 »

zigbert wrote:hello Lord_Solrac2
I have rewritten the execution part to be similar the way I use gtkdialog. This is how I keep values from gtkdialog variables. There are sure many ways to do this. I don't have sshfs installed, so I couldn't check the output. To be sure the values are saved, I included the echo-line....

To hold on the terminal window when finished (to see result/errors.....) you should use the -hold switch

Code: Select all

I=$IFS; IFS=""
for STATEMENTS in  $(gtkdialog3 -p CHOOSER); do
   eval $STATEMENTS
done
IFS=$I 

if [ $EXIT = EXIT_NOW ]; then 
	urxvt -hold -e echo "$ipa:::$mnt2:::$name:::$IDEV"
	urxvt -hold -e sshfs root@$ipa:$mnt2 /mnt/$name-$IDEV
fi

good luck
Sigmund
Didn't Notice This Post ^^" And The Result is

Code: Select all

read: Connection reset by peer
So I'm Guessing It's sshfs the error...

Post Reply