|
Post by konaexpress on Jul 27, 2012 14:04:46 GMT 1
Thanks for the help Bigbass,
Now I know that this is going to sound dumb but...........what am I to do with this? Do I copy and paste it into a text file? And where do I put it? Better yet, what is it?
-John
|
|
|
Post by bigbass on Jul 27, 2012 14:44:26 GMT 1
Hey John You asked this question
I posted a very complete automatic answer using a bash script
So now I will just focus on one small part of the script how to down load and place the hug-imports.bac where it needs to go
The terminal and bash are your best linux friends to get work done
if you are running Debian now open a terminal / console if you are using LXDE you will also have lxterminal installed but you should have xterm installed if its a real linux compatible system
open the terminal then select and paste this code inside the box into the terminal and press enter
*I used the quote instead of CODE because the forum adds the URL tag *
|
|
|
Post by konaexpress on Jul 27, 2012 15:39:54 GMT 1
O' this is a bash script.....I have used them in the past but I have never looked at the text before. They were normally a file that I would call at the command line that came in the distro......or am I thinking of Python........can't say that I know the difference......got it.
Thanks for the clarification on this and I will try it now. Please forgive my ignorance about this subject, I have only started last month to embrace the command line as I am trying to learn to program.
If someone told me in the past to use the command line, I would just drop the subject and move on, can't do that any more now can I?
Thanks again. -John
|
|
|
Post by konaexpress on Jul 27, 2012 16:40:37 GMT 1
OK,
After some trial and error, I got Xterm installed and ran the bash script in lxterm. It ran great!
Well........I mean it ran but the Xtern window popped up and closed so fast I could not read it for any error messages.
I ran my little app and got the same message, so I checked the BaCon folder (it installed) and found the "old" file and the md5sum file but no hug file.
I think I may have screwed something up again.
Thanks for the help, I might see if I can locate the file on the web and see if I can download it and copy/paste it to the BaCon file.
-John EDIT: I found the hug_imports.bac file on the web. Do I just copy it to the folder? Looking at your script, it looks like something has to be changed in the Hug file?
This part:
# auto edit the hug_imports.bac sed -i 's/\.\/hug.so/\/usr\/lib\/libhug.so/' hug_imports.bac
|
|
|
Post by bigbass on Jul 27, 2012 17:07:18 GMT 1
|
|
|
Post by konaexpress on Jul 27, 2012 17:34:47 GMT 1
Thanks for that link to the Bash stuff, I will read it for sure.
This makes me think, are Bash scripts used allot in Linux?
-John
|
|
|
Post by konaexpress on Jul 27, 2012 17:52:46 GMT 1
Thanks, I am up and running now! Now I can see that I did something wrong in my code. ;D cr@p!
|
|
2lss
Full Member
Posts: 140
|
Post by 2lss on Jul 27, 2012 18:13:13 GMT 1
konaexpress: Here is a little site I was working on to put my bacon projects. I wrote some instructions on how to install bacon and hug. sites.google.com/site/2lssrandomprojects/bacon-projectsAs far as your logout dialog goes, I did something similar for a debian based livecd Since it uses sudo, you will have to edit the file /etc/sudoers to prevent it from asking for a password ALL ALL=NOPASSWD:/sbin/shutdown It could also be adapted to include suspend and/or hibernate using pm-suspend and pm-hibernate. You will have to add them to the sudoers file as well INCLUDE "hug.bac"
SUB shut_down
SYSTEM "sudo shutdown -h now"
ENDSUB
SUB restart
SYSTEM "sudo shutdown -r now"
ENDSUB
SUB cancel
QUIT
ENDSUB
HUGOPTIONS("TABLE 16 8")
mainwin = WINDOW("Shutdown", 300, 100)
mark1 = MARK("Choose Option", 6, 1) ATTACH(mainwin, mark1, 5, 1)
button1 = BUTTON("Shutdown", 4, 2) ATTACH(mainwin, button1, 1, 4)
button2 = BUTTON("Restart", 4, 2) ATTACH(mainwin, button2, 6, 4)
button3 = BUTTON("Cancel", 4, 2) ATTACH(mainwin, button3, 11, 4)
CALLBACK(button1, shut_down) CALLBACK(button2, restart) CALLBACK(button3, cancel)
DISPLAY
|
|
|
Post by konaexpress on Jul 27, 2012 18:41:28 GMT 1
@ 2lss
Hey thanks for that link!
I think I have BaCon up and running now but boy could I have used that page. Something like it should be on the main BaCon page titled "Dumb @ss Newbie, Start Here" for users like me. ;D
-John
|
|
|
Post by konaexpress on Jul 27, 2012 19:02:17 GMT 1
I fixed my code as I could and I can now compile it with no errors. This is a great step for me.
When I double click on it or try to run it from the command line, it will not work. Any ideas to get it up and running?
Here is what I did:
' open-box-logout.bac ' This program was made with BaCon @ www.basic-converter.org ' Thanks to all the guys that hang out in the BaCon forums ' for their help.
' Include the files for making a GUI. INCLUDE "/usr/share/BaCon/hug_imports.bac" INIT
' we want to "echo out" which button was pressed ' this could launch another app
'---------- SUB demo1() '---------- SYSTEM "dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop" END SUB
'---------- SUB demo2() '---------- SYSTEM "dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart" END SUB
'---------- SUB demo3() '---------- SYSTEM "Logout" END SUB
' 1.) Create your main working window, 380 pixels wide x 320 pixels high Mainwin = WINDOW( "Openbox Logout" , 300, 320 ) PROPERTY(Mainwin, "decorated", FALSE)
The_image = IMAGE( "/usr/share/pixmaps/logo.gif", 268, 62 ) ATTACH( Mainwin, The_image,15, 0 )
OB_label = MARK( "Logout of Openbox ?", 200, 30 ) FONT(OB_label, "sans 14") ATTACH( Mainwin, OB_label, 60, 60 )
SD_btn = BUTTON("Shutdown",200,30) ATTACH(Mainwin,SD_btn,50,99) CALLBACK(SD_btn,demo1)
RB_btn = BUTTON("Reboot",200,30) ATTACH(Mainwin,RB_btn,50,148) CALLBACK(RB_btn,demo2)
LO_btn = BUTTON("Logout",200,30) ATTACH(Mainwin,LO_btn,50,197) CALLBACK(LO_btn,demo3)
Cancel_btn = BUTTON("Cancel",200,30) ATTACH(Mainwin,Cancel_btn,50,246) CALLBACK(Cancel_btn,QUIT)
DISPLAY
Thanks for the help guys. -John
EDIT: This is the error message I get at the command line:
john@SeaDragon:~/projects/openbox-logout$ ./open-box-logout Could not open library ./hug.so: cannot open shared object file: No such file or directory
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 27, 2012 19:25:21 GMT 1
I replaced INCLUDE "/usr/share/BaCon/hug_imports.bac" with INCLUDE /usr/share/bacon/hug.bac"" (to make it compile on my system) and it worked (I rebooted my computer). I can run it either from the terminal or by clicking on it. It looks like everything works perfectly.
|
|
|
Post by konaexpress on Jul 27, 2012 19:35:52 GMT 1
I replaced INCLUDE "/usr/share/BaCon/hug_imports.bac" with INCLUDE /usr/share/bacon/hug.bac"" (to make it compile on my system) and it worked (I rebooted my computer). I can run it either from the terminal or by clicking on it. It looks like everything works perfectly. WHOOOOOOHOOOOO! Thanks Tomaaz, that worked! I am sitting here giggling like a little kid now. -John
|
|
|
Post by konaexpress on Jul 27, 2012 19:42:56 GMT 1
|
|
|
Post by vovchik on Jul 27, 2012 20:09:49 GMT 1
@ John (konaexpress)
Congrats!
@ 2lss
Thanks for the link. What a genuinely nice and useful idea!!!!
With kind regards, vovchik
|
|
|
Post by konaexpress on Jul 28, 2012 9:44:49 GMT 1
|
|