Re: How to disable certain keys

2015-08-30 Thread David Wright
Quoting Bret Busby (bret.bu...@gmail.com):

> >> xmodmap ~/.xmodmap-`uname-n`
> >>
> >> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$

That's quite a hostname!

> >> "
> >>
> >> Which I will test, the next time that I reboot (which probably will
> >> not be for a few hours).
> >>
> >
> > Unfortunately, this path of action, has turned out to be quite harmful.
> >
> > At first, it took away my  key functionality, and now I have lost
> > the functionality of the cursor control keys, and so have to disable
> > the numberic keypad, in order to access cursor control positioning.
> >
> > I have tried to restore the default settings, to no avail.
> >
> 
> And the  and  keys, and the  key, have also
> stopped working. It is a bit like Langoliers or Pacman, eating the
> keyboard functionality.

I've no idea what you've put into .xmodmap but I think that's quite a
blunt instrument to be using. As you're obviously only concerned with X,
I'd have thought that the "potted recipes" at the end of
/usr/share/X11/xkb/rules/base.lst would be sufficient, and these can
be set from XKBOPTIONS in /etc/default/keyboard.

Cheers,
David.



Re: How to disable certain keys

2015-08-30 Thread Bret Busby
On 30/08/2015, Bret Busby  wrote:
> On 16/08/2015, Bret Busby  wrote:
>> On 16/08/2015, Bret Busby  wrote:
>>> On 16/08/2015, to...@tuxteam.de  wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On Sun, Aug 16, 2015 at 12:04:17PM +0800, Bret Busby wrote:
> On 15/08/2015, Carl Johnson  wrote:
> > Bret Busby  writes:

 [...]

> > That same right-click menu has an option to save the settings to a
> > .xmodmap file and shows how to include that file on start.

 [...]

> Okay; whilst the option to save the settings to the .xmodmap file, is
> not explicit, and I had to guess it (something like "Write settings"
> from memory), in the response to doing that, it returns a dialgue box
> that states "You should modify your login script to include a line
> like  "
>
> How do I modify the login script? I do not know the file name or path,
> for the login script.

 That depends a bit on what shell you are using and on your other
 general
 setup. Typically, if your shell is bash, this file will be called
 .bash_login (note the dot at the start o the name), and will live in
 your
 home directory.

 How does the line you are supposed to include look?

>>>
>>> Hello.
>>>
>>> Unfortunately, like with many other message boxes/dialogue boxes,
>>> copying and pasting, is not possible.
>>>
>>> In the particular message box, is
>>>
>>> "
>>> Wrote output to the file
>>> /home/bret/.xmodmap-bret-Aspire-V3-772-UbuntuMATE-1504
>>>
>>> You should modify your login script to include a line like
>>> xmodmap ~/.xmodmap-`uname-n`
>>> (those are backquotes.)
>>> 
>>> "
>>>
>>> "
>>> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ cat .bash_login
>>> cat: .bash_login: No such file or directory
>>> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ sudo cat
>>> /home/bret/.bask_login
>>> sudo: unable to resolve host bret-Aspire-V3-772-UbuntuMATE-1504
>>> [sudo] password for bret:
>>> cat: /home/bret/.bask_login: No such file or directory
>>> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ sudo cat
>>> /home/bret/.bash_login
>>> sudo: unable to resolve host bret-Aspire-V3-772-UbuntuMATE-1504
>>> cat: /home/bret/.bash_login: No such file or directory
>>> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$
>>> "
>>>
>>
>>
>> So, it occurred to me, to do an "ls" on ".*" and I got (apart from the
>> . directories),
>>
>> "
>> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ ls .*
>> .bash_history  .bashrc  .ICEauthority .profile
>> .Xauthority  .xmodmap-bret-Aspire-V3-772-UbuntuMATE-1504
>> .xsession-errors.old
>> .bash_logout   .dmrc.pam_environment  .sudo_as_admin_successful
>> .xinputrc.xsession-errors
>> "
>>
>> So, in running cat .profile, I got
>>
>> "
>> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ cat .profile
>> # ~/.profile: executed by the command interpreter for login shells.
>> # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
>> # exists.
>> # see /usr/share/doc/bash/examples/startup-files for examples.
>> # the files are located in the bash-doc package.
>>
>> # the default umask is set in /etc/profile; for setting the umask
>> # for ssh logins, install and configure the libpam-umask package.
>> #umask 022
>>
>> # if running bash
>> if [ -n "$BASH_VERSION" ]; then
>> # include .bashrc if it exists
>> if [ -f "$HOME/.bashrc" ]; then
>>  . "$HOME/.bashrc"
>> fi
>> fi
>>
>> # set PATH so it includes user's private bin if it exists
>> if [ -d "$HOME/bin" ] ; then
>> PATH="$HOME/bin:$PATH"
>> fi
>> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$
>> "
>>
>> So, I asume that this is the applicable file, in the absence of the
>> two named .bash* files.
>>
>> So, after editing that file, I now have
>>
>> "
>> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ cat .profile
>> # ~/.profile: executed by the command interpreter for login shells.
>> # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
>> # exists.
>> # see /usr/share/doc/bash/examples/startup-files for examples.
>> # the files are located in the bash-doc package.
>>
>> # the default umask is set in /etc/profile; for setting the umask
>> # for ssh logins, install and configure the libpam-umask package.
>> #umask 022
>>
>> # if running bash
>> if [ -n "$BASH_VERSION" ]; then
>> # include .bashrc if it exists
>> if [ -f "$HOME/.bashrc" ]; then
>>  . "$HOME/.bashrc"
>> fi
>> fi
>>
>> # set PATH so it includes user's private bin if it exists
>> if [ -d "$HOME/bin" ] ; then
>> PATH="$HOME/bin:$PATH"
>> fi
>>
>> # attempt to invoke .xmodmap upon login
>> xmodmap ~/.xmodmap-`uname-n`
>>
>> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$
>> "
>>
>> Which I will test, the next time that I reboot (which probably will
>> not be for a few hours).
>>
>
> Unfortunately, this path of action, has turned out to be quite harmful.
>
> At first, it took away my  key functionality, and now I have lost
> the functionality of t

Re: How to disable certain keys

2015-08-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 16, 2015 at 10:42:40PM +0100, Brian wrote:

[...]

