| 1   2     3   | Next
maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   xterminal "top" shortcut (https://talk.maemo.org/showthread.php?t=35858)

goodfellabk718 2009-12-04 04:44

xterminal "top" shortcut
 
I was lookin around but didnt find anything and my question is:

Is there a way to create a shortcut that will open xTerminal and run "top"?
I dont really like load-applet and systemwidget(i forget the name) in maemo etras-testing is, well, in testing. Both of these apps dont really tell me anything, so I was wondering if i can create a shorcut with switches to run xterminal's "top" when i click it.

thanks

R-R 2009-12-04 04:59

Re: xterminal "top" shortcut
 
xterm -e top usually work so if you find the terminal command you may try the same?

archebyte 2009-12-04 06:58

Re: xterminal "top" shortcut
 
1 Attachment(s)
Quote:

Originally Posted by goodfellabk718 (Post 409022)
Is there a way to create a shortcut that will open xTerminal and run "top"?

yes. create a file called topx.desktop with the following text in the /usr/share/applications/hildon/ directory. you will need root access.

Code:

[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=topx
Exec=/usr/bin/osso-xterm top 
Icon=   
#X-Window-Icon=timerwidget
X-Window-Icon=   
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable

This will create an ugly blue application icon in the Application list called 'topx' (to specify an icon, look here). Launching it will execute 'top' directly in xterm. You may now put a shortcut on the desktop for quick access. HTH

sent from an N900

funpig 2009-12-04 09:53

Re: xterminal "top" shortcut
 
hmmm~ it's so happy to know this. mark it. thanks.

goodfellabk718 2009-12-04 11:15

Re: xterminal "top" shortcut
 
Sweet! Thank you both.

Andre Klapper 2009-12-04 11:37

Re: xterminal "top" shortcut
 
There is also a hack by removing the comment lines in /etc/mce/mce.ini that will provide a "Top in XTerm" button in the hardware button menu.
Not that "hack" really means "hack" and doing something wrong here might turn your device into a brick, but for me it works. :-P

goodfellabk718 2009-12-04 23:59

Re: xterminal "top" shortcut
 
i am trying to create the shortcut but the commands for an editor doesnt work and (command not found) and i downloaded vim but i just dont understand why its not working ( icant type in it, nothing happens when i press the keys) i read that u have to press a set of keys to change between modes (blah) do we have anything easier like nano or something similar? im trying not to be "spoon fed" but alot of the tutorials i have found, there commands dont register with maemos shell. im gonna read up some more. Basically im tryin to open the editor to copy what i was shown and then go from there. So just tell me, what editor are you guys using to get things done? i'll figure out the rest i just need an editor.

mason 2009-12-05 00:07

Re: xterminal "top" shortcut
 
why don't you install sshserver and sftp into the device with winscp i.e. it's much easier than to fiddle with the xterm shell on the device!

goodfellabk718 2009-12-05 00:15

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by mason (Post 410894)
why don't you install sshserver and sftp into the device with winscp i.e. it's much easier than to fiddle with the xterm shell on the device!

truuuuueeee, but 2 things

1. I kind of what to see how much i can do on the device (just to know)
2. I haven't made a linux box yet and wasnt sure if doing that through windows was ideal. I'm a couple of weeks from getting another PC and at which time I was planning to install linux on my old machine
:o

i know it would be much easier to grasp once i get a linux box

mason 2009-12-05 00:32

Re: xterminal "top" shortcut
 
there is no problem with windows there, you just have to make sure you use the right editor for the job. (windows notepad isn't recommended ;))

mikkov 2009-12-05 00:37

Re: xterminal "top" shortcut
 
Leafpad is notepad like editor for maemo

Venomrush 2009-12-05 02:24

Re: xterminal "top" shortcut
 
The systeminfowidget has recently been updated with the memory leak fix.
I'm using that now and avoiding the extra steps

goodfellabk718 2009-12-05 03:04

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by Venomrush (Post 411017)
The systeminfowidget has recently been updated with the memory leak fix.
I'm using that now and avoiding the extra steps

have they added any more features? It really doesn't tell you anything, at least with "top" you can see which process is using up the memory or cpu time

archebyte 2009-12-05 06:42

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by goodfellabk718 (Post 410884)
i am trying to create the shortcut but the commands for an editor doesnt work and (command not found) and i downloaded vim but i just dont understand why its not working ( icant type in it, nothing happens when i press the keys) i read that u have to press a set of keys to change between modes (blah) do we have anything easier like nano or something similar? im trying not to be "spoon fed" but alot of the tutorials i have found, there commands dont register with maemos shell. im gonna read up some more. Basically im tryin to open the editor to copy what i was shown and then go from there. So just tell me, what editor are you guys using to get things done? i'll figure out the rest i just need an editor.

Leafpad is a good option if you don't want to mess with vi.
copy and paste the text into leadpad.
name the file topx.desktop
from xterm as root, copy the file to the hildon directory.

kwotski 2009-12-06 01:54

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by Andre Klapper (Post 409622)
There is also a hack by removing the comment lines in /etc/mce/mce.ini that will provide a "Top in XTerm" button in the hardware button menu.
Not that "hack" really means "hack" and doing something wrong here might turn your device into a brick, but for me it works. :-P

For anyone as puzzled as I was by this, I think Andre is really talking about a different file... or maybe.

At least on my phone, I discovered the following commented-out stanza:

Code:

<!--
 <menuitem priority="20" name="Reboot">
  <return>6</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="10" name="Soft poweroff">
  <return>7</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="5" name="Top in XTerm">
  <callback service="com.nokia.xterm" path="/com/nokia/xterm" interface="com.nokia.xter
  <argument type="string">/usr/bin/top</argument>
  </callback>
 </menuitem>
-->

in /etc/systemui/systemui.xml while poking around.

Edit: on a whim I uncommented it (removing the <!-- and --> lines) and it seems to work fine.

Venomrush 2009-12-07 09:06

Re: xterminal "top" shortcut
 
What's the difference between

Code:

<menuitem priority="20" name="Reboot">
  <return>6</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>

and

Code:

<menuitem priority="10" name="Soft poweroff">
  <return>7</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>

Beside the name and position?
Seems to me both use osso-powerup-shutdown

goodfellabk718 2009-12-07 16:35

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by Venomrush (Post 414085)
What's the difference between

Code:

<menuitem priority="20" name="Reboot">
  <return>6</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>

and

Code:

<menuitem priority="10" name="Soft poweroff">
  <return>7</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>

Beside the name and position?
Seems to me both use osso-powerup-shutdown

hmmm, perhaps another switch is missing from the one named reboot. Hmm, anyone?...

les_garten 2009-12-07 17:13

Re: xterminal "top" shortcut
 
I'm not sure there isn't a good reason these were commented out. The Reboot option is pretty Violent i it's reboot. No gracefull shutdown, no file system sync, etc. Like you pulled the batt out. The soft poweroff makes my menu key no longer function, and I have to reboot to get it back. The top xterm is pretty kewl though!

timwatt 2009-12-11 08:06

Re: xterminal "top" shortcut
 
slightly off topic, but it looks like the expertises exist here.
I want to run a command in xTerminal (ssh) i would like to create an icon on my desktop.

Please explain how to make a desktop icon to run a xTerminal command for dummy?
thanks Tim (ps I used "personal menu" on my n810 to do this)

naabi 2009-12-11 08:10

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by timwatt (Post 422229)
Please explain how to make a desktop icon to run a xTerminal command for dummy?

Third post of this thread gives quite good instructions.

timwatt 2009-12-11 08:56

Re: xterminal "top" shortcut
 
thanks naabi,
when I say for dummies i mean it. I have created an icon file:
Code:

[Desktop Entry]
Encoding=UTF-8
Version=0.1
Name=SSH
Terminal=true
Type=Application
Comment=SSH Login
Exec=/usr/bin/osso-xterm
Icon=terminal
#X-Window-Icon=timerwidget
X-Window-Icon=   
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable

in "/usr/share/applications/hildon/" folder i now want it to run this command:
Code:

ssh -l root -L 3389:192.111.1.1:3389 222.222.222.222 -p 22
what should my *.desktop file look like to run this command?

timwatt 2009-12-11 17:52

Re: xterminal "top" shortcut
 
anyone know how to do the above?

mikec 2009-12-11 18:08

Re: xterminal "top" shortcut
 
Try
osso-xterm -e ssh -l root -L 3389:192.111.1.1:3389 222.222.222.222 -p 22

juhar 2009-12-11 18:11

Re: xterminal "top" shortcut
 
Exec=/usr/bin/osso-xterm 'ssh -l root -L 3389:192.111.1.1:3389 222.222.222.222 -p 22'

That should work

timwatt 2009-12-11 18:23

Re: xterminal "top" shortcut
 
Thanks Juhar that works great I am loving Linux.

so now: after running SSH command is it potable to run another command from teh same file?
like launching rDesktop?
Code:

rdesktop-cli -f -u username -p password host
thanks,
Tim

archebyte 2009-12-11 19:05

Re: xterminal "top" shortcut
 
2 Attachment(s)
Quote:

Originally Posted by timwatt (Post 422229)
slightly off topic, but it looks like the expertises exist here.
I want to run a command in xTerminal (ssh) i would like to create an icon on my desktop.

Please explain how to make a desktop icon to run a xTerminal command for dummy?
thanks Tim (ps I used "personal menu" on my n810 to do this)

An easy way to add an icon to a shortcut for let say, my post above, would be first to find/create a PNG image of dimension 48x48. google this. save file to /usr/share/icons/hicolor/48x48/hildon/

Modify the .desktop file to include the following line. The right side should be the name of file without the .png. (the name of my file was topx.png)
Code:

Icon=topx
Save the file and reboot to see the icon for the shortcut.

my topx.desktop shortcut-with-icon for 'top' looks like this:
Code:

[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=topx
Exec=/usr/bin/osso-xterm top
Icon=topx
X-Osso-Type=application/x-executable

HTH

go1dfish 2009-12-11 19:21

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by kwotski (Post 412410)
For anyone as puzzled as I was by this, I think Andre is really talking about a different file... or maybe.

At least on my phone, I discovered the following commented-out stanza:

Code:

<!--
 <menuitem priority="20" name="Reboot">
  <return>6</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="10" name="Soft poweroff">
  <return>7</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="5" name="Top in XTerm">
  <callback service="com.nokia.xterm" path="/com/nokia/xterm" interface="com.nokia.xter
  <argument type="string">/usr/bin/top</argument>
  </callback>
 </menuitem>
-->

in /etc/systemui/systemui.xml while poking around.

Edit: on a whim I uncommented it (removing the <!-- and --> lines) and it seems to work fine.

Thanks I was confused by this as well.

I changed the systemui.xml config but see no change yet, I suppose a reboot is in order?

les_garten 2009-12-11 19:21

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by archebyte (Post 423380)
An easy way to add an icon to a shortcut for let say, my post above, would be first to find/create a PNG image of dimension 48x48. google this. save file to /usr/share/icons/hicolor/48x48/hildon/

Modify the .desktop file to include the following line. The right side should be the name of file without the .png. (the name of my file was topx.png)
Code:

Icon=topx
Save the file and reboot to see the icon for the shortcut.

my topx.desktop shortcut-with-icon for 'top' looks like this:
Code:

[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=topx
Exec=/usr/bin/osso-xterm top
Icon=topx
X-Osso-Type=application/x-executable

HTH

Glad you brought this up. I have a question about how the icon file is associated. I used a 26x26 file I made for a desktop shortcut. Would yours have worked if you had used a 26x26? I'm wondering about paths and icon directories and how they work. Also, my 26x26 works great for the shortcut but does not show up like yours does here in the main app menu. I just get a generic icon there??

There are a lot of icon directories in diff sizes and I'm trying to understand them.

juhar 2009-12-11 19:27

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by les_garten (Post 423405)
Glad you brought this up. I have a question about how the icon file is associated. I used a 26x26 file I made for a desktop shortcut. Would yours have worked if you had used a 26x26? I'm wondering about paths and icon directories and how they work. Also, my 26x26 works great for the shortcut but does not show up like yours does here in the main app menu. I just get a generic icon there??

There are a lot of icon directories in diff sizes and I'm trying to understand them.

I think if you put your icon to /usr/share/icons/hicolor/scalable/hildon/ it will automatically scale your icon at right size to every place where it's needed.
I'm not so sure about this but just a guess..

And also i didn't get to work my icon to xterm ssh until i changed "Terminal=true" to "Terminal=false" in app.desktop file.

archebyte 2009-12-11 19:44

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by les_garten (Post 423405)
Would yours have worked if you had used a 26x26?

Yes. but it doesn't scale nicely.

Quote:

Originally Posted by les_garten (Post 423405)
Also, my 26x26 works great for the shortcut but does not show up like yours does here in the main app menu. I just get a generic icon there??

If it doesn't show up after a reboot, I am not sure what the problem may be.

mikec 2009-12-11 19:46

Re: xterminal "top" shortcut
 
Can these little xterm apps be packaged up into .debs?

archebyte 2009-12-12 16:16

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by les_garten (Post 423405)
Also, my 26x26 works great for the shortcut but does not show up like yours does here in the main app menu. I just get a generic icon there??

Try installing an app or two from the repos. The app installation process typically refreshes the icon cache.

HTH

archebyte 2009-12-12 16:18

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by mikec (Post 423451)
Can these little xterm apps be packaged up into .debs?

It should be trivial to pack two files and create a deb. Not a bad idea to start off a first maemo dev project. :rolleyes:

timwatt 2009-12-13 03:45

Re: xterminal "top" shortcut
 
thanks Archebyte,
my icons didn't show up until I installed a new app. now they are glowing on my desktop.

Now if i could run WOL SSH and RDP all from the same icon (app.desktop file) I will be set.
Can anyone tell me how to run 2 commands in the terminal from one app.desktop file?

Code:

Exec=/usr/bin/osso-xterm 'ssh -l root myip.com -p 22 /usr/sbin/wol -i 192.100.1.255 00:X3:18:F1:86:A1'

Exec=/usr/bin/osso-xterm 'ssh -l root -L 3389:192.100.1.1:3389 myip.com -p 22'


archebyte 2009-12-13 11:51

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by timwatt (Post 425159)
thanks Archebyte,
Can anyone tell me how to run 2 commands in the terminal from one app.desktop file?

Code:

Exec=/usr/bin/osso-xterm 'ssh -l root myip.com -p 22 /usr/sbin/wol -i 192.100.1.255 00:X3:18:F1:86:A1'

Exec=/usr/bin/osso-xterm 'ssh -l root -L 3389:192.100.1.1:3389 myip.com -p 22'


I would suggest putting the two (or more) commands in a script for e.g. /home/user/myscript.sh
Code:

/usr/bin/osso-xterm 'ssh -l root myip.com -p 22 /usr/sbin/wol -i 192.100.1.255 00:X3:18:F1:86:A1' &
/usr/bin/osso-xterm 'ssh -l root -L 3389:192.100.1.1:3389 myip.com -p 22' &

Note the '&'. make the script executable
Code:

chmod a+x /home/user/myscript.sh
and call it from the .desktop file
Code:

Exec=/home/user/myscript.sh
clicking the app shortcut will launch the two X-Terminal sessions.

HTH

timwatt 2009-12-14 07:25

Re: xterminal "top" shortcut
 
Thanks HTH,

what do i do whit this?

Quote:

Note the '&'. make the script executable
Code:

chmod a+x /home/user/myscript.sh

Thanks,
Tim

archebyte 2009-12-14 08:33

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by timwatt (Post 426762)
Thanks HTH,

what do i do whit this?


Thanks,
Tim

I was highlighting the '&' sign after the ssh commands. Its important to use it for executing the second ssh command.

after putting the two commands in /home/user/myscript.sh, open a terminal and change the permission of the file to make it executable using the above command.

'H'ope 'T'his 'H'elps.

archebyte

jaysire 2009-12-14 13:28

Re: xterminal "top" shortcut
 
Slightly OT question: Is there any place where the coordinates of the various desktop icons are stored, that could be edited? I would like to manually adjust the x- and y-coordinates of for instance bookmark desktop items to align them properly.

wizbowes 2010-01-02 14:31

Re: xterminal "top" shortcut
 
Hi,

I've used this to run a little python script I've created in xterm. It works well. A couple of questions perhaps somebody could hlp with:

1) How do I get xterm to open maximised? I can't really find any extension to do this.
2) Anyway to keep the terminal open after the script completes? At the moment I have a raw_input("") at the end of my script - any way to remove this and get it to drop back into the terminal without closing it?

Hope you can help.

Cheers,

Wizbowes

DaveQB 2010-01-03 01:29

Re: xterminal "top" shortcut
 
Quote:

Originally Posted by goodfellabk718 (Post 410903)
truuuuueeee, but 2 things

1. I kind of what to see how much i can do on the device (just to know)
2. I haven't made a linux box yet and wasnt sure if doing that through windows was ideal. I'm a couple of weeks from getting another PC and at which time I was planning to install linux on my old machine
:o

i know it would be much easier to grasp once i get a linux box

Why not just load up a Linux distro in a VM??


| 1   2     3   | Next
All times are GMT. The time now is 11:34.

vBulletin® Version 3.8.8