Skip to main content

Hot answers tagged

6votes

Running a script based on raw events from a specific HID?

Does this seem feasible Yes, you can read raw input from the "evdev" interface at /dev/input/event*, either using libevdev or directly from the device nodes, or using the higher-level ...
grawity's user avatar
  • 11.4k
4votes
Accepted

How can I pick random items from a list, but some more often than others, in a Bash config file?

You can try to weight each cipher with an associated weight using two simple bash arrays, and then generate a tempfile which you can scan later with shuf: #!/bin/bash cipher=("AES256" "...
nbanba's user avatar
4votes
Accepted

Creating in Linux files in GB or MB range by various size by read a file

It sounds like you might want to do something like this: $ cat ./tst.sh #!/usr/bin/env bash while read -r idx sfx size; do echo fallocate "file${idx}.${sfx}" "$size" done < ...
Ed Morton's user avatar
4votes

Running a script based on raw events from a specific HID?

Have a look at libinput (you must install libinput-tools With libinput you can detect an events and play action when this events is detected For example here is the output when I'm touching my ...
nbanba's user avatar
2votes

How can I pick random items from a list, but some more often than others, in a Bash config file?

If you're just trying to create a shuffled list of "ciphers" with different number of repetitions per cipher then: #!/usr/bin/env bash generate() { while read -r reps cipher; do ...
Ed Morton's user avatar
1vote
Accepted

Running a script based on raw events from a specific HID?

The completed solution for my specific problems ends up being a couple scripts connected to each other. The main one deals with the libinput event log (which is piped into it) and runs the final ...
Gridzbi Spudvetch's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible

close