| 1   2   | Next
maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Customize X-term? (https://talk.maemo.org/showthread.php?t=13405)

mfresh 2007-12-19 09:31

Customize X-term?
 
I'm trying to add CTRL-P to the X-term toolbar in OS2008.

It's possible to add any commands you want to the bar by giving a command a name and then filling in what key combo you want that command to do.

So my question is this: how do you enter CTRL on the keyboard? There is no CTRL button, but is there some way of invoking it from the keyboard?

linuxrebel 2007-12-19 10:23

Re: Customize X-term?
 
just type <ctrl> not as a single keystroke but as the typed string.

mfresh 2007-12-19 10:40

Re: Customize X-term?
 
Perfect. Thanks Linuxrebel.

This new thing of having to press the Ctrl button on the tool bar, then tapping the screen to call up the keyboard, then typing in the p in the dialog box was driving me mad!

iancumihai 2007-12-19 11:12

Re: Customize X-term?
 
I've managed to add only enter to the shortcut toolbar
Here's what gconftool reports. Check how you can add these values.
I always forget things i don't use more then once :)


~ $ gconftool-2 -R /apps/osso/xterm
key_labels = [Tab,Esc,PgUp,PgDn,Enter]
scrollbar = true
font_size = 16
font_name = Monospace
foreground = #00ff00
keys = [Tab,Escape,Page_Up,Page_Down,KP_Enter]
scrollback = 200
font_size_delta = -4
toolbar = true
reverse = false
background = #000000


PS: i doubt you can have the CTRL-P google for "Page_Up,Page_Down,KP_Enter"

dblank 2007-12-19 18:54

Re: Customize X-term?
 
Quote:

Originally Posted by iancumihai (Post 111020)
PS: i doubt you can have the CTRL-P google for "Page_Up,Page_Down,KP_Enter"

<ctrl>p works

iancumihai 2007-12-21 18:10

Re: Customize X-term?
 
... speechless :o

ag2 2007-12-22 01:53

Re: Customize X-term?
 
A useful one to add to xterm is "bar" (or "Bar", don't remember) to print '|'.

GeneralAntilles 2007-12-22 02:08

Re: Customize X-term?
 
Quote:

Originally Posted by ag2 (Post 113554)
A useful one to add to xterm is "bar" (or "Bar", don't remember) to print '|'.

Mmm . . . I like this idea.

It's called a "pipe" around these parts. :D

recyclebin 2007-12-22 03:02

Re: Customize X-term?
 
Quote:

Originally Posted by ag2 (Post 113554)
A useful one to add to xterm is "bar" (or "Bar", don't remember) to print '|'.

What do I need to enter for pipe? I've tried various things, many of which kill xterm. Is there a list somewhere for the magic <> values to use with this toolbar? Like "KP_Enter" - apparently that's ENTER, but how do I know that?

Thank you for the help.

Addison 2007-12-22 04:33

Re: Customize X-term?
 
I'll jump in this topic as well.

I'm looking for a way to remove the cursor altogether, you know, the white square thingie where you're typing text.

It's been causing some weird problems using Telnet so I would be very grateful if anyone knew how for X-Term to not print the cursor at all.

Thanks. :)

skibur 2007-12-22 05:07

Re: Customize X-term?
 
Quote:

Originally Posted by recyclebin (Post 113580)
What do I need to enter for pipe? I've tried various things, many of which kill xterm. Is there a list somewhere for the magic <> values to use with this toolbar? Like "KP_Enter" - apparently that's ENTER, but how do I know that?

Thank you for the help.

Well, a faster way to pipe is to press and hold " ! " key and move your stylus up and release in a quick motion. You can do this with all keys on the on screen keyboard for different actions. Try left and right motion as well. Enjoy :p

skibur = skybur != skeebur

linuxrebel 2007-12-22 07:45

Re: Customize X-term?
 
Normaly I'd say "read the man page" however since we dont have man pages, heres the url http://linux.die.net/man/1/xterm Now the the harder part may be applyying this to the recently butchered version of xterm (if what we had before was the advanced version is this the ******ed one?) :p:eek:

linuxrebel 2007-12-22 07:50

Re: Customize X-term?
 
Quote:

Originally Posted by skibur (Post 113612)
Well, a faster way to pipe is to press and hold " ! " key and move your stylus up and release in a quick motion. You can do this with all keys on the on screen keyboard for different actions. Try left and right motion as well. Enjoy :p

skibur = skybur != skeebur

I'm guessing this is an n810 trick? On my n800 I get lotsa !!!!!!!!'s

ag2 2007-12-22 10:24

Re: Customize X-term?
 
Quote:

Originally Posted by recyclebin (Post 113580)
What do I need to enter for pipe? I've tried various things, many of which kill xterm. Is there a list somewhere for the magic <> values to use with this toolbar? Like "KP_Enter" - apparently that's ENTER, but how do I know that?

Thank you for the help.

The value you need to enter is "bar" or "Bar" as I said in the previous message. You can see all supported values by looking at the xterm source code.

ag2 2007-12-22 11:08

Re: Customize X-term?
 
Quote:

Originally Posted by ag2 (Post 113692)
The value you need to enter is "bar" or "Bar" as I said in the previous message. You can see all supported values by looking at the xterm source code.

To be more precise:

x-term:

Menu -> Tools -> Settings -> Toolbar shortcut -> New

Title: Bar
Value: bar

This will give you a new soft button that, when pressed, will print '|'

There are 1200+ characters for which you can create shortcuts -- things like umlauts, caps locks, and what not. Here is how to use them:

Look at this file:

http://olya.com/maemo/keysyms.c

The value you want to use in toolbar settings is the part after GDK_. So for a ')' you would use 'parenright'.

Hope this helps. Took me a while to figure this out.

ag2 2007-12-22 11:09

Re: Customize X-term?
 
Quote:

Originally Posted by skibur (Post 113612)
Well, a faster way to pipe is to press and hold " ! " key and move your stylus up and release in a quick motion. You can do this with all keys on the on screen keyboard for different actions. Try left and right motion as well. Enjoy :p

skibur = skybur != skeebur

Not sure I follow. How is this faster than hitting a button in x-term's toolbar?

skibur 2007-12-22 12:39

Re: Customize X-term?
 
Quote:

Originally Posted by ag2 (Post 113709)
Not sure I follow. How is this faster than hitting a button in x-term's toolbar?

I have N800 - OS2008. Not sure if N810 will work. I use " | " all the time. As far as being faster, its about the same. The good thing about the stylus motion trick is that you will not have to assign shortcuts to all your symbols. Press and hold a key and moving up your stylus (Note: Motion trick must be done under a second) will simulate a " shift " to the key you pressed.

Press & hold while moving " <direction> " then releasing:
UP = Shift
DOWN = Enter
RIGHT = Spacebar
LEFT = Backspace

I hope this helps.

qole 2008-01-03 17:58

Re: Customize X-term?
 
Quote:

Originally Posted by ag2 (Post 113708)
To be more precise:
There are 1200+ characters for which you can create shortcuts -- things like umlauts, caps locks, and what not. Here is how to use them:

Look at this file:

http://olya.com/maemo/keysyms.c

The value you want to use in toolbar settings is the part after GDK_. So for a ')' you would use 'parenright'.

This file doesn't work for all of the 1200+ listed characters. One of the characters listed is GDK_Home but putting Home into the value field of the shortcut doesn't send the cursor to the beginning of the line.

albright 2008-01-03 20:07

Re: Customize X-term?
 
I'm wondering if there is any way to assign a command
to the toolbar?

It looks like you can't assign a string of characters though.

One trick is to put an alias in .bashrc. I have "s" aliased
to "ssh -X user@othercomputer" and then the string
"s KP_Enter" gives a toolbar button that generates my
ssh command ...

But good old user does not have a .bashrc file so I can't use
this trick for the "sudo login root" command.

(I tried making a .bashrc file in /home/user but it had no
effect - don't know why)

So, is there any way to assign commands to the toolbar?

dblank 2008-01-03 22:29

Re: Customize X-term?
 
Quote:

Originally Posted by albright (Post 120150)
So, is there any way to assign commands to the toolbar?

Commas between characters works, but that's lame and there's likely a better way :)

Example:
"d,a,t,e KP_Enter"

pycage 2008-01-03 23:14

Re: Customize X-term?
 
Quote:

Originally Posted by qole (Post 120044)
This file doesn't work for all of the 1200+ listed characters. One of the characters listed is GDK_Home but putting Home into the value field of the shortcut doesn't send the cursor to the beginning of the line.

This is because Home doesn't work like this in the shell. What you want would be <ctrl>a.

Lupin3d 2008-01-03 23:19

Re: Customize X-term?
 
here some my shorcuts:
"Escape colon w,q KP_Enter" (when u are in VI this command write the file and quit VI)
"Escape colon q exclam KP_Enter" (when u are in VI this command quit VI whitout saving the file)
"<ctrl>c" (this command stop the current executing shell command).

ChodaBoy 2008-01-08 07:42

Re: Customize X-term?
 
Quote:

Originally Posted by Lupin3d (Post 120331)
here some my shorcuts:
"Escape colon w,q KP_Enter" (when u are in VI this command write the file and quit VI)
"Escape color q exclam KP_Enter" (when u are in VI this command quit VI whitout saving the file)
"<ctrl>c" (this command stop the current executing shell command).

I know it is just a typo, but "color" should also be "colon" in your quit vi without saving macro.

BTW, there is a rarely documented shortcut for ":wq" in vi. You can just use ":x".

:)

jimhoy 2008-09-04 04:21

Re: Customize X-term?
 
Here are some toolbar shortcuts I find useful on a daily basis:

| (pipe) = bar
^] (escape character) = <ctrl>,braceright
> (redirect stdout) = greater

tso 2008-10-19 20:48

Re: Customize X-term?
 
was playing around with this to ease some apt abuse and i found that rootsh dont like to be used this way. all i get is "file or dir not found".

could be that my hyphen is wrong tho as it does not match the one in the wiki. it seems to require lower case...

it seems indeed like the hyphen is at fault. it looks right, but isnt soo apparently...

ah, minus, not hyphen ;)

