пятница, октября 27, 2006

Send messages on Ctrl-Enter in GAIM 2.0.0beta4

"If you find a feature, it might confuse the user, so remove it." (c)

Okay, I do like the new interface in GAIM 2.0 beta, shipped with Ubuntu 6.10 'Edgy Eft'. It sucks a lot less than 1.x series did.

They Preferences dialog has been cleaned up considerably. A lot of rarely-used options were removed, so it's a lot easier to navigate and with luck you can get GAIM configured to your liking in under 5 minutes.

Unfortunately, the "Send message on Ctrl-Enter" setting that I use happened to be among the options that had to go. The FAQ does address the change but is not very helpful, and I had to spend some time researching. And here are direct instructions:

In your home dir, find or create a file named .gtkrc-2.0 and add the following lines:
binding "my-message-bindings"
bind "Return" { "insert-at-cursor" ("\n") }
bind "<ctrl>Return" { "message_send" () }
widget "*gaim_gtkconv_entry" binding "my-message-bindings"
Restart GAIM and enjoy.


Anonymous Анонимный said...

I am sorry, I don't think this will work. If you bind the same key to two different event, I think the default behaviour will be enforced. But I may be wrong (as I am not a programmer and did not look at the source code). At least it doesn't work on my Fedora Core 6 with gaim 2.0.0b4. As well as this doesn't work either:

binding "olds"
# enter inserts a newline
bind "Return" { "insert-at-cursor" ("\n") }
# ctrl-enter sends message
bind "<ctrl>Return" { "message_send" () }
# Shift-f1 toggles bold
bind "<shift>F1" { "format_function_toggle" (1) }
# Shift-f2 toggles italic
bind "<shift>F2" { "format_function_toggle" (2) }
# Shift-f3 toggles underline
bind "<shift>F3" { "format_function_toggle" (4) }
# Shift-f4 resets the formatting
bind "<shift>F4" { "format_function_clear" () }
widget "*gaim_gtkconv_entry" binding "olds"

Well, actually the part about text formatting does work, but not the Return/control+return.

Blogger toneg said...

Oops, it turns out Blogger failed to escape the <ctrl> in the second bind. Fixed. Thanks for pointing this out.

Blogger toneg said...

Strange your script doesn't work, seeing how it's essentially identical to mine.

Are you sure it's actually being parsed by gtk? Might it be that the <shift>F1 happen to work simply because are builtin in GAIM?

Anonymous Анонимный said...

I am sure it's being parsed because I have some other entries in it, mostly for making fonts smaller and other decoration as well. If I move this file away, I don't get the formatting key-bindings anymore. It does seem strange, unless I am missing something.
I can email the whole gtkrc-2.0, but it is pretty much same as from FAQ on gaim's page. Plus I just tried to leave the binding section only, I still get "Return" for send message and Ctrl-Return for next line in the typing box.

Blogger toneg said...

Well, I'm out of ideas. Might be a good idea to ask the developers.

Anonymous Dmitry said...

Tried this on Gaim 2.0.0 beta 3.1 and it worked!

Blogger kaicevy said...

Этот комментарий был удален администратором блога.


Отправить комментарий

<< Home