> It cannot be set up by users without root privileges and does nothing
> that the stock X won't do. That makes it inelegant, over-engineered and
> therefore unnecessary. :)
> 
> ~/.xmodmap with the contents "keycode 54 = z". ~/.xsessionrc with the
> contents "xmodmap .xmodmap". Two files; two lines; total control.

All has been said. Let's just agree to differ.

Regards
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlXReagACgkQBcgs9XrR2kblUgCfXSRSe+YHMBF1aLR7eirBfSg1
5EUAn09domw94+68N6yzxstrfpHoIqAM
=Gupx
-END PGP SIGNATURE-



Re: How to disable certain keys

2015-08-16 Thread Brian
On Mon 17 Aug 2015 at 12:41:27 +0800, Bret Busby wrote:

> On 17/08/2015, Brian  wrote:
> >
> > ~/.xmodmap with the contents "keycode 54 = z". ~/.xsessionrc with the
> > contents "xmodmap .xmodmap". Two files; two lines; total control.
> 
> I appear to not have a file .xsessionrc

Create it.

> I do have a file.xinputrc
> 
> Should the line "xmodmap .xmodmap" be inserted in the .xinputrc file,
> in the absence of an .xsessionrc file?

As far as I know, .xinputrc has no significance on Debian.



Re: How to disable certain keys

2015-08-16 Thread Bret Busby
On 17/08/2015, Brian  wrote:
> On Sun 16 Aug 2015 at 21:18:10 +0200, to...@tuxteam.de wrote:
>
>> On Sun, Aug 16, 2015 at 07:57:20PM +0100, Brian wrote:
>> > On Sun 16 Aug 2015 at 20:21:05 +0200, to...@tuxteam.de wrote:
>>
>> [...]
>>
>> > It still comes down to why intrude on the user's province? One file,
>> > .xsessionrc, and one line in the file to disable the caps lock. The
>> > desire to go to root to do things easily done from a user account is
>> > prevalent. Is it worth having a multi-user system?
>>
>> Nit-pick: my solution goes to root to enable the user to do things in
>> a specific way. The content of .Xmodmap (or its presence at all) is
>> the user's realm.
>
> It cannot be set up by users without root privileges and does nothing
> that the stock X won't do. That makes it inelegant, over-engineered and
> therefore unnecessary. :)
>
> ~/.xmodmap with the contents "keycode 54 = z". ~/.xsessionrc with the
> contents "xmodmap .xmodmap". Two files; two lines; total control.
>
>

I appear to not have a file .xsessionrc

I do have a file.xinputrc

Should the line "xmodmap .xmodmap" be inserted in the .xinputrc file,
in the absence of an .xsessionrc file?


-- 
Bret Busby
Armadale
West Australia
..

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
 Chapter 28 of Book 1 of
 "The Hitchhiker's Guide to the Galaxy:
 A Trilogy In Four Parts",
 written by Douglas Adams,
 published by Pan Books, 1992





Re: How to disable certain keys

2015-08-16 Thread Brian
On Sun 16 Aug 2015 at 21:18:10 +0200, to...@tuxteam.de wrote:

> On Sun, Aug 16, 2015 at 07:57:20PM +0100, Brian wrote:
> > On Sun 16 Aug 2015 at 20:21:05 +0200, to...@tuxteam.de wrote:
> 
> [...]
> 
> > It still comes down to why intrude on the user's province? One file,
> > .xsessionrc, and one line in the file to disable the caps lock. The
> > desire to go to root to do things easily done from a user account is
> > prevalent. Is it worth having a multi-user system?
> 
> Nit-pick: my solution goes to root to enable the user to do things in
> a specific way. The content of .Xmodmap (or its presence at all) is
> the user's realm.

It cannot be set up by users without root privileges and does nothing
that the stock X won't do. That makes it inelegant, over-engineered and
therefore unnecessary. :)

~/.xmodmap with the contents "keycode 54 = z". ~/.xsessionrc with the
contents "xmodmap .xmodmap". Two files; two lines; total control.



Re: How to disable certain keys

2015-08-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 16, 2015 at 07:57:20PM +0100, Brian wrote:
> On Sun 16 Aug 2015 at 20:21:05 +0200, to...@tuxteam.de wrote:

[...]

> It still comes down to why intrude on the user's province? One file,
> .xsessionrc, and one line in the file to disable the caps lock. The
> desire to go to root to do things easily done from a user account is
> prevalent. Is it worth having a multi-user system?

Nit-pick: my solution goes to root to enable the user to do things in
a specific way. The content of .Xmodmap (or its presence at all) is
the user's realm.

Regards
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlXQ4fIACgkQBcgs9XrR2kabAwCggfXctI43axB6Ko/QVvhGs3h5
uBYAnAglJuToVrwhnlro3fAj0y9cGmMo
=s7eJ
-END PGP SIGNATURE-



Re: How to disable certain keys

2015-08-16 Thread Brian
On Sun 16 Aug 2015 at 20:21:05 +0200, to...@tuxteam.de wrote:

> On Sun, Aug 16, 2015 at 03:48:05PM +0100, Brian wrote:
> > On Sun 16 Aug 2015 at 14:59:03 +0100, Brian wrote:
> 
> [...]
> 
> > I forgot to qualify the first sentence:).
> > 
> > Any user having a .xinitrc would not have the files in Xsession.d read
> > when X is started by startx. Please see startx(1).
> 
> The more reason to do it the way I did: setting up an .xinitrc would
> override all site-wide configuration; adding the .Xmodmap the way
> I did just adds a couple of key bindings and leaves the rest as-is.
> 
> Pick your poison ;-)

I'm not recommending a .xinitrc with strtx; quite the opposite. The DMs
behave differently.

It still comes down to why intrude on the user's province? One file,
.xsessionrc, and one line in the file to disable the caps lock. The
desire to go to root to do things easily done from a user account is
prevalent. Is it worth having a multi-user system?



Re: How to disable certain keys

2015-08-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 16, 2015 at 03:48:05PM +0100, Brian wrote:
> On Sun 16 Aug 2015 at 14:59:03 +0100, Brian wrote:

[...]

> I forgot to qualify the first sentence:).
> 
> Any user having a .xinitrc would not have the files in Xsession.d read
> when X is started by startx. Please see startx(1).

The more reason to do it the way I did: setting up an .xinitrc would
override all site-wide configuration; adding the .Xmodmap the way
I did just adds a couple of key bindings and leaves the rest as-is.

