D
D
DR_Demons2014-06-30 02:44:28
linux
DR_Demons, 2014-06-30 02:44:28

How to make an Ubuntu keyboard lock widget?

Hello! The problem is that in the same location with me a cat appeared, which is extremely not indifferent to the computer keyboard, always ready to walk on it or take a nap. The laptop has a second keyboard and I disable the laptop keyboard in the terminal using xinput, but I would like to somehow automate this process. I thought to make a widget and put it in the taskbar for quick access to it, but the knowledge is not enough. Ubuntu 14.04 system. Tell me how you can implement or links on the topic?
Thanks in advance!
ps I know java (approximately at the junior level) and, in theory, if a program could access xinput, then this is a button, a listener and one condition, but I don’t know how to apply this to this task. you can try to do it using python, I don’t know it very well, but taking into account the task, I think if I read it, I can.
pss
Intermediate version

ready
h_1404245304_7498826_e21a725ff5.png
. Thanks to all who answered!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
tsarevfs, 2014-06-30
@DR_Demons

Python will be easier. Adding an icon to the tray is googled, well, in the callback you do what you wrote with your hands.

N
Nazar Mokrinsky, 2014-06-30
@nazarpc

Go to ~/.local/share/applications
Open any program in your favorite text editor using the template, enter your name, and paste the command that you wrote in the terminal.
The resulting shortcut for execution will be displayed in the list of all programs, you can pin it to the panel for quick access, you can create a second shortcut to connect back.

V
Vitaly Zheltyakov, 2014-06-30
@VitaZheltyakov

I will add.
Locking and generally working with the keyboard requires root rights. Pay attention to this, because. possible problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question