LinHES Forums
http://forum.linhes.org/

Getting xmodmap to run at startup
http://forum.linhes.org/viewtopic.php?f=5&t=3093
Page 1 of 1

Author:  ceenvee703 [ Sun Dec 19, 2004 3:18 pm ]
Post subject:  Getting xmodmap to run at startup

Short version: how can I get xmodmap to run when X starts up? I put the following line at the end of my ~/.fvwm/.fvwm2rc file

Code:
exec xmodmap /home/mythtv/.xmodmaprc


but it doesn't seem to work. If I do the line by hand via an xterm window, it does work.

Background: I'm doing this to try to map some of the ATI Remote Wonder keys that don't do anything by defualt to send keystrokes to MythTV. I found the keys being sent with xev, made a list and put it in .xmodmaprc (because I thought it would auto-load that way). As I said above, if I run the line manually, it works fine. I'd like to get it to run when I start up my machine.

Author:  sglynn [ Wed Jan 26, 2005 6:00 pm ]
Post subject: 

I'm not at my mythbox, so I hope the syntax is correct. I'm assuming you're using KnoppMyth

In KnoppMyth-run which is in /usr/local/bin (I think)

there is a line that says something like like

exec mythfrontend;

replace it with

exec xmodmap modmapfile | exec mythfrontend;

worked for me.

Simon

Author:  hbj [ Tue Nov 22, 2005 12:17 am ]
Post subject:  xmodmaps

I wrote a little script to use different xmodmaps with my ATI remote depending on whether I am watching recordings, watching DVD's or videos, or running xmame or another program. In case it might help you, the thread is here.

To get my MythTV key mappings to load when MythTV first starts from a reboot, I modiified the file /home/mythtv/.fluxbox/apps to look like this:
Code:
[startup] {xset -dpms s off}
[startup] {xmodmap /home/mythtv/.Xmodmap_ati_mythtv}
[startup] {KnoppMyth-run}
[app] (SDL_App)
  [Layer]       {2}
  [Deco]        {NONE}
[end]


I also modified the menu to launch MythTV with different key mappings depending on whether I wanted to use a keyboard or the ATI remote by adding to /home/mythtv/.fluxbox/menu:
Code:
[submenu] (MythTV) {}
      [exec] (MythTV) {/usr/bin/mythfrontend}
      [exec] (MythTV - ATI Remote) {/home/mythtv/bin/myth_ati_remote}
      [exec] (MythTV - No ATI Remote) {/home/mythtv/bin/myth_noati_remote}
   [end]
   [submenu] (XModmaps) {}
      [exec] (MythTV - ATI Remote) {xmodmap /home/mythtv/.Xmodmap_ati_mythtv}
      [exec] (Normal Keybindings) {xmodmap /home/mythtv/.Xmodmap_normal}
   [end]

where /home/mythtv/bin/myth_ati_remote looks like:
Code:
#!/bin/bash
xmodmap /home/mythtv/.Xmodmap_ati_mythtv
/usr/bin/mythfrontend

and /home/mythtv/bin/myth_noati_remote looks like:
Code:
#!/bin/bash
xmodmap /home/mythtv/.Xmodmap_normal
/usr/bin/mythfrontend


The (normal) key mappings were set by restarting the X server without loading any other xmodmap files and capturing the default settings with:
Code:
xmodmap -pke > /home/mythtv/.Xmodmap_normal


The key mappings in /home/mythtv/.Xmodmap_ati_mythtv should be set to things that make sense to you.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/