Saturday, June 16, 2018

xrandr: why not just have --setcvtmode 1920x1080@60

I have fiddled with xrandr a lot and I wish that it'd be easier to just specify a resolution and refresh rate in one line.

Something like

xrandr --output VGA-1 --setcvtmode 1920x1080@60

instead of having to do:


$ cvt 1920 1080 60
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync


then copying and pasting the modeline into xrandr --newmode

$ xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync

and then adding the mode to the VGA-1

$ xrandr --addmode VGA-1 "1920x1080_60.00"

and then finally actually setting the mode

$ xrandr --output VGA-1 --mode "1920x1080_60.00"


You can do things like use awk:

xrandr --newmode `cvt 1920 1080 60 | awk 'NR==2 {for (i=2;i<=NF;i++) printf("%s ",$i);}'`
xrandr --addmode VGA-1 `cvt 1920 1080 60 | awk 'NR==2 {for (i=2;i<=2;i++) printf("%s ",$i);}'`

but why not have it all in a single command, and maybe have an option for trying it out and reverting to the previous settings in 10 seconds, in case your monitor doesn't like it.



something like:

xrandr --output VGA-1 --setcvtmode 1920x1080@60 --trymode 10

That would make it much less cumbersome. Why does it have to be hard?

Thursday, June 14, 2018

Mysterious unscannable barcode on my service tag

So I was fiddling with my barcode scanner and was scanning the barcode of my Dell Service Tag. There were actually two barcodes on the tag, one that would scan that was Code 128, and the other that would not.

I did some detective work and figured out the one that wouldn't scan must be Interleaved Code 2 of 5.

From the wikipedia page at https://en.wikipedia.org/wiki/Interleaved_2_of_5 I figured out how to manually decode it. It's actually pretty simple once you know that it encodes pairs of numbers, the widths of the black bars being the first number and the widths of the gaps being the second number.

Interleaved 2 of 5 has a start code of nnnn and stop code of Wnn which makes it a bit easier to spot now that I know what I'm looking for.

So for example the I2of5 barcode on my Optiplex 745 Desktop was "0019". Plugging that number into my Brother P-touch software and selecting I2of5 makes the exact same barcode.

But why wouldn't it scan?

I found a manual for my Symbol Spark and looked at its configuration barcodes, and enabled the I2of5 but it still wouldn't scan.

So I scanned the MIN Length I2of5 and then 0 and 0. (The Symbol Spark expects two digits when you scan the configuration barcodes and I was baffled why it wasn't working because I was only scanning a single number).

Now that I've got it configured correctly, the barcode scanner would scan those previously "invisible" barcodes.

Wednesday, June 6, 2018

Soundbar is so irritating

So I got a soundbar for my TV. It sounds great with deep sound, but it's kind of irritating too.

Sometimes I don't want the "full" sound experience, (like late at night) so I'll switch to TV speakers only.

It doesn't pass through the HDMI signal through unless I have the sound bar turned on and select HDMI on the sound bar.

So I'll have to turn it on, and then switch to TV SPK.

If I accidentally hit the channel change on the TV, then it switches the soundbar automatically to DIGITAL IN. So then you've got to switch the soundbar back to HDMI, and it takes a few seconds for the TV to lock on to the HDMI, then switch back to TV SPK.

When using the soundbar's DIGITAL IN, if you haven't got the TV speakers muted, there's a slight delay in the sound so you get that weird sound effect of multiple tvs on (like you're watching all the TVs at the target store). If I could just have a slight video delay on the TV to get things to match perfectly... You can add audio delay at the soundbar but that just makes the delay worse.

There's just too much switching and fiddling around. It's almost so irritating that I'm feel like pulling the sound bar. I just want everything simple. You turn it on, it works. And it's perfectly in sync.


It doesn't sound like much, just pressing a couple of buttons. It's the 100th time you do it and you wonder why it just doesn't work seamlessly.