Questions tagged [events]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
35 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 ...
0
votes
1answer
18 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
0answers
18 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 ...
2
votes
1answer
175 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 -----------------------------------------------------------...
0
votes
1answer
39 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 ...
0
votes
0answers
18 views

How to capture Power Down event from keyboard?

I'm running Raspbian version 2021-03-04 on a Raspberry Pi 3 Model B+. I have a Ponybro Mini Keyboard that has a little power button on it. It's very close to the "left mouse click" button, ...
0
votes
0answers
17 views

Why does elogind open 2 file descriptors for some events?

elogind is the systemd project's logind, extracted to a standalone package. It runs troublefree on my linux-5.4.97 in its 246.9.2 version. Investigating the event handlers I am surprised to see ...
1
vote
0answers
19 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 ...
1
vote
0answers
88 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, ...
0
votes
1answer
97 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 ...
1
vote
1answer
35 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 ...
2
votes
1answer
57 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 ...
0
votes
0answers
33 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 ...
0
votes
2answers
2k 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
0answers
80 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
0answers
51 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 ...
1
vote
1answer
314 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
1answer
216 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
0answers
132 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 ...
0
votes
0answers
27 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, ...
1
vote
1answer
45 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 ...
0
votes
0answers
30 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 ...
1
vote
0answers
80 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). ...
0
votes
1answer
100 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 ...
0
votes
1answer
51 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
3answers
736 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 ...
1
vote
1answer
36 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)?
2
votes
3answers
5k 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
0answers
661 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 # ...
2
votes
1answer
1k 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 ...
0
votes
2answers
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
1answer
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 ...
2
votes
1answer
1k 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 ...
1
vote
0answers
190 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 ...
6
votes
2answers
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/...
0
votes
1answer
174 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) ...
40
votes
1answer
5k 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 ...
2
votes
1answer
486 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 ...
3
votes
1answer
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 ...
1
vote
1answer
227 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
1answer
11k 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), ...
2
votes
1answer
713 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 ...
16
votes
5answers
51k 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
vote
0answers
130 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
0answers
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 /...
3
votes
1answer
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 ...
12
votes
3answers
8k views

With systemd-networkd, perform an action upon network configuration change

I am switching from Debian’s ifupdown to systemd-networkd, and it mostly works fine. One missing bit is that upon every network change, I want to call killall -ARLM tinc, so that my VPN is going up in ...
30
votes
1answer
64k views

monitoring events (keyboard, mouse) in X

Is it possible to display all events that are generated in Xorg? Such as keyboard pressed, mouse events...?
10
votes
2answers
10k views

Capturing key input from events device and mapping it (toggle TouchPad key is unmapped)

I have a Lenovo IdeaPad Yoga 13 with Ubuntu 13.10 Installed. The device has a "Toggle TouchPad" button on the keyboard (F5). The keyboard's F* buttons are reversed (so to get F5, I need to press Fn + ...
4
votes
1answer
2k views

xautolock: how to auto-unlock on user activity?

I need to run a script after a period of user inactivity. For that I use the wonderful program xautolock. Now, I also need to run another script when the activity is resumed (e.g. mouse is moved or a ...