Skip to main content

Questions tagged [events]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
6 views

Can X11 pass the identifiers/names of the involved pointers/keyboards when passing/generating input events? Do Tk/Gtk/Qt do too?

If I type xinput I get the following output: ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ...
mo FEAR's user avatar
  • 160
2 votes
0 answers
74 views

Can I simulate power supply getting offline using udev or in other ways under Linux?

I have created the rule /etc/udev/rules.d/80.power.rules: SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="/root/test.sh" Then I execute the command ...
JenyaKh's user avatar
  • 346
0 votes
0 answers
50 views

Detecting system wake event using Dbus in linux

I wanted to perform some task in my application, as soon as the application wakes from sleep mode. To do that I wanted to detect the wake event in my application. I m detecting the sleep event in my ...
Vipul Gupta's user avatar
2 votes
1 answer
920 views

What could cause a missing mouse scroll event just after reversing scroll direction?

I'm using Ubuntu 22.04.2 on an x86_64 system, with Xorg and libinput. I have a Logitech MX Master mouse (the first model), and I've noticed some unusual behaviour with scrolling. The mouse has a free-...
davidA's user avatar
  • 171
2 votes
1 answer
102 views

Verifiy if a mouse is defective

I have only Linux machines (Ubuntu 22.04) and I've just received a 3D Connexion CadMouse Pro that officially does not support Linux. But I guess it's about the control software, as an HID mouse it ...
Mark's user avatar
  • 733
2 votes
0 answers
563 views

/dev/input/event doesn't report keys being pressed

I have an usb keyboard connected to a linux box. I need to capture all keys that have been pressed and released. My keyboard n-key rollover meaning that it doesn't have limits on number of ...
Misha Mikhail's user avatar
1 vote
1 answer
293 views

Not understanding the use of EVIOCGRAB for touchscreen devices

I am looking at a userspace library which handles touchscreen events from the Linux kernel. The following line of code, I can't understand what it does. What is the purpose of EVIOCGRAB when passed to ...
Engineer999's user avatar
  • 1,171
1 vote
0 answers
1k views

How to access gpio-keys from a shell script

In my embedded linux system, I defined some GPIOs as keys in the device tree so I can use them as keys in my application. This works fine so far. Now I want to add an early startup script to respond ...
Philippos's user avatar
  • 13.6k
0 votes
0 answers
463 views

Interpreting variations in LOCal timer interrupts number

Running a given workload in different CPU isolation (IRQs & processes) configurations, I do not observe significant differences among values (grand total) reported in /proc/interrupts & /proc/...
MC68020's user avatar
  • 8,329
2 votes
1 answer
963 views

get event when user has selected a text in any window in X11