Pick your poison ;-)

- -- t
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlXQ1JEACgkQBcgs9XrR2kathQCfXoMym/K5mjdCFS8WZ0XlyvRz
uPgAn2GlDNYY2PvDlPGC4vcAVqYYESm/
=ws5R
-END PGP SIGNATURE-



Re: How to disable certain keys

2015-08-16 Thread Brian
On Sun 16 Aug 2015 at 14:59:03 +0100, Brian wrote:

> On Sun 16 Aug 2015 at 15:46:18 +0200, to...@tuxteam.de wrote:
> 
> > On Sun, Aug 16, 2015 at 01:45:04PM +0100, Brian wrote:
> > > On Sun 16 Aug 2015 at 14:04:18 +0200, to...@tuxteam.de wrote:
> > > 
> > > > On Sun, Aug 16, 2015 at 12:31:32PM +0100, Brian wrote:
> > > > > 
> > > > > This file is a non-Debian file. It is not needed for the simple task 
> > > > > at
> > > > > hand. I doubt it would ever be needed.
> > > > 
> > > > That's right: according to Debian Policy, files in /etc are the 
> > > > sysadmin's
> > > > realm. That's me, on my machine :-)
> > > 
> > > The OP is trying to accomplish something which is within the rights of a
> > > user. What advantage is to be gained from using the root account?
> > 
> > Yeah -- there's a point to that. As already said, there are several ways
> > to skin that cat. *I* wanted the system-wide X setup to honour the user-
> > provided .Xmodmap, instead of having each user call that from the .xinitrc.
> 
> Any user having a .xinitrc would not have the files in Xsession.d read
> when X is started. There is a fair bit in the List archives about this.

I forgot to qualify the first sentence:).

Any user having a .xinitrc would not have the files in Xsession.d read
when X is started by startx. Please see startx(1).



Re: How to disable certain keys

2015-08-16 Thread Brian
On Sun 16 Aug 2015 at 15:46:18 +0200, to...@tuxteam.de wrote:

> On Sun, Aug 16, 2015 at 01:45:04PM +0100, Brian wrote:
> > On Sun 16 Aug 2015 at 14:04:18 +0200, to...@tuxteam.de wrote:
> > 
> > > On Sun, Aug 16, 2015 at 12:31:32PM +0100, Brian wrote:
> > > > 
> > > > This file is a non-Debian file. It is not needed for the simple task at
> > > > hand. I doubt it would ever be needed.
> > > 
> > > That's right: according to Debian Policy, files in /etc are the sysadmin's
> > > realm. That's me, on my machine :-)
> > 
> > The OP is trying to accomplish something which is within the rights of a
> > user. What advantage is to be gained from using the root account?
> 
> Yeah -- there's a point to that. As already said, there are several ways
> to skin that cat. *I* wanted the system-wide X setup to honour the user-
> provided .Xmodmap, instead of having each user call that from the .xinitrc.

Any user having a .xinitrc would not have the files in Xsession.d read
when X is started. There is a fair bit in the List archives about this.



Re: How to disable certain keys

2015-08-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 16, 2015 at 01:45:04PM +0100, Brian wrote:
> On Sun 16 Aug 2015 at 14:04:18 +0200, to...@tuxteam.de wrote:
> 
> > On Sun, Aug 16, 2015 at 12:31:32PM +0100, Brian wrote:
> > > 
> > > This file is a non-Debian file. It is not needed for the simple task at
> > > hand. I doubt it would ever be needed.
> > 
> > That's right: according to Debian Policy, files in /etc are the sysadmin's
> > realm. That's me, on my machine :-)
> 
> The OP is trying to accomplish something which is within the rights of a
> user. What advantage is to be gained from using the root account?

Yeah -- there's a point to that. As already said, there are several ways
to skin that cat. *I* wanted the system-wide X setup to honour the user-
provided .Xmodmap, instead of having each user call that from the .xinitrc.

[...]

> > > bri...@aracnet.com has give a good account of how to use a ~/.xsession.
> > > Unfortunately, it is probably not suitable to put xmodmap commands (or
> > > any other commands) in it without starting a window manager also.
> > 
> > Should work too (my file is called ~/.xsessionrc, though)
> 
> I feel as though I'm missing something here. :)

Just a typ-o or read-o. Ignore :)

To the rest -- I think we basically agree on tech and disagree on taste :)

Regards
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlXQlCoACgkQBcgs9XrR2kaj3gCfSSIfSaJWrxReH46CjsfFMzAf
++sAn1s+ZVg9BcTr3Ap50XJqsPCZSrW/
=16b1
-END PGP SIGNATURE-



Re: How to disable certain keys

2015-08-16 Thread Brian
On Sun 16 Aug 2015 at 14:04:18 +0200, to...@tuxteam.de wrote:

> On Sun, Aug 16, 2015 at 12:31:32PM +0100, Brian wrote:
> > 
> > This file is a non-Debian file. It is not needed for the simple task at
> > hand. I doubt it would ever be needed.
> 
> That's right: according to Debian Policy, files in /etc are the sysadmin's
> realm. That's me, on my machine :-)

The OP is trying to accomplish something which is within the rights of a
user. What advantage is to be gained from using the root account?

> > There is rarely any need to alter any of the scripts in Xsession.d or
> > add to the number there. Everything a user wants to do can be done in
> > $HOME. Debian's X configuration is very flexible.
> 
> It didn't read my $HOME/.Xmodmap. I wanted it to do this. The place to
> achieve that is in Xsession.d. What would you propose as an alternative?

~/.xsessionrc or possibly ~/.Xresources. I've not tried the latter file.
You could probably source ~/.Xmodmap from ~/.xsessionrc.
 
> Yes, there's an $HOME/.xsessionrc. I could stick everything into that.
> 
> > bri...@aracnet.com has give a good account of how to use a ~/.xsession.
> > Unfortunately, it is probably not suitable to put xmodmap commands (or
> > any other commands) in it without starting a window manager also.
> 
> Should work too (my file is called ~/.xsessionrc, though)

I feel as though I'm missing something here. :)

> > The solution is to put the commands Thomas Schmit has provided in a
> > created ~/.xsessionrc. A two-minute (not two-year) job. :)
> 
> See above. It's a two minute job any way you slice it :-)

The difference is two minutes in an account a user can completely
control as opposed to two minutes in one which is intended for altering
things system wide.

