src/hd: autocomplete -> completion
Autocomplete more narrowly invokes tab completion on the command line,
which this does not provide.
src/hd: Remove non-POSIX function keyword
src/touch-menu: Make rotate_screen work with x13 yoga device
Note that this now doesn't work with older, x220 devices.
mypassmenu: Add -d, -p options
I have long used this as a bash alias but implementing this as a script
makes it easier to specify other directories to use with the tool.
src/jdkdocs: Update Java docs location
vol: Update copyright year
src/musicsum: Rewrite filter from awk to jq
This fixes a few problems with the previous approach.
First: The tr and cut calls are unnecessary. awk is already capable of
splitting fields on multiple delimiters, and fields 3 and 5 simply could
have been referenced in the original awk script instead of redefining
them as fields 1 and 2.
Using jq fixes this problem by having mediainfo produce its output in a
structured format, so that this trickery wouldn't be necessary even if
awk couldn't handle it automatically.
Second: The "NR % 2 != 1" is not properly documented and was a bit of a
hack. The reason for this is that mediainfo outputs the duration of a
file twice: once when printing the "General" information about the file,
and again when printing the "Audio" information about the file. This
condition ignored one of them, to avoid the sum being double what was
Using jq fixes this problem by allowing us to clearly and legibly filter
the input -- in this case, by obviously stating that we are only
interested in the "Audio" information about the file.
Third: The code was subtly incorrect, and based on an incomplete
premise. mediainfo outputs the duration of an audio file on a line like
Duration : 1 min 40 s
However, if a file has a duration of less than a minute, it will instead
Duration : 31 s 274 ms
Using jq sidesteps this issue because when mediainfo is prompted to
output as JSON, it provides the duration just as seconds, which is the
information that we originally reconstructed after the fact in awk.
One small downside of jq is that the formatting code is slightly more
awkward, in part because unlike awk jq's type system requires us to
explicitly convert between numbers and strings. However, the output
formatting was already slightly awkward because of the inherent
arithmetic. It is worth it to me for the sake of maintainability and
speed to only use one language for both filtering the input and
formatting the output.
src/musicsum: Use all files in directory if none are given
src/parsed-xrandr: Fix "connected" printings
src/parsed-xrandr: Separate fields with spaces, not tabs
This makes it more legible to match a line and connectedness in awk down
the line, like "DP-2 connected", instead of "DP-2\tconnected".
src/parsed-xrandr: Print "active" if active
This will be easier to parse, rather than having to check for
"connected" and also the presence of a resolution.
This also fixes a bug where a connected but inactive input would not be
displayed, because the statement that printed info about connected input
was only in the block where a * indicating the active resolution was found.
This will be helpful in some additions I am planning to my .xinitrc.
src/unhibernate: Inhibit handle-lid-switch by sleep, not cat
sleep uses less resources.
src/batinfo: Don't print anything if no battery info