VectorLinux

Vectorbie Station => Vectorbie Questions => Topic started by: TomEd on May 14, 2007, 07:57:58 pm

Title: xinitrc and xmodmap
Post by: TomEd on May 14, 2007, 07:57:58 pm
Hi all

I just started with Vector yesterday and I'm enjoying it so far. I'm using 5.8 Standard on a really old HP laptop.

I have installed the window manager, ratpoison, and it works well.  ratpoison uses the 'ctrl' key a lot, so I like to map Caps-Lock to 'ctrl'. I have written an .Xmodmap in my home directory, and I can run it with "xmodmap .Xmodmap", and the mapping works. Rather than do this every time, I want to put the call to .Xmodmap in my xinitrc file. I have tried lots of variations of xinitrc.ratpoison but nothing works. This is the latest incarnation:

#!/bin/sh
xmodmap $HOME/.Xmodmap &
exec ratpoison

This is in /etc/X11/initrc/ along with the other xinitrc files. I have changed the permissions to make it executable. 

Incidentally, the mapping works when I am in xfce...where I don't really want it!

Any ideas are most welcome!

Thanks,
Tom

Title: Re: xinitrc and xmodmap
Post by: saulgoode on May 14, 2007, 09:06:16 pm
Perhaps you have a '~/.ratpoisonrc' file which is executing xmodmap after your 'xinitrc.ratpoison'?

If so, I would recommend modifying it to set your xmodmap.
Title: Re: xinitrc and xmodmap
Post by: TomEd on May 14, 2007, 09:24:08 pm
I created a .ratpoisonrc, and used that to call xmodmap, just as you suggested, and it worked. Thanks!

In case anyone is interested in writing a .ratpoisonrc, this one has about everything you could want and more:

http://en.wikibooks.org/wiki/Using_Ratpoison/Example_Config
Title: Re: xinitrc and xmodmap
Post by: Triarius Fidelis on May 14, 2007, 10:36:45 pm
I used to use ratpoison. Found it a wee bit too spartan, even for my tastes. But if you like rp (and perhaps FP), you'll love xmonad (http://www.xmonad.org).
Title: Re: xinitrc and xmodmap
Post by: TomEd on May 14, 2007, 10:56:06 pm
A new one!  I thought I'd tried just about all of the minimalistic, keyboard driven WMs.  Maybe one day I'll take a look at that...one day after I've learned Haskell (I guess that's what the FP is...I'm not a programmer).
Title: Re: xinitrc and xmodmap
Post by: Triarius Fidelis on May 14, 2007, 11:15:29 pm
FP is not Haskell, but Haskell is FP. Nice introduction on the subject. (http://www.defmacro.org/ramblings/fp.html)
Title: Re: xinitrc and xmodmap
Post by: kidd on May 15, 2007, 01:42:09 am
Welcome TomEd,
I'm addicted to ratpoison too, and I have my CAPSLOCK key binded to control too.
If you want to see how my .ratpoisonrc looks : http://raimonster.googlepages.com/ratpoison

After trying nearly every of those "minimalistic" wm, I stayed with ratpoison, but I'm feeling like giving a chance to those new ones (xmonad, wmii3...) provided they don't have library dependencies.

Don't hesitate to comment anything on that great wm, it's always nice to share experiences on those kind of apps.  I learn new rp features everyday.
Title: Re: xinitrc and xmodmap
Post by: Triarius Fidelis on May 15, 2007, 01:47:48 am
After trying nearly every of those "minimalistic" wm, I stayed with ratpoison, but I'm feeling like giving a chance to those new ones (xmonad, wmii3...) provided they don't have library dependencies.

xmonad has no dependencies other than a functioning Haskell system. Remember, Xlib is just socket-based I/O. Probably a good investment of disk space.

(I switched back to WindowMaker though...my hands are generally engaged with the keyboard anyway.)
Title: Re: xinitrc and xmodmap
Post by: TomEd on May 15, 2007, 05:13:06 am
Cheers, kidd,

On looking through your .ratpoisonrc, I found "undo".  I can't believe I lived without that before!
Title: Re: xinitrc and xmodmap
Post by: kidd on May 15, 2007, 02:38:32 pm
There's even a redo command (though I've never used it).

