The time now is Wed 22 May 2013, 20:41
All times are UTC - 4 |
| Author |
Message |
chaynes
Joined: 28 Nov 2011 Posts: 6
|
Posted: Mon 18 Jun 2012, 11:42 Post subject:
executing a program from an icon Subject description: I would like to execute a program I have written, from a desktop icon |
|
I have tried a script named myprog:
exec urxvt -bg blue -fg white -geometry 80x25 -e myprogname
I have also put an icon on the desktop to execute the script myprog.
I got most of the script info from googling various places. Click the icon, nothing happens.
I am not Linux Script oriented; background is in DOS Batch programming.
Can someone point me to what I need to read about how to solve
this problem.
I am running Puppy Slacko 5.3 on a HP Pavlion Desktop about 10+
years old, and Puppy is running perfectly. I can execute my above
program from within xterm console easily; just want to start it with
a desktop icon click.
Thanks for any pointers.
chaynes
|
|
Back to top
|
|
 |
saintless

Joined: 11 Jun 2011 Posts: 481 Location: Bulgaria
|
Posted: Mon 18 Jun 2012, 15:49 Post subject:
|
|
If I understand right you just need to change the permissions of the script to make it executable. Right click on it and you will see option to change the permissions.
A attach an archive with example of your script. Extract it and put it where you like. Edit the script with the program you need. In the script I use qcad for testing. Then make a link or copy the file to the desktop. It should work to start the program from desktop.
| Description |
|

Download |
| Filename |
test-script.tar.gz |
| Filesize |
190 Bytes |
| Downloaded |
69 Time(s) |
_________________ KDpup-484 FoxyRoxyLinux Pussylinux BackUp forum
|
|
Back to top
|
|
 |
npierce
Joined: 28 Dec 2009 Posts: 637
|
Posted: Mon 18 Jun 2012, 19:11 Post subject:
|
|
Assuming that myprogname needs to run in a terminal (since your script starts urxvt), in addition to setting the execute permissions (as described above by saintless) you may also need the -hold parameter so you can see the output before the window goes away.
| Code: | | exec urxvt -hold -bg blue -fg white -geometry 80x25 -e myprogname |
|
|
Back to top
|
|
 |
chaynes
Joined: 28 Nov 2011 Posts: 6
|
Posted: Wed 20 Jun 2012, 11:34 Post subject:
|
|
Thanks, saintless & npierce, for your help.
I am slowly getting there, and your info helped.
chaynes
|
|
Back to top
|
|
 |
npierce
Joined: 28 Dec 2009 Posts: 637
|
Posted: Wed 20 Jun 2012, 12:38 Post subject:
|
|
You're welcome. Good luck with your program.
|
|
Back to top
|
|
 |
tallboy

Joined: 21 Sep 2010 Posts: 344 Location: Oslo, Norway
|
Posted: Wed 20 Jun 2012, 13:17 Post subject:
|
|
Hi chaynes, where do you keep the script? Is it in a directory that is in the path? Use this command to see the executable directories.
A logic place for the script may be /root/my-applictions/bin, /usr/local/bin or any bin-file. I have a script built much the same way, designed to display htop in a window more suitable for my needs. As you see, I do not use the exec command. The need for the 'hold' command depends on what kind of script you have made.- I named the script 'hTop' with a capital T to distinguish it from the application name.
- I saved it to /usr/bin, using the 'Script' option from the 'New' dialog that pop up when you right-click the /usr/bin window.
- I then dragged the script icon to the desktop, renamed it to htop and fitted it with the htop icon.
| Code: | #!/bin/sh
rxvt +sb -fn 9x15 -geometry 120x46+70+80 -bg black -fg white -title htop -e htop & |
Instead of placing the script in a bin-file, if you prefer to have it in for example /root/my-documents, you may drag a symlink of the script to a bin-window, and then drag that script icon from the bin-window to the desktop as outlined above.
I hope this may help you.
tallboy
|
|
Back to top
|
|
 |
chaynes
Joined: 28 Nov 2011 Posts: 6
|
Posted: Wed 20 Jun 2012, 17:07 Post subject:
|
|
Thanks, tallboy.
Your script has given me something to chew on.
I would really like to find documentation that explains the various option
codes that you used. My knowledge of Linux commands and shell script
commands is virtually nil. My background is mostly Windows/DOS/DOS
Batch programming, and the last few years writing programs in Euphoria
for the DOS & Windows platforms. I have just recently switched over to
Puppy Linux, and am in the process of converting my Euphoria DOS platform
programs to Euphoria Linux platform.
My biggest problem is going from DOS Batch programming to Linux scripts.
Any pointers to help in my conversion from Windows to Puppy Linux will be greatly appreciated.
|
|
Back to top
|
|
 |
tallboy

Joined: 21 Sep 2010 Posts: 344 Location: Oslo, Norway
|
Posted: Wed 20 Jun 2012, 18:31 Post subject:
|
|
Puppylinux is a small distro, and is left no space for documentation, while the big ones like Debian, have gigabytes of documentation in several formats, my favorites are the 'info'-files. However, most Linux commands has a help-file, 'rxvt --help' in a console window will give you most of the essential options to 'rxvt'.
There are tons of Linux documentataion right under your fingertips, like for example: 'man rxvt' in a console window will open a linux manual page for 'rxvt', in Dillo or another browser.
From the rxvt manual:
-sb|+sb
Turn on/off scrollbar; resource scrollBar.
(can be confusing: if scrollbar is not default, +sb turns it on, if it is default, +sb turns it off!))
-fn fontname
Main normal text font; resource font. (9x15 is a size as well as name)
-geometry 120 wide, 46 high, 70 in from left edge 80 down from top edge
-bg = background color -fg = foreground color
-e htop &
start htop in a new rxvt window, in the background. If you start an application with it's command in a console window, the application closes when you need to use another command, or if the console window closes, if put in the background by adding a '&', you may perform other tasks in the console window wiythout killing the application.
Here is something for you to chew on, chaynes, put on a large pot of coffee and start reading! The first manual in this link will give you all you need, but take a look further down the list, both 'A Hands on Guide' and 'Command-line Tools Summary' are real eye-openers even to old Linux users, there are some very essential other guides here too! This is THE source for me!
http://tldp.org/guides.html
Here is another source to man-pages: http://www.linuxmanpages.com/ Massive!
Start reading, sometime next week (or the one after that!) you'll be an expert!
(when you come from DOS, just wait until you understand 'piping' of a command's output into other commands as many times as necessary, then you'll suddenly realize the power of linux...)
tallboy
|
|
Back to top
|
|
 |
chaynes
Joined: 28 Nov 2011 Posts: 6
|
Posted: Fri 22 Jun 2012, 07:45 Post subject:
|
|
tallboy, I think you have given me exactly what I have been looking for!
Now, as you suggested, it is time to start reading.
Thank you so much for your help.
|
|
Back to top
|
|
 |
tallboy

Joined: 21 Sep 2010 Posts: 344 Location: Oslo, Norway
|
Posted: Fri 22 Jun 2012, 13:53 Post subject:
|
|
You have a pm
tallboy
|
|
Back to top
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|