> > All DMs read the files in /etc/X11/Xsession and, by extension. the user
> > provided ones. But a user might feel more comfortable using the DE
> > facilities.
> 
> I've had mixed experiences under Gnome (the DE regularly resetting things
> I'd set via xmodmap, taking the values out of some gconf-y key-value
> store). But YMMV.

If ~/,xsessionrc was ignored it would be a bug. On the other hand, I
would think that if the same thing was set within gnome it would have
precedence. 



Re: How to disable certain keys

2015-08-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 16, 2015 at 12:31:32PM +0100, Brian wrote:
> On Sun 16 Aug 2015 at 09:28:24 +0200, to...@tuxteam.de wrote:

[...]

> > for xmodmap, there's this snippet in /etc/X11/Xsession.d/80x11xmodmap:
> 
> This file is a non-Debian file. It is not needed for the simple task at
> hand. I doubt it would ever be needed.

That's right: according to Debian Policy, files in /etc are the sysadmin's
realm. That's me, on my machine :-)

> There is rarely any need to alter any of the scripts in Xsession.d or
> add to the number there. Everything a user wants to do can be done in
> $HOME. Debian's X configuration is very flexible.

It didn't read my $HOME/.Xmodmap. I wanted it to do this. The place to
achieve that is in Xsession.d. What would you propose as an alternative?

Yes, there's an $HOME/.xsessionrc. I could stick everything into that.

> bri...@aracnet.com has give a good account of how to use a ~/.xsession.
> Unfortunately, it is probably not suitable to put xmodmap commands (or
> any other commands) in it without starting a window manager also.

Should work too (my file is called ~/.xsessionrc, though)

> The solution is to put the commands Thomas Schmit has provided in a
> created ~/.xsessionrc. A two-minute (not two-year) job. :)

See above. It's a two minute job any way you slice it :-)

> > Again, your desktop environment might provide other mechanisms for doing 
> > things
> > "at start of the X session" -- or perhaps other mechanisms to change the key
> > mappings.
> 
> All DMs read the files in /etc/X11/Xsession and, by extension. the user
> provided ones. But a user might feel more comfortable using the DE
> facilities.

I've had mixed experiences under Gnome (the DE regularly resetting things
I'd set via xmodmap, taking the values out of some gconf-y key-value
store). But YMMV.

Regards
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlXQfEIACgkQBcgs9XrR2kbCOQCfeoC8NuXNDAJ/JAsekEKR8jqF
wucAn2iGyolyeJRfid6MUI5tWxwbxs0z
=l8zx
-END PGP SIGNATURE-



Re: How to disable certain keys

2015-08-16 Thread Brian
On Sun 16 Aug 2015 at 09:28:24 +0200, to...@tuxteam.de wrote:

> Now different desktop environments have different ways to achieve that. I run
> a pretty classical setup (no desktop environment at all, Fvwm as window 
> manager).
> 
> In my case, the scripts in /etc/X11/Xsession.d are arranged to load those
> user bits which are to be done once at the start of the X session. Especially
> for xmodmap, there's this snippet in /etc/X11/Xsession.d/80x11xmodmap:

This file is a non-Debian file. It is not needed for the simple task at
hand. I doubt it would ever be needed.
 
> =
> # 2015-01-10 tomas: why did they steal my xmodmap?
> # Snarfed from 
> 
> # This file is sourced by Xsession(5), not executed.
> 
> SYSMODMAP="/etc/X11/Xmodmap"
> USRMODMAP="$HOME/.Xmodmap"
> 
> if [ -x /usr/bin/X11/xmodmap ]; then
> if [ -f "$SYSMODMAP" ]; then
> xmodmap "$SYSMODMAP"
> fi
> 
> if [ -f "$USRMODMAP" ]; then
> xmodmap "$USRMODMAP"
> fi
> fi
> =
> 
> (seems I stubled upon that some moons ago and was somewhat upset. I forgot
> since ;-)
> 
> Note that the syntax of the files "loaded" by xmodmap is slightly different to
> what you'd have to write when issuing individual xmodmap commands.
> 
> This is just one way to achieve that. You might as well hard-wire the commands
> into your /etc/X11/Xsession

There is rarely any need to alter any of the scripts in Xsession.d or
add to the number there. Everything a user wants to do can be done in
$HOME. Debian's X configuration is very flexible.

bri...@aracnet.com has give a good account of how to use a ~/.xsession.
Unfortunately, it is probably not suitable to put xmodmap commands (or
any other commands) in it without starting a window manager also.

The solution is to put the commands Thomas Schmit has provided in a
created ~/.xsessionrc. A two-minute (not two-year) job. :)

> Again, your desktop environment might provide other mechanisms for doing 
> things
> "at start of the X session" -- or perhaps other mechanisms to change the key
> mappings.

All DMs read the files in /etc/X11/Xsession and, by extension. the user
provided ones. But a user might feel more comfortable using the DE
facilities.



Re: How to disable certain keys

2015-08-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 16, 2015 at 01:53:38PM +0800, Bret Busby wrote:

[...]

> So, after editing that file, I now have

[...]

> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$
> "

See my other answer: this might work -- or not. It will do this setting
each time you start a shell, which might be too late, too often (not
a problem in this case) or too early (no X running -- just a harmless
error message in that case).

You want to arrange things to have that called once, as early as possible,
avter having started X. That's what all this xsession stuff is for (and
possibly an equivalent mechanism provided by your DE).

Now don't ask me why each and every DE had to reinvent that wheel. I just
don't know.

- -- t
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlXQPdoACgkQBcgs9XrR2kaYFQCcCSURkNyhz+ecVpPEbbJNdiAw
tg4An34HDvZowKCwLVFQRRU7DxEkIKE6
=pP/5
-END PGP SIGNATURE-



Re: How to disable certain keys

2015-08-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 16, 2015 at 12:07:38AM -0500, rlhar...@oplink.net wrote:
> On Sat, August 15, 2015 11:29 pm, to...@tuxteam.de wrote:
> > On Sun, Aug 16, 2015 at 12:04:17PM +0800, Bret Busby wrote:
> >> On 15/08/2015, Carl Johnson  wrote:
> ...
> >> How do I modify the login script? I do not know the file name or path,
> >> for the login script.
> 
> I am asking the same question Bret is asking; my system is Jessie with xfce.
> 
> It appears that the bash startup script is ".bashrc".  I read the man
> pages for XINIT, Xsession, and XMODMAP, and I read the
> www.debian-administration.org article "Running applications automatically
> when X starts" (which article has specifics for KDE and GNOME), and now I
> am more confused than before.