now i have my most common apt-get commands as shortcuts :D

Sevanteri 2008-10-20 07:57

Re: Customize X-term?
 
Is it possible to make a shortcut to type something into the commandline?

Nah... found it..

adityasa 2008-11-10 01:55

Re: Customize X-term?
 
sure,
it's easy
say you want to execute vi command, then type this shortcut:
"v,i,KP_Enter"

adityasa 2008-11-10 01:56

Re: Customize X-term?
 
Is anybody knows how to automatically execute command when starting xterm? I mean, when I start Xterm or new Xterm tab, can I get "sudo gainroot" command automatically executed without my intervention?

TIA.

silvermountain 2010-05-16 08:43

Re: Customize X-term?
 
I would settle for learning how to paste copied text into x-terminal :)

zombiegavins 2010-05-16 08:55

Re: Customize X-term?
 
if you are using an n900 just use the vkb and select the paste option when you have the input box open

silvermountain 2010-05-16 08:59

Re: Customize X-term?
 
Quote:

Originally Posted by zombiegavins (Post 660514)
if you are using an n900 just use the vkb and select the paste option when you have the input box open

Sorry, N810 and don't use the vkb on it.

silvermountain 2010-05-16 09:05

Re: Customize X-term?
 
lol nevermind..i just found 'paste' in the pull down menu..guess the lack of a) sleep and b) no ctrl-v support threw me a blonde moment...