I want to write an app that shows a popup-menu after a user has selected a text in any window in Linux (debian based). Mac users may know "PopClip" (https://pilotmoon.com/popclip/) and as I ...
dirkc's user avatar
  • 31
0 votes
1 answer
1k views

Is it possible to dynamically update systemd-timer's onCalendar?

sytemd-timer has a feature "onCalendar" using which we can execute a script on points of time (on calendar). Is it possible to dynamically (programmatically) update or mutate that field? For ...
Zeta.Investigator's user avatar
0 votes
0 answers
278 views

Side mouse buttons doesn't work

I switched to Pop! OS, but side mouse buttons doesn't work. On windows they were button 4 & 5, but here I used xev and it turns out button 4 & 5 were assigned to the scroll wheel. When I ...
Ali's user avatar
  • 1
2 votes
1 answer
1k views

script with `read` in bash while loop causing high CPU usage when run as a systemd service

I wrote a script to run specific actions conditional on input events informed by an event monitor, which looks something like $ cat script.sh -----------------------------------------------------------...
seamux's user avatar
  • 148
0 votes
1 answer
412 views

Linux on-exit (Ctrl-C) action

This is an interesting scenario and I'm relatively new in writing shell scripts. I have a case where I want the user to enter a password at a prompt. That works fine. The PROBLEM is if the user ...
Oliver Williams's user avatar
1 vote
0 answers
25 views

How would a GUI widget differentiate between the semantic- and absolute direction of a touchpad event?

I've recently been trying out Ubuntu 20.10 with Gnome desktop on Wayland, using a touchpad that supports precision scrolling, i.e. which does not emulate a mousewheel. After enabling natural scrolling ...
Andreas's user avatar
  • 521
1 vote
0 answers
282 views

How to proxy a keyboard though a Raspberry PI?

I have a keyboard that is plugged into a Raspberry Pi and the Raspberry Pi is plugged into my Mac. The Raspberry Pi is configured to act as a USB Keyboard and this is how my Mac sees the Raspberry Pi, ...
cobexa's user avatar
  • 111
0 votes
1 answer
680 views

How to setup and bring up can interface automatically on plug event?

I'm currently using a peak can interface to read can traffic. Every time I plug it to the computer, I must manually run: sudo ip link set can0 type can bitrate 500000 sudo ip link set up can0 I could ...
dvilela's user avatar
  • 113
1 vote
1 answer
200 views

Open file with vi in konsole by default

I am running Fedora 32 with KDE env. In dolphin, I would like to open '.m' files using vi in konsole by simply clicking on this file. In short, if my file is "toto.m", I want the command "konsole -e ...
Smilia's user avatar
  • 312
2 votes
1 answer
137 views

how to pipe event in bash?

From reading this: bash event-designators , I can make e.g. !?commandString. So I did: $find somedir -iregex '.*Makefile.*' $bla/bla/Makefile $bla/bla/bla/Makefile $... and now, I would like to use ...
Herdsman's user avatar
  • 350
0 votes
0 answers
39 views

Is it possible to modify output of read event by other process?

I want to intercept event and then modify output. So main question not about how to get notification about event, but how to modify output. Example Content of file.txt Current user is When some ...
Sonique's user avatar
  • 101
1 vote
2 answers
5k views

Way to execute a shell script by event

Is there a way to trigger a shell script by event not by time (cron)? For example, when the disk is full it will run a shell script to remove old logs. Like in windows, task scheduler triggered on an ...
leokkin6's user avatar
2 votes
0 answers
262 views

How to trace script execution events

My goal: To receive events from the kernel when a file/script is opened for execution with the absolute path of the file (or maybe the working directory, to resolve the absolute path of the file). I ...
opera127's user avatar
3 votes
0 answers
327 views

How to run a script when a directory is accessed?

I want a device mounted to a mountpoint only when it is needed, when it is accessed (for the first time). How to run a script when a folder is accessed in Linux (or Ubuntu)? Please note that the ...
ñull's user avatar
  • 151
1 vote
1 answer
1k views

Can a program trap on memory access to certain regions of process memory?

I'm looking for a way to have an event get triggered and trapped when accessing a specific read-only section of a program's memory. Specifically, if I have a section of program memory that contains a ...
JonBelanger's user avatar
0 votes
1 answer
867 views

Notify when file read [duplicate]

How can I register to event that let me know when specific file is read in linux? Can implement in c or in bash /shell script
eventsss's user avatar
1 vote
0 answers
202 views

Run a script (server side) when FTP user logs off

I'd like to run a shell script on an FTP server when an FTP user logs off. Imagine: Ftpuser logs in, uploads a file to an inbound-only directory and logs off. Ftp Server detects logoff then runs ...
GrepZen's user avatar
  • 11
0 votes
0 answers
44 views

Are there notification calls when a Process exits?

I was thinking about making a tool that triggers some kind of callback once a Process exits, particularly in the case where it's daemon/long-running process. The idea is to listen for that event, ...
lucidquiet's user avatar
  • 2,949
1 vote
1 answer
86 views

How do I notify some running app of a drive being mounted by usbmount?

I'm using usbmount to mount / unmount USB drives when they are inserted / removed on my Raspbian machine. A C++ app reading MP3 files from the drive and playing them now needs to get a hint every time ...
Neppomuk's user avatar
  • 348
0 votes
0 answers
38 views

Filter output / print one record per event or time period

I've got a custom HID device which prints out exact coordinates of touched points at real time. It is very sensitive & currently printing out the coordinate that's being touched on multiple ...
ybaylav's user avatar
  • 131
1 vote
0 answers
147 views

Trigger some action on system clock change?

I would like to have something occur - say, I would like to run a certain script - whenever the system clock is adjusted (hardware clock and/or offset from hardware clock, including the timezone). ...
einpoklum's user avatar
  • 9,768
0 votes
1 answer
178 views

What is the intention of KEY_NEXT compared to KEY_NEXTSONG?

I'm in the process of mapping IR remote buttons in LIRC. I looked through input-event-codes.h and came across KEY_NEXT and KEY_NEXTSONG, so I did some searching but I couldn't find descriptions for ...
Andreas's user avatar
  • 521
0 votes
1 answer
127 views

Is there a way to run a command whenever the screen turns on?

Linux kernel 4.x introduced a screen brightness issue on my laptop that I've been unable to fix with various boot parameters and their combinations. The issue appears whenever the screen turns back on....
user295220's user avatar
5 votes
3 answers
2k views

strace a short-lived process

I'm trying to learn about the behavior of a short-lived process that's created by one of my applications. I know these things about this process: Part of the name of the process. The name and PID of ...
user avatar
1 vote
1 answer
77 views

Hooking on to lid events as non-root

Is there a way for a non-root user to hook a script on to laptop lid events (ie. opening and closing)?
Toothrot's user avatar
  • 3,525
4 votes
3 answers
10k views

How can I run a shell script on input device event

I have a USB remote presenter that appears as a keyboard. Using evtest I can see the input events from the device. How can I capture those events in a shell script? I had see some solutions using C ...
paulequilibrio's user avatar
1 vote
0 answers
984 views

network interface post-up rule does not always fire

I'm running an Ubuntu Server 14.04.5 64-bit on a VMware ESXi server 5.5.0 and the up and post-up rule don't always fire when I use the following config root@tb60C:~# cat /etc/network/interfaces # ...
Chris's user avatar
  • 145
3 votes
1 answer
2k views

How can I debug X11 missing mouse ButtonRelease events that are present in usbmon?

A few days ago, my mouse button releases began sometimes not being recognised when I release two of the buttons simultaneously. The logical state of one button therefore gets stuck on "down", causing ...
Anko's user avatar
  • 4,626
0 votes
2 answers
2k views

Detecting USB camera button event?

I'm trying to detect when the snapshot button of my USB camera is pushed. Here are the infos I gathered about my camera with cat /proc/bus/input/devices: I: Bus=0003 Vendor=0c45 Product=6353 Version=...
Technico.top's user avatar
1 vote
1 answer
3k views

Detect media play / pause events

I want to pause playback after headphones have been unplugged, then resume after they were plugged back in. My current solution uses ACPI to detect plug / unplug, as shown here. To play / pause the ...
kyrill's user avatar
  • 154
3 votes
1 answer
2k views

how to run a script on auditd events?

I have configured auditd to track some sensitive files on my system. Now I would to have a script that will be called each time auditd writes a line, with the $1 argument of that script being the line ...
Tom Klino's user avatar
  • 842
1 vote
0 answers
222 views

Trace Linux Kernel to find how many bytes read from disk in IO operation

I have a Python script that reads Linux kernel system calls, using LTTng. So with this script I could read all kernel events. I have some IO operations (open and read file) and with this script I am ...
Saeid's user avatar
  • 111
6 votes
2 answers
4k views

(ubuntu 16.04) How can I detect a device independent USB insert event

I am trying to detect an USB insert regardless of the device it is. Eg: A phone, a battery pack, a biometric system etc., which may or may not be recognized by Linux (no drivers or nothing to "Drive/...
Vivek's user avatar
  • 91
0 votes
1 answer
226 views

Cancel scroll event when another key is pressed

When I scroll with middle mouse the event of scrolling is continued until it gradually turns to 0. Think this is a general issue as I experienced it on more than 1 linux distro (NixOS and ArchLinux) ...
Radivarig's user avatar
  • 1,154
50 votes
2 answers
8k views

How do I find out what program 'owns' a hotkey?

I'm running XFCE 4.12 on top of Gentoo with a 4.2.0 kernel. My PlayPause button on my keyboard used to work as a global hotkey for VLC. Now VLC won't even recognize the key. It does see "Alt + Media ...
Andrew Redd's user avatar
  • 1,309
2 votes
1 answer
619 views

OpenBSD- ignoring a particular keypress

I am using a Lenovo Yoga and the screen always sends out some "keystrokes" to indicate its orientation or simply being open, I don't know. On Linux, I could ignore those keystrokes with setkeycodes ...
sikerbela's user avatar
  • 616
3 votes
1 answer
2k views

Prevent Multiple Mouse Middle Click Events

For some weird reason, my mouse is sending multiple middle click events when I do a middle click at times. Happens once in a while - but not always. I'm fairly certain its a hardware issue. Its a ...
Binny V A's user avatar
  • 131
1 vote
1 answer
337 views

Event handling and networking

The basic use case I have in mind here is network transparent keyboard/mouse/pen/midi events. (Timing latency is not a serious issue yet.) There are two questions. If I plug in a USB keyboard our ...
John Allsup's user avatar
11 votes
2 answers
14k views

`xdotool` does not send keys

I am trying to send keystrokes via xdotool. However, sending does not work properly. Below is the log of a script that should select all the text in Gedit and copy it (but it does nothing instead), ...
Eleno's user avatar
  • 1,859
2 votes
1 answer
858 views

Redirect or trigger on dev node input event

Is it possible to trigger an event when data is available at a dev node? Very simply, if some widget device sends information over usb to my linux box, would it be possible to trap into some event ...
sherrellbc's user avatar
  • 2,541
20 votes
5 answers
63k views

Execute a shell command upon a click event in a web page

Is there a way to execute a bash command when I click on a text in a browser? The web page is on computer A, the browser is on computer B : I want to execute the code on computer B, e.g hsetroot to ...
bob dylan's user avatar
  • 1,912