See my answer to Bret: the short version is that for things X, you typically
go to the xinit mechanism (which tries to gather system-wide and user-specific
things in a meaningful way), whereas for things shell (that might include
setting environment variables to help X programs called from the command
line find their stuff) you use .profile, .bashrc, .bash_login and friends.

For special cases (setting a key map) I'd try to find out whether there's
a "desktop environment" (in your case XFCE) way of doing things. Otherwise
you might be fighting you DE instead of using it.

HTH
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlXQPLQACgkQBcgs9XrR2kZI2QCfcVmbIQpoHsJXvFSJdScPZ0UB
oyUAn0l4OWjhxq0Yod9cazFWDwdC9Rxx
=1T19
-END PGP SIGNATURE-



Re: How to disable certain keys

2015-08-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 16, 2015 at 01:41:02PM +0800, Bret Busby wrote:

[...]

> Hello.
> 
> Unfortunately, like with many other message boxes/dialogue boxes,
> copying and pasting, is not possible.
> 
> In the particular message box, is
> 
> "
> Wrote output to the file 
> /home/bret/.xmodmap-bret-Aspire-V3-772-UbuntuMATE-1504
> 
> You should modify your login script to include a line like
> xmodmap ~/.xmodmap-`uname-n`

Aha. Thanks for the extra info. Now I know more:

xmodmap is talking to your X server. That means that it'd make sense to issue
that command once, after having started the X server (or, if you have more than
one, for each server).

Note that all the .bash_login etc. have't much relevance here, since you don't
usually start the X sever from a shell these days anymore.

Now different desktop environments have different ways to achieve that. I run
a pretty classical setup (no desktop environment at all, Fvwm as window 
manager).

In my case, the scripts in /etc/X11/Xsession.d are arranged to load those
user bits which are to be done once at the start of the X session. Especially
for xmodmap, there's this snippet in /etc/X11/Xsession.d/80x11xmodmap:

=
# 2015-01-10 tomas: why did they steal my xmodmap?
# Snarfed from 

# This file is sourced by Xsession(5), not executed.

SYSMODMAP="/etc/X11/Xmodmap"
USRMODMAP="$HOME/.Xmodmap"

if [ -x /usr/bin/X11/xmodmap ]; then
if [ -f "$SYSMODMAP" ]; then
xmodmap "$SYSMODMAP"
fi

if [ -f "$USRMODMAP" ]; then
xmodmap "$USRMODMAP"
fi
fi
=

(seems I stubled upon that some moons ago and was somewhat upset. I forgot
since ;-)

Note that the syntax of the files "loaded" by xmodmap is slightly different to
what you'd have to write when issuing individual xmodmap commands.

This is just one way to achieve that. You might as well hard-wire the commands
into your /etc/X11/Xsession

Again, your desktop environment might provide other mechanisms for doing things
"at start of the X session" -- or perhaps other mechanisms to change the key
mappings.

Regards
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlXQO5gACgkQBcgs9XrR2kZrEQCeIczGqXwBiVaAwKvisZVpV+A4
LUMAn3jeR3ShF2AGoh8nLSivN2Yf7YpS
=kCVd
-END PGP SIGNATURE-



Re: How to disable certain keys

2015-08-15 Thread Bret Busby
On 16/08/2015, Bret Busby  wrote:
> On 16/08/2015, to...@tuxteam.de  wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> On Sun, Aug 16, 2015 at 12:04:17PM +0800, Bret Busby wrote:
>>> On 15/08/2015, Carl Johnson  wrote:
>>> > Bret Busby  writes:
>>
>> [...]
>>
>>> > That same right-click menu has an option to save the settings to a
>>> > .xmodmap file and shows how to include that file on start.
>>
>> [...]
>>
>>> Okay; whilst the option to save the settings to the .xmodmap file, is
>>> not explicit, and I had to guess it (something like "Write settings"
>>> from memory), in the response to doing that, it returns a dialgue box
>>> that states "You should modify your login script to include a line
>>> like  "
>>>
>>> How do I modify the login script? I do not know the file name or path,
>>> for the login script.
>>
>> That depends a bit on what shell you are using and on your other general
>> setup. Typically, if your shell is bash, this file will be called
>> .bash_login (note the dot at the start o the name), and will live in your
>> home directory.
>>
>> How does the line you are supposed to include look?
>>
>
> Hello.
>
> Unfortunately, like with many other message boxes/dialogue boxes,
> copying and pasting, is not possible.
>
> In the particular message box, is
>
> "
> Wrote output to the file
> /home/bret/.xmodmap-bret-Aspire-V3-772-UbuntuMATE-1504
>
> You should modify your login script to include a line like
> xmodmap ~/.xmodmap-`uname-n`
> (those are backquotes.)
> 
> "
>
> "
> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ cat .bash_login
> cat: .bash_login: No such file or directory
> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ sudo cat /home/bret/.bask_login
> sudo: unable to resolve host bret-Aspire-V3-772-UbuntuMATE-1504
> [sudo] password for bret:
> cat: /home/bret/.bask_login: No such file or directory
> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ sudo cat /home/bret/.bash_login
> sudo: unable to resolve host bret-Aspire-V3-772-UbuntuMATE-1504
> cat: /home/bret/.bash_login: No such file or directory
> bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$
> "
>


So, it occurred to me, to do an "ls" on ".*" and I got (apart from the
. directories),

"
bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ ls .*
.bash_history  .bashrc  .ICEauthority .profile
.Xauthority  .xmodmap-bret-Aspire-V3-772-UbuntuMATE-1504
.xsession-errors.old
.bash_logout   .dmrc.pam_environment  .sudo_as_admin_successful
.xinputrc.xsession-errors
"

So, in running cat .profile, I got

"
bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ cat .profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$
"

So, I asume that this is the applicable file, in the absence of the
two named .bash* files.

So, after editing that file, I now have

"
bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ cat .profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi

# attempt to invoke .xmodmap upon login
xmodmap ~/.xmodmap-`uname-n`

bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$
"

Which I will test, the next time that I reboot (which probably will
not be for a few hours).

