You are not logged in.

#1 2021-08-16 13:16:23

manyroads
Member
From: around here, somewhere
Registered: 2019-04-16
Posts: 158
Website

xinput (touchpad) and conky

Hello all...

I have been hunting without success to find a way to show touchpad status (xinput 13) on my conky. Can anyone offer clues?

Thanks!


Pax vobiscum,
Mark Rabideau - https://many-roads.com  https:/eirenicon.org 
i3wm, dwm, hlwm on sid/ arch ~ Reg. Linux User #449130
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken

Offline

#2 2021-08-16 17:05:35

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,028

Re: xinput (touchpad) and conky

Can it be shown in a terminal on the commandline.

I'm a desktop guy so I have to ask.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#3 2021-08-16 17:17:23

manyroads
Member
From: around here, somewhere
Registered: 2019-04-16
Posts: 158
Website

Re: xinput (touchpad) and conky

Yes if I use the following:

$ xinput watch-props 13
Device 'DELL097B:00 06CB:CCA6 Touchpad':
        Device Enabled (178):   1

It shows Device Enabled (178): 1 if the touchpad is enabled
It shows Device Enabled (178): 0 if the touchpad is disabled


Pax vobiscum,
Mark Rabideau - https://many-roads.com  https:/eirenicon.org 
i3wm, dwm, hlwm on sid/ arch ~ Reg. Linux User #449130
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken

Offline

#4 2021-08-16 17:26:31

manyroads
Member
From: around here, somewhere
Registered: 2019-04-16
Posts: 158
Website

Re: xinput (touchpad) and conky

nobody wrote:

[...]

If the touchpad shows in "synclient", you can just grep the property TouchpadOff, turn its value into presentable text, put everything into a script and then display the script output in the conky. If the touchpad uses libinput I have no idea, verhaps "libinput" tool can help (I've only been ever using the synaptics driver).

synclient does not accurately report the status of my dell touchpad. It always shows:

TouchpadOff             = 0

Sad, I know...


Pax vobiscum,
Mark Rabideau - https://many-roads.com  https:/eirenicon.org 
i3wm, dwm, hlwm on sid/ arch ~ Reg. Linux User #449130
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken

Offline

#5 2021-08-16 18:10:14

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: xinput (touchpad) and conky

manyroads wrote:

Yes if I use the following:

$ xinput watch-props 13
Device 'DELL097B:00 06CB:CCA6 Touchpad':
        Device Enabled (178):   1

It shows Device Enabled (178): 1 if the touchpad is enabled
It shows Device Enabled (178): 0 if the touchpad is disabled

The command "watch-props" suggests that this keeps on reporting touchpad status changes without returning the terminal prompt?
Things like that do not work very well with conky; you need a single-shot command that runs at every conky update.
Skimming 'man xinput', some sort of '--option 13' should do.

Offline

#6 2021-08-17 13:57:03

manyroads
Member
From: around here, somewhere
Registered: 2019-04-16
Posts: 158
Website

Re: xinput (touchpad) and conky

misko_2083 wrote:

^In that case two lines can be read and then close file descriptor.

#!/bin/bash

exec 5< <(xinput watch-props 13)

read device_name <&5
read -a device_status <&5

exec 5<&-

echo "${device_status[3]}"

I'll see if I can beat this into submission in one of my conky scripts.  btw. I think the NSA & FSB & Mossad might be editing your communications as well.... wink


Pax vobiscum,
Mark Rabideau - https://many-roads.com  https:/eirenicon.org 
i3wm, dwm, hlwm on sid/ arch ~ Reg. Linux User #449130
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken

Offline

Board footer

Powered by FluxBB