Lately (since hanu threw http://www.vectorlinux.com/forum2/index.php?topic=2969.0) I'm thinking of writing a howto about converting your whole pc the most vim-like I can.  Definately, a wiki would be better, but there are only forums available.

In the same direction, we could start a thread in the software section about ratpoison.  As ratpoison wiki is often unavailable, I don't know what to do with the new tricks/features I discover. 

What do you think guys? Those post won't be a monologe, so starting both in software section would be better.

Regards
Title: Re: xinitrc and xmodmap
Post by: TomEd on May 15, 2007, 08:29:50 pm
I'd certainly be interested in that.  By 'vim-like' do you mean making everything keyboard controllable without all the 'chording' of Emacs?
Title: Re: xinitrc and xmodmap
Post by: Triarius Fidelis on May 15, 2007, 08:33:25 pm
There's even a redo command (though I've never used it).

Lately (since hanu threw http://www.vectorlinux.com/forum2/index.php?topic=2969.0) I'm thinking of writing a howto about converting your whole pc the most vim-like I can.  Definately, a wiki would be better, but there are only forums available.

Vim-like Gtk key theme:
http://www.vim.org/tips/tip.php?tip_id=970
Title: Re: xinitrc and xmodmap
Post by: kidd on May 16, 2007, 02:09:34 am
I'd certainly be interested in that.  By 'vim-like' do you mean making everything keyboard controllable without all the 'chording' of Emacs?

For me, the main point is everything being keyboard drive, better if hjkl driven. Since I got used to hjkl, using apps that don't understand that basic key movements turns me crazy.

I've tried to learn emacs a few times, but never got used to so many control keys.
I'm open to learn emacs, so you can try to convince me, or point some good tutorials (emacs tutorial c-h t is not that nice;)

hanu:
ty for the tip, I'll try it when I get home.  Until now I was using the emacs bindings for gtk.  ctrl-w deleting previous word has become quite natural to me, and basic emacs movement (as in default shells) too, but I'll try vim-ish for sure.

Seeya!





Title: Re: xinitrc and xmodmap
Post by: Triarius Fidelis on May 16, 2007, 03:21:31 am
I've tried to learn emacs a few times, but never got used to so many control keys.
I'm open to learn emacs, so you can try to convince me, or point some good tutorials (emacs tutorial c-h t is not that nice;)

Well, I won't really try to convince you. Not to use GNU Emacs anyway. XEmacs maybe, but I'm content with Vim now.

If you do plan to use any kind of Emacs, consider something like the viper package.
Title: Re: xinitrc and xmodmap
Post by: TomEd on May 16, 2007, 08:50:07 am
I prefer vim because it is much easier on my hands, but I keep going back to Emacs - mostly because of Auctex.

hanumizzle: Out of interest, is your preference for XEmacs political or feature driven?  I have only played with XEmacs very briefly.
Title: Re: xinitrc and xmodmap
Post by: Triarius Fidelis on May 16, 2007, 08:23:40 pm
I prefer vim because it is much easier on my hands, but I keep going back to Emacs - mostly because of Auctex.

hanumizzle: Out of interest, is your preference for XEmacs political or feature driven?  I have only played with XEmacs very briefly.

Mostly feature driven. I don't see the big deal because I can have the source for both of them. I certainly don't consider RMS an ass.

In any case, Vim LaTeX (http://vim-latex.sourceforge.net) may be what you want, however.
Title: Re: xinitrc and xmodmap
Post by: TomEd on May 16, 2007, 09:30:51 pm
I hate to sound sappy, but I'm really loving Vector!

I have previously tried vim-latex on Ubuntu and Debian, on a faster machine, and, somehow it has never worked as well as it is now, on Vector, on a circa 2000 laptop.  The major stumbling block before was the insertion of references and citations, which was buggy at best.  I have no idea why this is working better...but it is!

The ratpoision-flavour of this thread has become a little tainted...

Title: Re: xinitrc and xmodmap
Post by: kidd on May 17, 2007, 01:48:18 am
I've started a thread http://www.vectorlinux.com/forum2/index.php?topic=3023.0
Maybe I should modify the title, suggestions accepted.

Happy vectoring!