-- 
Bret Busby
Armadale
West Australia
..

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
 Chapter 28 of Book 1 of
 "The Hitchhiker's Guide to the Galaxy:
 A Trilogy In Four Parts",
 written by Douglas Adams,
 published by Pan Books, 1992





Re: How to disable certain keys

2015-08-15 Thread briand
On Sun, 16 Aug 2015 00:07:38 -0500
rlhar...@oplink.net wrote:

> On Sat, August 15, 2015 11:29 pm, to...@tuxteam.de wrote:
> > On Sun, Aug 16, 2015 at 12:04:17PM +0800, Bret Busby wrote:
> >> On 15/08/2015, Carl Johnson  wrote:
> ...
> >> How do I modify the login script? I do not know the file name or path,
> >> for the login script.
> 
> I am asking the same question Bret is asking; my system is Jessie with xfce.
> 
> It appears that the bash startup script is ".bashrc".  I read the man
> pages for XINIT, Xsession, and XMODMAP, and I read the
> www.debian-administration.org article "Running applications automatically
> when X starts" (which article has specifics for KDE and GNOME), and now I
> am more confused than before.
> 

xfce has it's own mechanism to manage things at start up.

applications menu -> settings -> session and startup

in fact i have a "start up" application to swap capslock and control, although 
it's really just a one-line command.

  /usr/bin/setxkbmap -option ctrl:swapcaps

i've set it up in the "application autostart" tab.

the bash start-up is .bashrc but that's a script run when you enter a shell and 
bash, the shell program, starts-up, and so has absolutely nothing to do with X.

there is, in fact, a way to get the "X environment" to run commands at start, 
that's how the environment does things like start the login application, e.g. 
gdm and related, but i can't remember how to do that.  for the longest time i 
simply started x through .xsession which makes running things at start up 
trivial.  just put it in .xsession.

i started using xfce, like it pretty well - so i've just been using xfce's 
mechanism.

every once in a while i'm tempted to go back to .xsession with openbox and 
fbpanel but i digress...

Brian

here's an example of the .xsession i've used in the past which might be of use.

setxkbmap us -variant dvorak
setxkbmap -option ctrl:swapcaps
xset m 1 1

# at some point this wasn't happening automagically, it may be now
xrdb -merge .Xresources

# set background image
feh --bg-fill /home/shared/pictures/astronomy/1999-25-a.jpg 

openbox & wmpid=$!
#xmonad & wmpid=$!

emacs -geometry 80x50 &

#rxvt --geometry 80x60 &
lxterminal --geometry=80x50 &

claws-mail &

fbpanel &

wait $wmpid



Re: How to disable certain keys

2015-08-15 Thread Bret Busby
On 16/08/2015, to...@tuxteam.de  wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On Sun, Aug 16, 2015 at 12:04:17PM +0800, Bret Busby wrote:
>> On 15/08/2015, Carl Johnson  wrote:
>> > Bret Busby  writes:
>
> [...]
>
>> > That same right-click menu has an option to save the settings to a
>> > .xmodmap file and shows how to include that file on start.
>
> [...]
>
>> Okay; whilst the option to save the settings to the .xmodmap file, is
>> not explicit, and I had to guess it (something like "Write settings"
>> from memory), in the response to doing that, it returns a dialgue box
>> that states "You should modify your login script to include a line
>> like  "
>>
>> How do I modify the login script? I do not know the file name or path,
>> for the login script.
>
> That depends a bit on what shell you are using and on your other general
> setup. Typically, if your shell is bash, this file will be called
> .bash_login (note the dot at the start o the name), and will live in your
> home directory.
>
> How does the line you are supposed to include look?
>

Hello.

Unfortunately, like with many other message boxes/dialogue boxes,
copying and pasting, is not possible.

In the particular message box, is

"
Wrote output to the file /home/bret/.xmodmap-bret-Aspire-V3-772-UbuntuMATE-1504

You should modify your login script to include a line like
xmodmap ~/.xmodmap-`uname-n`
(those are backquotes.)

"

"
bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ cat .bash_login
cat: .bash_login: No such file or directory
bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ sudo cat /home/bret/.bask_login
sudo: unable to resolve host bret-Aspire-V3-772-UbuntuMATE-1504
[sudo] password for bret:
cat: /home/bret/.bask_login: No such file or directory
bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$ sudo cat /home/bret/.bash_login
sudo: unable to resolve host bret-Aspire-V3-772-UbuntuMATE-1504
cat: /home/bret/.bash_login: No such file or directory
bret@bret-Aspire-V3-772-UbuntuMATE-1504:~$
"


-- 
Bret Busby
Armadale
West Australia
..

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
 Chapter 28 of Book 1 of
 "The Hitchhiker's Guide to the Galaxy:
 A Trilogy In Four Parts",
 written by Douglas Adams,
 published by Pan Books, 1992





Re: How to disable certain keys

2015-08-15 Thread rlharris
On Sat, August 15, 2015 11:29 pm, to...@tuxteam.de wrote:
> On Sun, Aug 16, 2015 at 12:04:17PM +0800, Bret Busby wrote:
>> On 15/08/2015, Carl Johnson  wrote:
...
>> How do I modify the login script? I do not know the file name or path,
>> for the login script.

I am asking the same question Bret is asking; my system is Jessie with xfce.

It appears that the bash startup script is ".bashrc".  I read the man
pages for XINIT, Xsession, and XMODMAP, and I read the
www.debian-administration.org article "Running applications automatically
when X starts" (which article has specifics for KDE and GNOME), and now I
am more confused than before.

RLH




Re: How to disable certain keys

2015-08-15 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 16, 2015 at 12:04:17PM +0800, Bret Busby wrote:
> On 15/08/2015, Carl Johnson  wrote:
> > Bret Busby  writes:

[...]

> > That same right-click menu has an option to save the settings to a
> > .xmodmap file and shows how to include that file on start.

[...]

> Okay; whilst the option to save the settings to the .xmodmap file, is
> not explicit, and I had to guess it (something like "Write settings"
> from memory), in the response to doing that, it returns a dialgue box
> that states "You should modify your login script to include a line
> like  "
> 
> How do I modify the login script? I do not know the file name or path,
> for the login script.

That depends a bit on what shell you are using and on your other general
setup. Typically, if your shell is bash, this file will be called
.bash_login (note the dot at the start o the name), and will live in your
home directory.

How does the line you are supposed to include look?

