The officially official Devuan Forum!

You are not logged in.

#76 Re: Off-topic » disable touchpad without disabling trackpoint [SOLVED] » 2019-11-19 18:07:14

Thanks, yeti. Fn-F8 supposedly turns off the touchpad on the T400 as well (based on the little blue drawing on the F8 key), but it actually has no effect when I press it.

I decided to go with a hardware solution: Unplugging the touchpad's ribbon (the ribbon is just under the palmrest--it was trivial to find and disconnect) smile

Now the touchpad is completely disabled, but the trackpoint and its three buttons (just under the spacebar) are fully operational.

(I find it strange that on software level the trackpoint seems to be considered a child device of the touchpad, even though the hardware-level reality is that the two devices are independent.)

#77 Off-topic » disable touchpad without disabling trackpoint [SOLVED] » 2019-11-19 13:21:21

GNUser
Replies: 6

I run Devuan ASCII on my T400 laptop. I only use the trackpoint ("nipple mouse"). To me, the touchpad is just a nuisance.

I've discovered (by monitoring output of sudo cat /dev/input/event5) that the touchpad generates random input while the lid is closed. This causes applications that should run while the system to be idle (e.g., xscreensaver) to never run while the lid is closed.

I've tried to disable the touchpad via xinput, synaptics and evtest (evtest --grab /dev/input/event5 >/dev/null 2>&1), but none of these remedy the issue. The only remedy I've found is to unbind the touchpad's driver with this command:

# echo serio1 >/sys/bus/serio/drivers/psmouse/unbind

Unfortunately, the above command has the unacceptable side effect of simultaneously unbinding serio2, which renders my trackpoint ("nipple mouse") inoperable.

Please, do you know how to *completely* disable the touchpad (e.g., via unbinding its driver) without disabling the trackpoint?

P.S. This may be useful:

bruno@thinkpad:~$ cat /proc/bus/input/devices
---snip---
I: Bus=0011 Vendor=0002 Product=0007 Version=01b1
N: Name="SynPS/2 Synaptics TouchPad"
P: Phys=isa0060/serio1/input0
S: Sysfs=/devices/platform/i8042/serio1/input/input6
U: Uniq=
H: Handlers=mouse0 event5
B: PROP=1
B: EV=b
B: KEY=420 30000 0 0 0 0
B: ABS=11000003

I: Bus=0011 Vendor=0002 Product=000a Version=0000
N: Name="TPPS/2 IBM TrackPoint"
P: Phys=synaptics-pt/serio0/input0
S: Sysfs=/devices/platform/i8042/serio1/serio2/input/input7
U: Uniq=
H: Handlers=mouse1 event6
B: PROP=21
B: EV=7
B: KEY=70000 0 0 0 0
B: REL=3

P.S. Solution is in post #3. It's a hardware solution, not the software solution I was hoping to find.

#78 Re: Off-topic » yad without dbus? [SOLVED] » 2019-10-16 19:52:32

yad developer's workaround (see https://github.com/v1cont/yad/issues/58):

NO_AT_BRIDGE=1 yad <arguments>

I don't understand why it works, but it does. I need to educate myself further.

I also found this much simpler alternative to yad, which does everything I need:
https://github.com/jonhoo/mktrayicon

#79 Re: Off-topic » yad without dbus? [SOLVED] » 2019-10-15 17:44:46

Thank you for that, fsmithred.

I can confirm that if I remove the executable bit from dbus-launch and dbus-daemon, yad is still able to create the notification icon. However, if dbus-launch and dbus-daemon are executable, dbus is consistently launched each time yad creates an icon. This is very strange.

I'll ask yad's developer and will keep exploring. I'll take a look at some PPIDs to exclude the possibility that some other utility/daemon is starting dbus when yad is detected.

#80 Re: Off-topic » yad without dbus? [SOLVED] » 2019-10-15 16:55:21

While trying to solve this issue, I discovered this little gem:

https://github.com/jonhoo/mktrayicon

You can compile it with this command:

gcc `pkg-config --cflags gtk+-3.0` mktrayicon.c -lX11 -o mktrayicon `pkg-config --libs gtk+-3.0`

