maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   what is the x terminal command that opens an application? (https://talk.maemo.org/showthread.php?t=78505)

TiagoTiago 2011-10-05 00:56

Re: what is the x terminal command that opens an application?
 
There isn't one single answer, for each program you need to find what the executable file is called and where it is located (this second part is not always necessary, some executables are placed in specific folders that the system is set to look into from anywhere so you don't need to specify the folder)

shallimus 2011-10-05 00:59

Re: what is the x terminal command that opens an application?
 
Quote:

Originally Posted by JohnLF (Post 1102930)
/path/to/paperthrow

Not sure where it is? Try which paperthrow or if all else fails

find / -name paperthrow -print

Probably not the best way, but I've been doing that for 25 years and it works for me :)

Also see echo $PATH for a list of directories that the shell will search in for commands (that's not an exhaustive list as there are some built-in commands, but...)

And with find, you may want to add wildcards, like:
Code:

find / -name '*leafpad*'
...just in case it's leafpad-something or what-have-you.

Quote:

Originally Posted by demolition (Post 1102923)
Also, be careful about shutting the terminal you used to initiate the launch because you'll close both at once - unless that's what you want. Not sure if you can spawn the new programme so it's uneffected by whatever goes on in the terminal.

True about closing the xterm. To get around that, use nohup so the child process won't allow itself to be killed (nohup == no hangup == process will ignore a HANGUP signal telling it to kill itself) and an ampersand (&) so it launches in the background and returns control of the terminal to you:
Code:

nohup ./some-text-editor myfile.txt &

common 2011-10-05 03:30

Re: what is the x terminal command that opens an application?
 
Quote:

Originally Posted by TiagoTiago (Post 1102946)
There isn't one single answer, for each program you need to find what the executable file is called and where it is located (this second part is not always necessary, some executables are placed in specific folders that the system is set to look into from anywhere so you don't need to specify the folder)

ok do you know where or how can I find the correct name of the executable file?
thanks Tiago

TiagoTiago 2011-10-05 06:46

Re: what is the x terminal command that opens an application?
 
Check the contents of the shortcut files, they got .desktop extensions, i forgot where they are located, but should be easy to find on the forum or the wiki.

tuxsavvy 2011-10-05 06:52

Re: what is the x terminal command that opens an application?
 
Programs reside under various areas and usually is controlled by the package manager which is probably equivalent to windows' add/remove programs.

The default package manager for maemo 5 (fremantle) is dpkg and its command line based only.

Unfortunately there's no easy way to go about finding out the correct name of the executable (and without using find which just thrashes I/O) what you could do is something like:
Code:

dpkg -l foo
That will list package name with foo or starts with foo. If you cannot find the package name you may want to try piping it into grep:
Code:

dpkg -l| grep foo
This will not only output package names that contains the word foo but also the description of the package. If lets say you found the package and you want to find out the executable within the provided package. You do:
Code:

dpkg -L foobar
That will list all the files belonging to foobar including directories that the files are to be placed in starting from rootfs which is /. Although unlike windows where executables are named with extensions such as .exe or .com under linux executables aren't distinguished by that but with a program called file (which you may have to install by hand from fremantle/tools). You then do something like this:
Code:

for i in `dpkg -L foobar`; do file $i; done
That will then print out what each of the line means, like if the file on the list is a directory it will say its a directory. If its an executable it will say something like LSB 32bit executable.

mece 2011-10-05 07:02

Re: what is the x terminal command that opens an application?
 
the .desktop files are in
/usr/share/applications/hildon/
Code:

ls /usr/share/applications/hildon/
lists what is there. you can use grep to try to find something specific, for example
Code:

ls /usr/share/applications/hildon | grep paper
lists all with the word paper in it. I assume papertoss is one of them. once you have the filename you can do
Code:

cat /usr/share/applications/hildon/papertoss.desktop
that will show the contents of the file. There is a line starting with Exec=
and there is the command you use. Note that if the command points to something in /usr/bin you can just start that app with the last word in the command. For example the calendar.desktop file points to /usr/bin/Calendar so just typing Calendar from your home dir would start the calendar app.

When I want to launch an app from command line I usually try with just typing the beginning of the app name first and pressing tab to see if that command exists. Before going trough the trouble of looking at .desktop files.

blue_led 2011-10-05 15:59

Re: what is the x terminal command that opens an application?
 
Quote:

Originally Posted by demolition (Post 1102941)
For all xterm commands press Ctrl + Tab twice.

There isn't room for the whole list and I haven't worked out how to pipe this list to a file because you're not actually typing a command. Anybody know?

Edit: @ CaptWheeto - Thanks very handy info.


http://talk.maemo.org/showpost.php?p=857534&postcount=2
you can narrow the list by [ first letter of app ] then double tab

don_falcone 2011-10-05 16:47

Re: what is the x terminal command that opens an application?
 
...and don't forget 'apropos' and 'locate' as well (which are not installed by default).

common 2011-10-05 22:41

Re: what is the x terminal command that opens an application?
 
@tuxsavvy

thanksss a lot ...these comands helped me a lot...I didn't know them before..

thanks tuxsavvy!!

common 2011-10-05 22:51

Re: what is the x terminal command that opens an application?
 
@mece

Superb information.... these commands worked with me and helped me open several applications from the x terminal ....yet sometimes it gives me :not found....but that's not a big deal...

mece when I have and application that is written with 2 or more words.. for example "pocket calc" ---(notice that there is a space between the 2 words).... then in this case would the command be

ls /usr/share/applications/hildon | grep pocket calc

or

ls /usr/share/applications/hildon | grep pocketcalc
i.e written in one word

what command would I enter in this case the 1st or the 2nd?


All times are GMT. The time now is 10:34.

vBulletin® Version 3.8.8