regards
- -- t
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlXQEcYACgkQBcgs9XrR2kZK6gCffTZ2QMcQjvTjUTcTnKreu7Kp
Y8wAn0m4Bj58c3etU/iWkkCJpAK59g0+
=S44x
-END PGP SIGNATURE-



Re: How to disable certain keys

2015-08-15 Thread Bret Busby
On 15/08/2015, Liam O'Toole  wrote:
> On 2015-08-15, Bret Busby  wrote:
>>
>>
>
> It seems you've managed to disable all keys. :-)
>


Ah, only the ones that I wanted to disable, I hope ...

:)


-- 
Bret Busby
Armadale
West Australia
..

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
 Chapter 28 of Book 1 of
 "The Hitchhiker's Guide to the Galaxy:
 A Trilogy In Four Parts",
 written by Douglas Adams,
 published by Pan Books, 1992





Re: How to disable certain keys

2015-08-15 Thread Bret Busby
On 15/08/2015, Carl Johnson  wrote:
> Bret Busby  writes:
>
>> xkeycaps is run from the command line, and (when ran from a command
>> line in a terminal emulator) it displayed a graphical image of the
>> keyboard, and, when a mouseover was done of the keys that I wanted to
>> disable, a menu is displayed, with an option to disable the key.
>>
>> Whilst I do not know whether that setting will be retained, when the
>> system is next rebooted, it is easy enough to repeat the action, upon
>> rebooting the system.
>
> That same right-click menu has an option to save the settings to a
> .xmodmap file and shows how to include that file on start.
>
> --
> Carl Johnson  ca...@peak.org
>
>

Okay; whilst the option to save the settings to the .xmodmap file, is
not explicit, and I had to guess it (something like "Write settings"
from memory), in the response to doing that, it returns a dialgue box
that states "You should modify your login script to include a line
like  "

How do I modify the login script? I do not know the file name or path,
for the login script.

Thank you in anticipation.


-- 
Bret Busby
Armadale
West Australia
..

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
 Chapter 28 of Book 1 of
 "The Hitchhiker's Guide to the Galaxy:
 A Trilogy In Four Parts",
 written by Douglas Adams,
 published by Pan Books, 1992





Re: How to disable certain keys

2015-08-15 Thread Carl Johnson
Bret Busby  writes:

> xkeycaps is run from the command line, and (when ran from a command
> line in a terminal emulator) it displayed a graphical image of the
> keyboard, and, when a mouseover was done of the keys that I wanted to
> disable, a menu is displayed, with an option to disable the key.
>
> Whilst I do not know whether that setting will be retained, when the
> system is next rebooted, it is easy enough to repeat the action, upon
> rebooting the system.

That same right-click menu has an option to save the settings to a
.xmodmap file and shows how to include that file on start.

-- 
Carl Johnsonca...@peak.org



Re: How to disable certain keys

2015-08-15 Thread Liam O'Toole
On 2015-08-15, Bret Busby  wrote:
>
>

It seems you've managed to disable all keys. :-)

-- 

Liam




Re: How to disable certain keys

2015-08-15 Thread Bret Busby
On 15/08/2015, Curt  wrote:
> On 2015-08-14, Bret Busby  wrote:
>> Hello.
>>
>> Some of the keys are causing problems and disrupting what I do, due to
>> the keys apparently being inadvertently pressed.
>>
>> How do I disable the  key, and, how do I disable the left
>> hand  key, and, how do I disable the  keys?
>
> I'm reading you can use xev to obtain the keycode value of the key you want
> to
> disable, then you can run xmodmap to disable the key (by setting it to the
> empty string, I guess)
>
> xmodmap -e 'keycode ='
>
> https://wiki.archlinux.org/index.php/Xmodmap
>
>> Thank you in anticipation.
>>
>
>
>
>

Okay, trying again with my response that I had sent.

I have found that the web browser used when I (had tried to have )
sent my previous response, apparently has a tendency to delete all
message content, when sending a message via gmail, so that web browser
is apparently completely useless when forms are involved.

Thank you for your asssistance.

>From the URL that you posted, I found the simple solution that I
applied, which worked.

The package that I found from that URL, and that I installed, is xkeycaps.

xkeycaps is run from the command line, and (when ran from a command
line in a terminal emulator) it displayed a graphical image of the
keyboard, and, when a mouseover was done of the keys that I wanted to
disable, a menu is displayed, with an option to disable the key.

Whilst I do not know whether that setting will be retained, when the
system is next rebooted, it is easy enough to repeat the action, upon
rebooting the system.

So, the simple solution that I found (thanks to your response above)
and applied, is the package xkeycaps.

Thank you again for your assitance.


-- 
Bret Busby
Armadale
West Australia
..

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
 Chapter 28 of Book 1 of
 "The Hitchhiker's Guide to the Galaxy:
 A Trilogy In Four Parts",
 written by Douglas Adams,
 published by Pan Books, 1992





Re: How to disable certain keys

2015-08-15 Thread Curt
On 2015-08-14, Brian  wrote:
>> 
>> That information is not obvious and using xmodmap is only one way to do
>> it.  Most desktop environments have a keyboard section in their settings
>
> Which information isn't obvious? "How to disable certain keys" as the
> subject of this thread has it? Curt found and posted a solution within
> thirty minutes of the initial mail. If Curt can do it, so can anyone
> else. :)
>
>

lol



Re: How to disable certain keys

2015-08-15 Thread Bret Busby
On 15/08/2015, Brian  wrote:
> On Fri 14 Aug 2015 at 14:26:23 -0700, Carl Johnson wrote:
>
>> Brian  writes:
>>
>> > On Fri 14 Aug 2015 at 15:41:07 +0800, Bret Busby wrote:
>> >
>> >> Some of the keys are causing problems and disrupting what I do, due to
>> >> the keys apparently being inadvertently pressed.
>> >>
>> >> How do I disable the  key, and, how do I disable the left
>> >> hand  key, and, how do I disable the  keys?
>> >>
>> >> Thank you in anticipation.
>> >
>> > We hope spoon-feeding is not part of your anticipation. :)
>> >
>> > You've searched and searched. xmodmap might have come up. In what way
>> > were the solutions involving this utility or other techniques you came
>> > across unsatisfactory?
>>
>> That information is not obvious and using xmodmap is only one way to do
>> it.  Most desktop environments have a keyboard section in their settings
>
> Which information isn't obvious? "How to disable certain keys" as the
> subject of this thread has it? Curt found and posted a solution within
> thirty minutes of the initial mail. If Curt can do it, so can anyone
> else. :)
>
>