If, like me, you want to use custom icons instead of stock icons, just change the two instances of gtk_status_icon_set_from_icon_name in mktrayicon.c to gtk_status_icon_set_from_file before you compile it.

P.S. I'm still interested in solving this issue--learning how to create systray icons with yad without dbus being started.

#81 Re: Off-topic » yad without dbus? [SOLVED] » 2019-10-15 14:45:25

@fsmithred - On your no-dbus system, are you able to create a system tray icon using yad? What happens when you run $ yad --notification --image=dialog-ok --text="testing" &?

#82 Re: Off-topic » yad without dbus? [SOLVED] » 2019-10-15 14:34:21

I use fluxbox, which does not require dbus. However, I do have dbus installed because I sometimes use Thunderbird and Filezilla, which require it.

Notice how dbus is not running before yad, but rears its ugly head when yad creates a system tray icon:

bruno@box:~$ pgrep -fa dbus
bruno@box:~$ yad --notification --image=dialog-ok --text="testing" &
bruno@box:~$ pgrep -fa dbus
8504 dbus-launch --autolaunch b67e35c57ed5e6cf8ef0f5b65da5d7b3 --binary-syntax --close-stderr
8505 /usr/local/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
8511 /usr/local/bin/dbus-daemon --config-file=/usr/local/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3

#83 Re: Off-topic » pgrep: unexpected return code in non-interactive script [SOLVED] » 2019-10-15 12:30:36

I redirected the script's stderr to a log to investigate what's going on when pgrep -f 'regex' && foo fails to work as expected.

Lo and behold, a bunch of "pgrep: write error" entries show up in the log.

So it seems the issue here is that when a shell script runs in the background, pgrep gets grumpy unless its stdout is redirected somewhere (even if only to /dev/null).

#84 Off-topic » yad without dbus? [SOLVED] » 2019-10-15 12:29:25

GNUser
Replies: 7

I've noticed that yad starts dbus. I'm not happy about it because none of the other applications I use require dbus, and yad is very handy.

Is there a way to use yad without starting dbus? If not, are you aware of an alternative to yad? I basically only use it to create system tray icons with tooltips.

#85 Re: DIY » ditch your bloated network manager » 2019-10-12 15:44:22

HevyDevy, wifi-monitor is a barebones shell script that assumes the user only uses wifi, never ethernet.

What you are suggesting would certainly be possible, but the more complex logic would require an overhaul of the script.

Feel free to adapt the script to suit your needs. If you run into issues, email me on here and I'll try to help.

#86 Re: DIY » ditch your bloated network manager » 2019-10-11 12:16:32

@HevyDevy - Good to hear! Glad you figured it out.

#87 Re: DIY » ditch your bloated network manager » 2019-10-10 16:03:47

@HevyDevy - I looked around and the only utility I could find to easily put an icon and tooltip in the system tray is yad. It's either yad or roll your own...

...so I did roll my own tiny alternative to yad using python:

#!/usr/bin/python3

import sys
from PyQt4 import QtGui, QtCore

def show_icon(icon, tooltip):
	class SystemTrayIcon(QtGui.QSystemTrayIcon):
		def __init__(self, icon, parent=None):
		   QtGui.QSystemTrayIcon.__init__(self, icon, parent)
		   self.setToolTip(tooltip)
		def exit(self):
		  QtCore.QCoreApplication.exit()

	app = QtGui.QApplication(sys.argv)
	w = QtGui.QWidget()
	trayIcon = SystemTrayIcon(QtGui.QIcon(icon), w)
	trayIcon.show()
	sys.exit(app.exec_())

icon=sys.argv[1]
tooltip=sys.argv[2]
show_icon(icon, tooltip)

If you'd like to try it:
1. Paste this code into a blank text file, name it show-icon, put it somewhere in your PATH, make it executable
2. Install the script's two dependencies: $ sudo apt install python3 python3-pyqt4
3. Test it: $ show-icon /path/to/icon.png "hello world" &

If the yad test I suggested in post #5 doesn't work, try this python script. If the python script ("show-icon") works, let me know and I can customize wifi-monitor for you (to use show-icon instead of yad).