Patola 2010-05-16 10:12

Re: Customize X-term?
 
Quote:

Originally Posted by ag2 (Post 113708)
To be more precise:

x-term:

Menu -> Tools -> Settings -> Toolbar shortcut -> New

Title: Bar
Value: bar
(...)

Sorry, I got a bit confused here. Only to clarify: these steps are not for osso-xterm for the N900, right? There is no "Tools" in my xterm menu, only "New", "Font", "Restart", "Restart and Clear".

Is there a way to apply this recipe to osso-xterm for the N900 that doesn't need fiddling with text-mode resource files? I've found /usr/share/gconf/schemas/osso-xterm.schemas that seems to have the configuration for the xterm 'soft keys', but I'd rather avoid to use it.

Patola 2010-05-16 12:42

Customizing xterm on the N900
 
I just figured out how to do it in the n900 with gconftool-2.

In the terminal, as user (not root):
  1. First, get the xml schema of the current configuration for xterm:
    Code:

    gconftool-2 --dump /schemas/apps/osso/xterm > /tmp/xterm.dump
  2. Make a backup of this dump. Save it somewhere, so that you can get back if you screw up:
    Code:

    cp /tmp/xterm.dump /home/user/MyDocs/xterm-keys.dump
  3. Then, using your preferred text editor (mine is vim, but can be leafpad, nano, etc.), open the dump file:
    Code:

    vim /tmp/xterm.dump
  4. You'll find a xml section (way under "key_labels") containing the default values for the labels of the keys. It ends in PgDn:
    Code:

                      <value>
                          <string>PgUp</string>
                        </value>
                        <value>
                          <string>PgDn</string>
                        </value>
                    </list>
                  </value>

  5. Add your values there (try to keep it short, because it uses space on the screen):
    Code:

                      <value>
                          <string>PgUp</string>
                        </value>
                        <value>
                          <string>PgDn</string>
                        </value>
                        <value>
                          <string>Pipe</string>
                        </value>
                        <value>
                          <string>&gt;</string>
                        </value>

                    </list>
                  </value>

  6. The next xml section has the key values, and you have to add accordingly. In this example, from:
    Code:

                        <value>
                          <string>Page_Up</string>
                        </value>
                        <value>
                          <string>Page_Down</string>
                        </value>
                    </list>
                  </value>

  7. We add:
    Code:

                        <value>
                          <string>Page_Up</string>
                        </value>
                        <value>
                          <string>Page_Down</string>
                        </value>
                        <value>
                          <string>bar</string>
                        </value>
                        <value>
                          <string>greater</string>
                        </value>
                    </list>
                  </value>

  8. Notice that these symbols have to be in their correct case. The symbol for pipe ("|") is bar, all lowercase, and the symbol for greater (">") is greater, all lowercase.
  9. Save the file then exit.
  10. Now, load the modified schema:
    Code:

    gconftool-2 --load /tmp/xterm.dump
  11. Voilą! You'll have your brand new symbols:http://img535.imageshack.us/img535/1...0051609410.png