We could have done without your belligerence, in this thread.


-- 
Bret Busby
Armadale
West Australia
..

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
 Chapter 28 of Book 1 of
 "The Hitchhiker's Guide to the Galaxy:
 A Trilogy In Four Parts",
 written by Douglas Adams,
 published by Pan Books, 1992





Re: How to disable certain keys

2015-08-15 Thread Bret Busby




Re: How to disable certain keys

2015-08-14 Thread Brian
On Fri 14 Aug 2015 at 14:26:23 -0700, Carl Johnson wrote:

> Brian  writes:
> 
> > On Fri 14 Aug 2015 at 15:41:07 +0800, Bret Busby wrote:
> >
> >> Some of the keys are causing problems and disrupting what I do, due to
> >> the keys apparently being inadvertently pressed.
> >> 
> >> How do I disable the  key, and, how do I disable the left
> >> hand  key, and, how do I disable the  keys?
> >> 
> >> Thank you in anticipation.
> >
> > We hope spoon-feeding is not part of your anticipation. :)
> >
> > You've searched and searched. xmodmap might have come up. In what way
> > were the solutions involving this utility or other techniques you came
> > across unsatisfactory?
> 
> That information is not obvious and using xmodmap is only one way to do
> it.  Most desktop environments have a keyboard section in their settings

Which information isn't obvious? "How to disable certain keys" as the
subject of this thread has it? Curt found and posted a solution within
thirty minutes of the initial mail. If Curt can do it, so can anyone
else. :)



Re: How to disable certain keys

2015-08-14 Thread Thomas Schmitt
Hi,

rlhar...@oplink.net wrote:
> I am ready to resort to
> mechanically disabling the NUM LOCK key with epoxy cement.

Use this glue code instead:

  xmodmap -e "keysym Num_Lock = "

I must say it has a certain appeal not to see the ugly light.
But before enabling this automatically, check whether the
desktop is not starting up with NumLock enabled.

I am tempted to define it as second Caps Lock now:

  xmodmap -e "keycode 77 = Caps_Lock"


(Please, kids, do not do this at work on your neighbor's
 machine.)


Have a nice day :)

Thomas



Re: How to disable certain keys

2015-08-14 Thread rlharris
Of all the keys which need to be disabled, the foremost is NUM LOCK, which
is a curse if ever there was a curse.  I am ready to resort to
mechanically disabling the NUM LOCK key with epoxy cement.

RLH




Re: How to disable certain keys

2015-08-14 Thread Carl Johnson
Brian  writes:

> On Fri 14 Aug 2015 at 15:41:07 +0800, Bret Busby wrote:
>
>> Some of the keys are causing problems and disrupting what I do, due to
>> the keys apparently being inadvertently pressed.
>> 
>> How do I disable the  key, and, how do I disable the left
>> hand  key, and, how do I disable the  keys?
>> 
>> Thank you in anticipation.
>
> We hope spoon-feeding is not part of your anticipation. :)
>
> You've searched and searched. xmodmap might have come up. In what way
> were the solutions involving this utility or other techniques you came
> across unsatisfactory?

That information is not obvious and using xmodmap is only one way to do
it.  Most desktop environments have a keyboard section in their settings
manager that can handle some of that.  The setxkbmap program will also
handle that at a higher level.  Use of that is not obvious so it
references the xkeyboard-config(7) man page which is still not obvious.
I handle my configuration with the following line in my ~/.xsession:

setxkbmap -option ctrl:nocaps,compose:rwin,terminate:ctrl_alt_bksp

The ctrl:nocaps converts the capslock to a control key, but there is
also the ctrl:swapcaps option.  Most of X11 configuration is still a
mystery to me.
-- 
Carl Johnsonca...@peak.org



Re: How to disable certain keys

2015-08-14 Thread Curt
On 2015-08-14, Bret Busby  wrote:
> Hello.
>
> Some of the keys are causing problems and disrupting what I do, due to
> the keys apparently being inadvertently pressed.
>
> How do I disable the  key, and, how do I disable the left
> hand  key, and, how do I disable the  keys?

I'm reading you can use xev to obtain the keycode value of the key you want to
disable, then you can run xmodmap to disable the key (by setting it to the
empty string, I guess)

xmodmap -e 'keycode ='

https://wiki.archlinux.org/index.php/Xmodmap

> Thank you in anticipation.
>





Re: How to disable certain keys

2015-08-14 Thread Thomas Schmitt
Hi,

> Bret Busby wrote:
> > How do I disable the  key, and, how do I disable the left
> > hand  key, and, how do I disable the  keys?

Brian wrote:
> xmodmap might have come up. In what way
> were the solutions involving this utility or other techniques you came
> across unsatisfactory?

This problem is as old as Unix.
man pages are too long, tell currently unwanted information,
and lack the example that solves the user's particular problem
(the real one, not the perceived one).

man xmodmap does not directly state that one should do

  xmodmap -e "keysym Caps_Lock = "
  xmodmap -e "keysym Control_L = "
  xmodmap -e "keysym Super_L = "
  xmodmap -e "keysym Super_R = "

It does not explicitely state how to get the keys back
by exploring their keycode with program "xev" and after
e.g. having learned that left Control is keycode 37: 
  xmodmap -e "keycode 37 = Control_L"

Finally it does not point to
  https://lists.debian.org/debian-user/2015/08/msg00302.html
by Francesco Ariis which makes a proposal where to put above
commands for automatic execution on start of X.

Only after knowing all this, the reader will recognize that
it was indeed written in the manual.
A corollary from Murphy's law, i guess.


(And who woulda thunk that it is so easy to make your
 X workstation completely unusable ... ?)


Have a nice day :)

Thomas



Re: How to disable certain keys

2015-08-14 Thread Brian
On Fri 14 Aug 2015 at 15:41:07 +0800, Bret Busby wrote:

> Some of the keys are causing problems and disrupting what I do, due to
> the keys apparently being inadvertently pressed.
> 
> How do I disable the  key, and, how do I disable the left
> hand  key, and, how do I disable the  keys?
> 
> Thank you in anticipation.

We hope spoon-feeding is not part of your anticipation. :)

You've searched and searched. xmodmap might have come up. In what way
were the solutions involving this utility or other techniques you came
across unsatisfactory?