.xmodmap at startup of X - Slackware

This is a discussion on .xmodmap at startup of X - Slackware ; I would like to know how can i set xmodmap to be executed only once X has loaded. the .bash_profile is not the solution at all, since it launches its content each time I login in a new shell -- ...

+ Reply to Thread
Results 1 to 14 of 14

Thread: .xmodmap at startup of X

  1. .xmodmap at startup of X

    I would like to know how can i set xmodmap to be executed only once X has
    loaded.

    the .bash_profile is not the solution at all, since it launches its content each
    time I login in a new shell

    --
    heavytull

  2. Re: .xmodmap at startup of X

    Op 24-09-2007 schreef heavytull :

    > I would like to know how can i set xmodmap to be executed only once X
    > has loaded.


    That's normally done in /etc/X11/xinit/xinitrc, just before loading the
    window manager. The xinitrc scripts supplied with Slackware already do
    this, look inside them for examples.

    - M.

  3. Re: .xmodmap at startup of X

    Martijn Dekker wrote:

    > Op 24-09-2007 schreef heavytull :
    >> I would like to know how can i set xmodmap to be executed only once X
    >> has loaded.


    > That's normally done in /etc/X11/xinit/xinitrc, just before loading the
    > window manager. The xinitrc scripts supplied with Slackware already do
    > this, look inside them for examples.


    xinitrc is run when X is started with startx. However, if X is started
    with kdm (or another xdm-clone) a file Xsession is used instead. Again,
    however, the default Slackware Xsession files load $HOME/.Xmodmap and
    /usr/lib/X11/xinit/.Xmodmap

    regards Henrik
    --
    The address in the header is only to prevent spam. My real address is:
    hc1(at)poolhem.se Examples of addresses which go to spammers:
    root@localhost postmaster@localhost


  4. Re: .xmodmap at startup of X

    On 2007-09-24, Martijn Dekker wrote:
    > Op 24-09-2007 schreef heavytull :
    >
    >> I would like to know how can i set xmodmap to be executed only once X
    >> has loaded.

    >
    > That's normally done in /etc/X11/xinit/xinitrc, just before loading the
    > window manager. The xinitrc scripts supplied with Slackware already do
    > this, look inside them for examples.
    >
    > - M.


    This is on Debian, but the same may apply. In the last week or two I've
    found that xmodmap is no longer being read from ~/.xinitrc, although it
    had been working for many months or even years. I've therefore put it in
    ~/.bashrc, which works well.

    Anthony



    --
    Anthony Campbell - ac@acampbell.org.uk
    Microsoft-free zone - Using Linux Gnu-Debian
    http://www.acampbell.org.uk (blog, book reviews,
    on-line books and sceptical articles)


  5. Re: .xmodmap at startup of X

    Martijn Dekker wrote:

    > Op 24-09-2007 schreef heavytull :
    >
    >> I would like to know how can i set xmodmap to be executed only once X
    >> has loaded.

    >
    > That's normally done in /etc/X11/xinit/xinitrc, just before loading the
    > window manager. The xinitrc scripts supplied with Slackware already do
    > this, look inside them for examples.
    >
    > - M.

    yes the xinitrc file already does that. I placed the .Xmodmap in my home
    directory but at startup of X this morning i'm noticing that that didn't work
    at all!

    --
    heavytull

  6. Re: .xmodmap at startup of X

    On 2007-09-25, heavytull wrote:
    > Martijn Dekker wrote:
    >
    >> Op 24-09-2007 schreef heavytull :
    >>
    >>> I would like to know how can i set xmodmap to be executed only once X
    >>> has loaded.

    >>
    >> That's normally done in /etc/X11/xinit/xinitrc, just before loading the
    >> window manager. The xinitrc scripts supplied with Slackware already do
    >> this, look inside them for examples.
    >>
    >> - M.

    > yes the xinitrc file already does that. I placed the .Xmodmap in my home
    > directory but at startup of X this morning i'm noticing that that didn't work
    > at all!
    >


    So it's not a Debian-specific problem. Put it in ~/.bashrc, as I
    suggested earlier.

    Anthony

    --
    Anthony Campbell - ac@acampbell.org.uk
    Microsoft-free zone - Using Linux Gnu-Debian
    http://www.acampbell.org.uk (blog, book reviews,
    on-line books and sceptical articles)


  7. Re: .xmodmap at startup of X

    Anthony Campbell wrote:

    > On 2007-09-25, heavytull wrote:
    >> Martijn Dekker wrote:
    >>
    >>> Op 24-09-2007 schreef heavytull :
    >>>
    >>>> I would like to know how can i set xmodmap to be executed only once X
    >>>> has loaded.
    >>>
    >>> That's normally done in /etc/X11/xinit/xinitrc, just before loading the
    >>> window manager. The xinitrc scripts supplied with Slackware already do
    >>> this, look inside them for examples.
    >>>
    >>> - M.

    >> yes the xinitrc file already does that. I placed the .Xmodmap in my home
    >> directory but at startup of X this morning i'm noticing that that didn't work
    >> at all!
    >>

    >
    > So it's not a Debian-specific problem. Put it in ~/.bashrc, as I
    > suggested earlier.
    >
    > Anthony
    >

    in ~/.bashrc is equivalent to ~/.bash_profile????
    --
    heavytull

  8. Re: .xmodmap at startup of X

    On 2007-09-25, heavytull wrote:
    > Anthony Campbell wrote:
    >
    >> On 2007-09-25, heavytull wrote:
    >>> Martijn Dekker wrote:
    >>>
    >>>> Op 24-09-2007 schreef heavytull :
    >>>>
    >>>>> I would like to know how can i set xmodmap to be executed only once X
    >>>>> has loaded.
    >>>>
    >>>> That's normally done in /etc/X11/xinit/xinitrc, just before loading the
    >>>> window manager. The xinitrc scripts supplied with Slackware already do
    >>>> this, look inside them for examples.
    >>>>
    >>>> - M.
    >>> yes the xinitrc file already does that. I placed the .Xmodmap in my home
    >>> directory but at startup of X this morning i'm noticing that that didn't work
    >>> at all!
    >>>

    >>
    >> So it's not a Debian-specific problem. Put it in ~/.bashrc, as I
    >> suggested earlier.
    >>
    >> Anthony
    >>

    > in ~/.bashrc is equivalent to ~/.bash_profile????



    Well, not quite, at least for me. My .bash_profile has this:

    ----------------------------------------------
    source $HOME/.bashrc

    if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
    ----------------------------------------------

    So my stuff actually goes in .bashrc to be executed. But I suppose you
    could put it all in .bash_profile equally well.

    HOWEVER, I have found a serious flaw with my solution to the xmodmap
    problem. It makes xmodmap work all right but this has undesirable
    conseqpuences, because bash tries to run xmodmap when it boots before X
    is started and this produces an error in the console. That might not
    matter much, but it also slows down dramatically, or even prevents,
    pinging and ssh between computers on my network.

    I'll have to read the bash man page to see if there is a way round this.
    Meanwhile I'm putting in a bug report for xinit (if that is where the
    problem lies.)

    Anthony


    --
    Anthony Campbell - ac@acampbell.org.uk
    Microsoft-free zone - Using Linux Gnu-Debian
    http://www.acampbell.org.uk (blog, book reviews,
    on-line books and sceptical articles)


  9. Re: .xmodmap at startup of X

    * Anthony Campbell :
    [ ... calling xmodmap from '~/.bashrc' ... ]
    > HOWEVER, I have found a serious flaw with my solution to the xmodmap
    > problem. It makes xmodmap work all right but this has undesirable
    > conseqpuences, because bash tries to run xmodmap when it boots before
    > X is started and this produces an error in the console. That might not
    > matter much, but it also slows down dramatically, or even prevents,
    > pinging and ssh between computers on my network.


    You could test that $DISPLAY is set before invoking xmodmap.

    if [ -n "$DISPLAY" ]; then
    xmodmap ...
    fi

    --
    James Michael Fultz
    Remove this part when replying ^^^^^^^^

  10. Re: .xmodmap at startup of X

    Anthony Campbell wrote:

    > On 2007-09-25, heavytull wrote:
    >> Anthony Campbell wrote:
    >>
    >>> On 2007-09-25, heavytull wrote:
    >>>> Martijn Dekker wrote:
    >>>>
    >>>>> Op 24-09-2007 schreef heavytull :
    >>>>>
    >>>>>> I would like to know how can i set xmodmap to be executed only once X
    >>>>>> has loaded.
    >>>>>
    >>>>> That's normally done in /etc/X11/xinit/xinitrc, just before loading the
    >>>>> window manager. The xinitrc scripts supplied with Slackware already do
    >>>>> this, look inside them for examples.
    >>>>>
    >>>>> - M.
    >>>> yes the xinitrc file already does that. I placed the .Xmodmap in my home
    >>>> directory but at startup of X this morning i'm noticing that that didn't
    >>>> work at all!
    >>>>
    >>>
    >>> So it's not a Debian-specific problem. Put it in ~/.bashrc, as I
    >>> suggested earlier.
    >>>
    >>> Anthony
    >>>

    >> in ~/.bashrc is equivalent to ~/.bash_profile????

    >
    >
    > Well, not quite, at least for me. My .bash_profile has this:
    >
    > ----------------------------------------------
    > source $HOME/.bashrc
    >
    > if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
    > ----------------------------------------------
    >
    > So my stuff actually goes in .bashrc to be executed. But I suppose you
    > could put it all in .bash_profile equally well.
    >
    > HOWEVER, I have found a serious flaw with my solution to the xmodmap
    > problem. It makes xmodmap work all right but this has undesirable
    > conseqpuences, because bash tries to run xmodmap when it boots before X
    > is started and this produces an error in the console. That might not
    > matter much, but it also slows down dramatically, or even prevents,
    > pinging and ssh between computers on my network.
    >
    > I'll have to read the bash man page to see if there is a way round this.
    > Meanwhile I'm putting in a bug report for xinit (if that is where the
    > problem lies.)
    >
    > Anthony
    >
    >

    that's actually why i came up creating this thread, just read the original post
    --
    heavytull

  11. Re: .xmodmap at startup of X

    On 2007-09-25, James Michael Fultz wrote:
    > * Anthony Campbell :
    > [ ... calling xmodmap from '~/.bashrc' ... ]
    >> HOWEVER, I have found a serious flaw with my solution to the xmodmap
    >> problem. It makes xmodmap work all right but this has undesirable
    >> conseqpuences, because bash tries to run xmodmap when it boots before
    >> X is started and this produces an error in the console. That might not
    >> matter much, but it also slows down dramatically, or even prevents,
    >> pinging and ssh between computers on my network.

    >
    > You could test that $DISPLAY is set before invoking xmodmap.
    >
    > if [ -n "$DISPLAY" ]; then
    > xmodmap ...
    > fi
    >


    Thanks for this suggestion, which I will apply. Meanwhile, I've had a
    reply from the Debian maintainer of xserver-xorg. He tells me there is
    an upstream bug in this which has been seen by others and will be fixed
    in the forthcoming upgrade.

    Anthony

    --
    Anthony Campbell - ac@acampbell.org.uk
    Microsoft-free zone - Using Linux Gnu-Debian
    http://www.acampbell.org.uk (blog, book reviews,
    on-line books and sceptical articles)


  12. Re: .xmodmap at startup of X

    > I would like to know how can i set xmodmap to be executed only once X has
    > loaded.
    >
    > the .bash_profile is not the solution at all, since it launches its
    > content each time I login in a new shell


    If you use a login manager (like xdm, kdm or gdm) you can put any X commands
    in $HOME/.xprofile



    --
    damjan

  13. Re: .xmodmap at startup of X

    James Michael Fultz wrote:

    > * Anthony Campbell :
    > [ ... calling xmodmap from '~/.bashrc' ... ]
    >> HOWEVER, I have found a serious flaw with my solution to the xmodmap
    >> problem. It makes xmodmap work all right but this has undesirable
    >> conseqpuences, because bash tries to run xmodmap when it boots before
    >> X is started and this produces an error in the console. That might not
    >> matter much, but it also slows down dramatically, or even prevents,
    >> pinging and ssh between computers on my network.

    >
    > You could test that $DISPLAY is set before invoking xmodmap.
    >
    > if [ -n "$DISPLAY" ]; then
    > xmodmap ...
    > fi
    >

    that's not a good idea, this will load the .Xmodmap every time you run a new
    bash under X

    --
    heavytull

  14. Re: .xmodmap at startup of X

    On Sep 26, 11:38 pm, Damjan wrote:
    > > I would like to know how can i setxmodmapto be executed only once X has
    > > loaded.

    >
    > > the .bash_profile is not the solution at all, since it launches its
    > > content each time I login in a new shell

    >
    > If you use a login manager (like xdm, kdm or gdm) you can put any X commands
    > in $HOME/.xprofile
    >
    > --
    > damjan


    I suggest:
    if [[ -n "$DISPLAY" && -z "$XMODMAP_USER" ]];then
    xmodmap .Xmodmap
    XMODMAP_USER=1
    fi
    where XMODMAP_USER is a new environnment variable

    but actually i should use export i think so as this variable caould be
    read from any new session of that user.


+ Reply to Thread