#88 Re: DIY » ditch your bloated network manager » 2019-10-10 13:41:29

@HevyDevy - The script should show the essid when you hover with the mouse over the wifi icon. It uses yad to accomplish this.

What happens when you type this in a terminal?

yad --notification --image=dialog-ok --text="hello world"

You should see "hello world" when you hover over the icon. If you don't see it, it's because yad and tint2 are not playing nice together.

yad works perfectly for me in both MATE and fluxbox.

If you want to use wifi-monitor but are married to tint2, you can swap out yad for some other utility to show the icon+tooltip. I can explore some alternatives.

#89 Off-topic » pgrep: unexpected return code in non-interactive script [SOLVED] » 2019-10-08 11:38:24

GNUser
Replies: 2

In a non-interactive shell script, command in pgrep -f 'regex' && command never runs when expected.

However, command in pgrep -f 'regex' >/dev/null && command does run when expected.

One of the scripts I use daily is affected by this (on line 27):
https://github.com/bdantas/wifi-monitor … fi-monitor

The function icon_add is supposed to return immediately (without creating an icon) if an icon already exists. If I remove >/dev/null from line 27, however, the function never returns and icons pile up in the systray.

Any idea why >/dev/null is required here? I thought the exit code of a utility (pgrep in this case) should be the same regardless of where its output is going.

#90 Re: Off-topic » how to automatically get xinput id of keyboard? [SOLVED] » 2019-10-07 18:28:37

Just a quick followup: I found a way to detect keyboard input without needing the keyboard id at all!

$ LANG=C xinput --test-xi2 --root | awk '
/RawKeyPress/ { relevant=1 }
relevant==1 && /detail/ { print $2; relevant=0 }
'