manavs 2010-05-17 19:43

Re: Customizing xterm on the N900
 
Quote:

Originally Posted by Patola (Post 660761)
I just figured out how to do it in the n900 with gconftool-2.

Can this be done via ssh?

cobble 2010-05-17 21:04

Re: Customizing xterm on the N900
 
Quote:

Originally Posted by Patola (Post 660761)
I just figured out how to do it in the n900 with gconftool-2.

Thanks for this!
This is exactly what I was missing on my xterm, the Pipe
and '>' symbol. :-)

extendedping 2010-07-07 23:22

Re: Customize X-term?
 
ok let me first say I am not a programmer. I am trying to change the keys on the xterm using gconf and I have read the above posts. I did the dump and the backup etc.

what I don't understand, is under the "keys" section (if I am interpreting this correctly) is the actual specification of the key value to be added to the virtual terminal (the one line on the bottom of the screen).

then the "key_labels" section somehow maps the actual keys that you have specified to the names you want ie, what you will actually press.

but how do I know the names to input for the keys. for instance I read the value to input for the pipe "|" is bar, and the value to input for the ">" is greater.

but where are these values coming from? for instance I want to add both the forward slash "/" and the dash "-" to the menu.

where do I find their values? and how come I don't see Ctrl defined under keys or as a key_values but obviously it is there on my screen?

grog 2010-09-09 18:56

Re: Customizing xterm on the N900
 
Quote:

Originally Posted by Patola (Post 660761)
I just figured out how to do it in the n900 with gconftool-2.

Thanks again for this. What I can't figure out are what the key values for a few other keys I'd like to have, namely brackets ("[" & "]") & the tilde ("~"). The buttons show up fine but I can't figure out what gconf expects for a value. If I could find out where you figured out that pipe = bar that might help, but I can't even find that :mad:.

TX

techie 2010-09-09 19:12

Re: Customizing xterm on the N900
 
Quote:

Originally Posted by grog (Post 811902)
Thanks again for this. What I can't figure out are what the key values for a few other keys I'd like to have, namely brackets ("[" & "]") & the tilde ("~"). The buttons show up fine but I can't figure out what gconf expects for a value. If I could find out where you figured out that pipe = bar that might help, but I can't even find that :mad:.

TX

Use this
http://wiki.linuxquestions.org/wiki/List_of_keysyms
So [ is "bracketleft" and so on..

Zas 2010-09-09 19:16

Re: Customize X-term?
 
[ is "bracketleft" and ] is "bracketright". ~ should be "asciitilde".


| 1   2   | Next
All times are GMT. The time now is 00:56.

vBulletin® Version 3.8.8