https://github.com/coldfix/setcapslock
Small utility to set the caps lock state in an X session.
https://github.com/coldfix/setcapslock
caps-lock utility
Last synced: 3 months ago
JSON representation
Small utility to set the caps lock state in an X session.
- Host: GitHub
- URL: https://github.com/coldfix/setcapslock
- Owner: coldfix
- License: unlicense
- Created: 2015-10-15T13:26:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-05-04T18:41:21.000Z (about 6 years ago)
- Last Synced: 2025-02-02T00:31:46.024Z (4 months ago)
- Topics: caps-lock, utility
- Language: C
- Homepage:
- Size: 6.84 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
setcapslock
===========Small utility to set the caps lock state in an X session.
The ``setcaps`` function is stolen from here: http://askubuntu.com/a/80301
Usage
~~~~~Turn caps lock on::
setcapslock on
Turn caps lock off::
setcapslock off
Toggle caps lock::
setcapslock toggle
Show current state::
setcapslock get
And best of all: these commands are case-insensitive, of course!
Install
~~~~~~~To build the binary type::
make
Alternatives
~~~~~~~~~~~~I came by the following suggestions for alternative solutions (none of which
ended up working for me):* ``setleds -caps``
(setleds complains about not being in a virtual terminal)* ``xkbset nullify -lock``
(I don't have xkbset in repositories, so cannot verify)* ``xset led named 'Caps Lock'``
(does not work for caps lock on my machine)Turn off the key
~~~~~~~~~~~~~~~~Beware, this utility does NOT turn of your caps lock *key*. For this task
I found either of the following commands sufficient:* ``setxkbmap -option caps:none``
(or even better use "caps:escape" to reassign to escape key!)
(see: http://unix.stackexchange.com/a/75492)* ``xmodmap -e "clear Lock" -e "keysym Caps_Lock = Escape"``
(the statements can also be put into .Xmodmap config file)Toggle caps lock
~~~~~~~~~~~~~~~~According to `this post`_ the following commands can be used to toggle the
caps lock state:* ``xdotool key Caps_Lock`` (works for me!)
* ``xte "key Caps_Lock"`` (``xte`` is in the ``xautomation`` package but
complains about bad parameter on my machine).. _this post: http://askubuntu.com/a/607915