The most obvious application of this is a keylogger (https://github.com/bdantas/keylogger), but the keylogger itself may just be a stepping stone to something more useful (e.g., https://github.com/bdantas/iksilo).

#91 Re: DIY » ditch your bloated network manager » 2019-10-07 15:37:58

Thanks, fsmithred. Good to know it works in Beowulf with lxpanel smile

It should work in Xfce as well. Note that, in the interest of simplicity, the icon only shows up when internet is connected. If there is no internet connectivity, then no icon is the expected behavior.

#92 DIY » ditch your bloated network manager » 2019-10-07 13:59:45

GNUser
Replies: 12

I have a laptop and my networking needs are quite simple. This is all I need:

a. handful of wireless hotspots (SSID and password) should be remembered
b. at boot, laptop should connect to highest-priority hotspot among those available
c. an icon should appear while I am connected to internet, showing hotspot's SSID

Given such simple needs, for many years I thought having a "network manager" installed was overkill. Finally, for the past few months I've been enjoying a completely network-manager-free computing experience thanks to these two simple shell scripts I wrote:

https://github.com/bdantas/autowifi (currently 63 lines including comments and blank lines)
https://github.com/bdantas/wifi-monitor (currently 51 lines including comments and blank lines)

I'd like to share the scripts with my Devuan friends. If you'd like to use them, all you need to do is:

1. Install some basic packages (you likely have most of them installed already):

sudo apt install procps net-tools wireless-tools wpasupplicant udhcpc curl yad

2. Download the two scripts, put them somewhere in your PATH, adjust the "user variables" at the top as appropriate, change the ssid/password strings at the top of autowifi as appropriate, make the scripts executable

3. Add sudo autowifi & and wifi-monitor &  to your startup jobs (note that wifi-monitor should run without sudo)

4. Disable your current network manager (e.g., sudo update-rc.d network-manager disable)

5. Reboot

If you decide to try it, please let me know how it goes.

Cheers,
Bruno "GNUser"

P.S. If you change your mind and want to go back to using the network manager, just remove the two startup jobs and re-enable the network manager (e.g., sudo update-rc.d network-manager enable)

#93 Re: Off-topic » 'xinput test' produces no output when typing in xfwrite [SOLVED] » 2019-09-29 04:08:28

I found that xinput --test-xi2 --root and xinput --test-xi2 --root <keyboard_id> work.

#94 Off-topic » 'xinput test' produces no output when typing in xfwrite [SOLVED] » 2019-09-29 01:10:39

GNUser
Replies: 1

I created a little shell script that uses a crude keylogger (xinput test <keyboard_id>) and xdotool to replace certain character combinations when they are typed. The script is here but the particulars are not important.

The problem is that my script works well with all the GUI applications I've tested except for (ironically) my preferred text editor, xfwrite. It seems that xfwrite is somehow immune to the keylogger.

To reproduce the issue, open up a terminal emulator then:

$ sudo apt install xinput xfe
$ xinput test <your_keyboard_id> # mine is 9

Leave the terminal emulator open then launch a different application (e.g., web browser) and type something; you'll notice that xinput test detects your keystrokes. Now launch xfwrite and type something; you'll notice that xinput test does not seem to detect any keystrokes and produces no ouput.

I tried recompiling libfox and libfox-dev with the --with-xinput flag to configure then recompiling xfe, but it made no difference. UNIX wizards who frequent this forum: Any idea what needs to be done so that xinput test can detect keystrokes while typing in xfwrite?

#95 Re: Off-topic » how to automatically get xinput id of keyboard? [SOLVED] » 2019-09-15 00:46:57

I tinkered with ralph.ronnquist's solution in post #13 and figured out that this is what's actually going on when you decompress the logic:

$ master_id=$(LANG=C xinput list | grep -i 'master keyboard' | egrep -o 'id=[0-9]+' | egrep -o '[0-9]+')
$ keyboard_id=$(LANG=C xinput list $master_id | grep 'XIKeyClass' | egrep -o '[0-9]+')

This version is easier for my pea brain to grasp.

#96 Re: Off-topic » how to automatically get xinput id of keyboard? [SOLVED] » 2019-09-14 17:45:01

Why would you need the xinput id if you don't have xinput installed?

#97 Re: Off-topic » how to automatically get xinput id of keyboard? [SOLVED] » 2019-09-14 16:16:30

Yes, that works even on my wife's wonky hardware where multiple "slave keyboards" are listed. big_smile

eileen@vaio:~$ xinput list --id-only | xargs -n 1 -I+ sh -c "xinput list + | grep -wv + | grep XIKeyClass" | egrep -o '[0-9]+'
12

Wow, ralph.ronnquist. Very impressive. Thank you!

I understand the logic of the command, but don't understand how you figured out that it was the necessary logic. Will chew on it.

BTW, I had also found that nugget on stackexchange, but do not want to give users anything in addition to the shell script I've created. The script is here if you are curious:
https://github.com/bdantas/iksilo

#98 Re: Off-topic » how to automatically get xinput id of keyboard? [SOLVED] » 2019-09-14 11:59:35

Doesn't work on my wife's Sony Vaio:

$ LANG=C xinput --list | grep -i keyboard | egrep -iv 'virtual|video|button|bus'
    ↳ Sony Vaio Keys                          	id=7	[slave  keyboard (3)]
    ↳ USB 2.0 Camera: USB 2.0 Camera          	id=10	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=12	[slave  keyboard (3)]
    ↳ Sony Vaio Jogdial                       	id=14	[slave  keyboard (3)]

This is tough.

#99 Re: Off-topic » how to automatically get xinput id of keyboard? [SOLVED] » 2019-09-14 11:16:51

Thank you both. I think we're getting warmer. Does this work on all your test systems?

LANG=C xinput --list | grep -i keyboard | egrep -iv 'virtual|video|button|bus' | egrep -o 'id=[0-9]+' | egrep -o '[0-9]+'

#100 Re: Off-topic » how to automatically get xinput id of keyboard? [SOLVED] » 2019-09-14 02:04:07

Wow, thanks guys!

ralph.ronnquist's suggestion works in Devuan, in Tiny Core Linux (which uses BusyBox instead of coreutils), and even in OpenBSD. I modified it slightly to something that does same thing but makes more sense to me:

xinput --list --long | grep XIKeyClass | head -n 1 | egrep -o '[0-9]+'

There's no way I would have figured this out on my own. Thanks again, ralph. You're a wizard!

The only thing I don't understand is why the entry of interest always happens to be the first match.

Board footer

Forum Software