Questions tagged [events]

The tag has no usage guidance.

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

How to know which process interacts with input events

How to monitor which process interacts with /dev/input/eventX. In this case, keyboard input events. Is there a way to know which process entered a specific input and watch for that event? Is that even ...
2 votes
0 answers
42 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 ...
0 votes
0 answers
19 views

Software to maintain the state of a directory automatically

I have a directory that represents a storage of a smartphone. The storage is limited, and I want to unload some of the files from that storage to a server, and trim the smartphone directory. Is there ...
1 vote
1 answer
35 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 ...
0 votes
0 answers
171 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 ...
  • 12.4k
0 votes
0 answers
193 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/...
  • 3,909
2 votes
1 answer
312 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 ...
  • 31
0 votes
1 answer
421 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 ...
0 votes
0 answers
111 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 ...
  • 1
2 votes
1 answer
550 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 -----------------------------------------------------------...
  • 108
0 votes
1 answer
154 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 ...
1 vote
0 answers
21 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 ...
  • 289
1 vote
0 answers
146 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, ...
  • 111
0 votes
1 answer
153 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 ...
  • 113
1 vote
1 answer
62 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 ...
  • 300
2 votes
1 answer
84 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 ...
  • 280
0 votes
0 answers
34 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 ...
  • 101
0 votes
2 answers
3k 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 ...
2 votes
0 answers
127 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 ...
3 votes
0 answers
137 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 ...
  • 151
1 vote
1 answer
530 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 ...
1 vote
1 answer
398 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
1 vote
0 answers
152 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 ...
  • 11
0 votes
0 answers
32 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, ...
  • 2,569
1 vote
1 answer
61 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 ...
  • 317
0 votes
0 answers
31 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 ...
  • 111
1 vote
0 answers
112 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). ...
  • 7,703
0 votes
1 answer
119 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 ...
  • 289
0 votes
1 answer
55 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....
4 votes
3 answers
1k 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 ...
's user avatar
1 vote
1 answer
43 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)?
  • 3,093
3 votes
3 answers
7k 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 ...
1 vote
0 answers
775 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 # ...
  • 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 ...
  • 4,406
0 votes
2 answers
1k 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=...
1 vote
1 answer
2k 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 ...
  • 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 ...
  • 800
1 vote
0 answers
206 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 ...
  • 111
6 votes
2 answers
3k 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/...
  • 91
0 votes
1 answer
192 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) ...
  • 1,034
46 votes
2 answers
6k 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 ...
  • 1,259
2 votes
1 answer
531 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 ...
  • 606
3 votes
1 answer
1k 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 ...
  • 131
1 vote
1 answer
273 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 ...
11 votes
2 answers
13k 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), ...
  • 1,799
2 votes
1 answer
773 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 ...
  • 2,401
17 votes
5 answers
55k 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 ...
  • 1,782
1 vote
0 answers
143 views

Can I edit an event (gamepad)'s behavior?

Ok, so I'm attempting to fix my gamepad's (or rather, dance pad's) input, because the d-pad is acting like an axis rather than 4 buttons. I attempted to use xboxdrv, to no avail. So my question is, ...
4 votes
0 answers
1k views

Monitor the creation of new processes

I want to get a notification whenever a new process is created. I've tried to use inotify on /proc, but it didn't report any event even though a new directory appeared in /proc. I could list the /...
  • 126
3 votes
1 answer
2k views

How to catch mount events on Linux?

I want to somehow get notified if a mount or unmount occurs for a USB drive. At the moment I use udev and then wait for x seconds for a new entry in /proc/mounts. This works ok if the mounting is ...
  • 3,044