![]() |
osso_xterm toolbar shortcut
Hi, I'm just starting to learn *nix systems in general. I find myself switching to root a lot, and would like to create a shortcut on the X Terminal toolbar. I created on called Gainroot and enter "sudo gainroot" as the command but that doesn't do anything. Can I not run commands like that? If not, what is it's purpose?
Thanks, Mike |
Re: osso_xterm toolbar shortcut
It works for <ctrl>p to go back in command history.
Perhaps someone will tell us the syntax for other commands. |
Re: osso_xterm toolbar shortcut
Would it be easier just to use the 'up' Dpad? Ctrl+p involves 4 key strokes - ctrl, command line, p, 'OK'.
bun |
Re: osso_xterm toolbar shortcut
Quote:
then to become root, type r You could also create an x resource to map it to hardware key although I didn't try |
Re: osso_xterm toolbar shortcut
what would also be nice is something along the lines of the "root terminal" menu item in desktop linux.
I can certainly understand why there isnt one from the get go, being well dangerous to the system and all. But certainly we should be able to add one somehow. I am going to start poking around and see what I can come up with. never occured to me before now, but that would very nice. -John |
Re: osso_xterm toolbar shortcut
Quote:
|
Re: osso_xterm toolbar shortcut
use this command:
Code:
sh -c "sudo gainroot" |
Re: osso_xterm toolbar shortcut
Thanks for the replies everyone. micampe, I entered what you suggested as the value of the xTerm toolbar shortcut, but nothing happens when I click it. These shortcuts should be able to run terminal commands like that, right? I would definitely make one to fire up Hamachi if that were the case. Any ideas?
Thanks again, Mike |
Re: osso_xterm toolbar shortcut
BTW, I was playing around with your suggestion, and if I entered "sh 1" or "sh -c 1", then 1 will be sent to the terminal. However, "sh 12" and "sh -c 12" don't send 12 to the terminal. Also, "sh "1"" and "sh -c "1"", with quotes around the 1, doesn't even send 1, like it will without the quotes.
Thanks, Mike |
Re: osso_xterm toolbar shortcut
Quote:
$HOME/.profile is executed on login shells /home/user/.profile |
Re: osso_xterm toolbar shortcut
Quote:
|
Re: osso_xterm toolbar shortcut
How do you do a series of commands using alias, not script? say, sudo gainroot, echo 'rebooting....', reboot.?
How do you transfer input parameters using alias, not script? say, leafpad, echo 'file?' #filename? TIA, bun |
Re: osso_xterm toolbar shortcut
Quote:
Quote:
popen("leafpad") and then use the descriptor to write into it. In this case, we have to create use input at X level. The only way that I know (I use it at work) is xreplay or xnee. xreplay < "go_to_leafpad_window,click file, click open, type $filename, click ok" Ugly but saved me for GUI locked app. edit: I think the leafpad that I updated for OS2008 takes the filename as parameter, if this is specific to leafpad. |
Re: osso_xterm toolbar shortcut
For the OP, here is a small script for putting a reboot button on your desktop, you do have to install osso-statusbar, (go http://www.gronmayer.com/it/index.php, choose your OS, and search for statusbar, pick the one version tschmidt v.0.6.1chinook1 if you are 2008OS, and use the green install button, the other button does not work), and copy the script to /home/user and make it executable by,
chmod +x /home/user/bunreboot.sh you can always modify it to add your commands. bun bunreboot.sh: __________________________________________________ ____ #!/bin/sh if [ `id -u` != 0 ] ; then exec sudo gainroot <<EOF exec sh $0 $* EOF exit $? fi exec reboot __________________________________________________ ______ |
Re: osso_xterm toolbar shortcut
Put this in as the value for your Toolbar shortcut:
Code:
s . u . d . o . KP_Space . g . a . i . n . r . o . o . t |
Re: osso_xterm toolbar shortcut
Quote:
-John |
Re: osso_xterm toolbar shortcut
So, does anyway know how to run shell commands from a toolbar shortcut?
|
Re: osso_xterm toolbar shortcut
Quote:
Code:
s . u . d . o . KP_Space . g . a . i . n . r . o . o . t . KP_Enter |
Re: osso_xterm toolbar shortcut
Quote:
Code:
period . slash . h . i . period . s . h . KP_Enter |
Re: osso_xterm toolbar shortcut
well done bun, the exec function does the trick
I never think about it But I don't understand the stuffs with the period. humm:confused: |
Re: osso_xterm toolbar shortcut
Quote:
So the dots (".") are glue between each individual element like a letter or character. Does that explain it? |
Re: osso_xterm toolbar shortcut
Quote:
-John |
Re: osso_xterm toolbar shortcut
Thank you everyone for contributing! I'm think this knowledge will be very useful to a lot of people! Thanks Again!
Mike |
Re: osso_xterm toolbar shortcut
Anyone know if you can bind modifiers as well? Like ^K, and such.
|
Re: osso_xterm toolbar shortcut
Quote:
<ctrl>c is very useful, it breaks execution of a command-line app. A very useful shortcut for me is: Code:
y,<ctrl>mEDIT: A couple other useful ones: | (pipe) is "bar" and _ is "underscore". Both are a pain to type (at least for me) on the virtual keyboard. EDIT2: Note that you don't need the " . " (space-period-space) between characters, just use a comma. |
Re: osso_xterm toolbar shortcut
Thanks so much!
(I find ^K helpful for JOE; I bound around it using F2, but that doesn't help when I telnet out to other machines... ^C, of course, is obviously good, but ^Z is better; you can always stop the job after suspending it.) Wiki updated! |
Re: osso_xterm toolbar shortcut
thx guys
also, found how to Paste selected text: <shift>KP_Insert enjoy! |
Re: osso_xterm toolbar shortcut
Ok, late to the party, but:
1) how to do "Delete" "Home" (BOL) and "End" (EOL)? I tried lots of combinations... 2) I use bash 2.05b, and PgUp and PgDn do not work for me (they write a '~'). Thanks! L. |
Re: osso_xterm toolbar shortcut
Quote:
|
Re: osso_xterm toolbar shortcut
Quote:
KP_Delete KP_Home KP_End Don't know why PgUp and PgDn don't work for you but you could try KP_Prior or KP_Page_Up KP_Next or KP_Page_Down |
Re: osso_xterm toolbar shortcut
Quote:
With 'sudo gainroot' the above work. But how to make it work for the normal user? Thanks, L. |
Re: osso_xterm toolbar shortcut
Quote:
You probably want <ctrl>a for "home" and <ctrl>e for "end" in a terminal that doesn't understand home/end (ctrl-e actually only works as a shortcut, if I type it on the keyboard, that is a global shortcut for search). If they work as root, I suppose that uses a different type of shell for you? I. |
Re: osso_xterm toolbar shortcut
I like the toolbar shortcuts. But I have problem in doing the special characters like
/ (slash) \ & (KP_amber, it is a guess) . (period) | (bar) Does anybody know or where can I look up for more? TIA, Edit: found some of them in this thread. bun |
Re: osso_xterm toolbar shortcut
Quote:
http://inz.fi/blog/2007/01/24/more-o...erm-shortcuts/ is a good page to look at (albeit the file mentioned is very long!). & is "ampersand" (without the quotes). I found it by looking in that file on that page and removing the "GDK_". HTH |
Re: osso_xterm toolbar shortcut
Thanks qwerty12, you are always fast. Just one thing pop into my mind, you are so good in searching, which does require to know the subject WELL in order to put in a good search, you really would be a good competitor to Google if you want challenge. Just a thought, and a big thank you for finding this. And it is good to see your new avatar too :-)
bun |
| All times are GMT. The time now is 16:28. |
vBulletin® Version 3.8.8