You are not logged in.

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

manyroads
Member
From: around here, somewhere
Registered: 2019-04-16
Posts: 101
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 - http://many-roads.com  Professional Genealogist
dwm & i3wm on 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
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,770

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.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#3 2021-08-16 17:15:50

twoion
一期一会
Registered: 2015-08-10
Posts: 3,318

Re: xinput (touchpad) and conky

manyroads wrote:

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!

What is the touchpad status: on or off?

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).

Online

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

manyroads
Member
From: around here, somewhere
Registered: 2019-04-16
Posts: 101
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 - http://many-roads.com  Professional Genealogist
dwm & i3wm on 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 17:26:31

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

Re: xinput (touchpad) and conky

twoion 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 - http://many-roads.com  Professional Genealogist
dwm & i3wm on arch ~ Reg. Linux User #449130
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken

Offline

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

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

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.


Give to COVAX! Here or here. (explanation)

Offline

#7 2021-08-17 06:26:29

misko_2083
Member
Registered: 2016-05-24
Posts: 500

Re: xinput (touchpad) and conky

^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]}"

Last edited by misko_2083 (2021-08-17 06:28:08)


They use force, to make you do, what the deciders, have decided you must do!

Offline

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

manyroads
Member
From: around here, somewhere
Registered: 2019-04-16
Posts: 101
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 - http://many-roads.com  Professional Genealogist
dwm & i3wm on arch ~ Reg. Linux User #449130
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken

Offline

#9 2021-08-17 21:39:40

misko_2083
Member
Registered: 2016-05-24
Posts: 500

Re: xinput (touchpad) and conky

manyroads wrote:
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

I felt dizzy today, must have misspelled some word.
They are such good sports those spies, for editing my spelling. big_smile


They use force, to make you do, what the deciders, have decided you must do!

Offline

Board footer

Powered by FluxBB