Comments (6)
You can already do almost the same thing using xargs
from GNU findutils:
[user@host ~]$ cat beep-file
-f 1006.25 -l 160.0 -d 0 -D 0
-f 1025.0 -l 160.0 -d 0 -D 0
-f 1000.0 -l 160.0 -d 0 -D 0
-f 1037.5 -l 160.0 -d 0 -D 0
-f 1031.25 -l 160.0 -d 0 -D 0 -n -f 1031.25 -l 160.0 -d 0 -D 0
-f 1012.5 -l 160.0 -d 0 -D 0
-f 1018.75 -l 160.0 -d 0 -D 0
-f 1012.5 -l 160.0 -d 0 -D 0
[ 18:37:57 | 1036 | 0 | ~ ]
[user@host ~]$ xargs -l beep < beep-file
[user@host ~]$ xargs -t -l beep < beep-file
beep -f 1006.25 -l 160.0 -d 0 -D 0
beep -f 1025.0 -l 160.0 -d 0 -D 0
beep -f 1000.0 -l 160.0 -d 0 -D 0
beep -f 1037.5 -l 160.0 -d 0 -D 0
beep -f 1031.25 -l 160.0 -d 0 -D 0 -n -f 1031.25 -l 160.0 -d 0 -D 0
beep -f 1012.5 -l 160.0 -d 0 -D 0
beep -f 1018.75 -l 160.0 -d 0 -D 0
beep -f 1012.5 -l 160.0 -d 0 -D 0
[user@host ~]$
Admittedly, not every implementation of xargs
implements -L
or -l
(e.g. busybox xargs
), and you cannot just use #!/usr/bin/xargs -l beep
as the first line of an executable script due to the part after the first space in that line being used as a single string parameter to the part before the first space.
Does integrating parts of the xargs
functionality into beep
really make sense?
from beep.
from beep.
That is a very valid point. Do you expect your file length to ever potentially exceed 2KB or 4KB?
from beep.
hmm. It currently sits just below 4KB
from beep.
OK, that rules out something along the lines of
beep $(python -c "print(' -n '.join([s.strip() for s in open('beep-file').readlines()]))")
for system with older shells, as those had limits on the maximum length of the command line around the 4K mark.
Are you writing those files by hand, or are those files generated from something else? We could either try to find a less verbose way of writing notes, or go one level further and process something closer to your source.
Or I could alter beep after all in a way such that it can read notes not just from the command line but also from files, maybe with a new way of writing the notes (see #19).
from beep.
These are generated using a python script at the moment but the intent is to be able to have a script that anyone can run provided they have beep installed.
When I was testing with a windows beep app it used freq duration \s sleep freq duration \s sleep freq duration \s sleep ...
where \s sleep
is an optional delay between notes
from beep.
Related Issues (20)
- git commands in source package cause (harmless) error messages HOT 3
- Default length missing in the man page HOT 2
- Check SND_TONE support and fall back to SND_BELL? HOT 2
- no sound in debian 10 on thinkpad t440p with pulseaudio HOT 5
- Support linearly and exponentially chirped beeps HOT 7
- A better way to specify notes? HOT 4
- Compiling on NetBSD 9.2 HOT 4
- Add alias, script, shell function to beep according to the last shell command's exit status
- need to run modprobe HOT 7
- Update documentation to mention different kernel drivers and their special files HOT 1
- Ship appstream metadata.xml file?
- Remove the console driver?
- SIGTSTP keeps the speaker active HOT 17
- Verify that the the struct timespec part of the struct input_event is actually unused
- Improve documentation on permission setup HOT 11
- Running under sudo is not synonymous with the program having extra privileges HOT 3
- The Linux evdev sound API is very slow to open(2) the device HOT 19
- The check for running under sudo can be circumvented HOT 4
- Getting "beep:19: unknown file attribute: h" running beep HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beep.