Home alarm clock: no progress

Today was pretty depressing. I want my morning alarm clock to be some sort of automation that plays three MP3 files I own on the sound equipment in my bedroom. I spent a lot of time today and do not have a solution.

When I bought the soundbar from Costco, I didn’t know to shop for something Home Assistant compatible. Although, even if I did know that, I think I’d still be stuck because I would feel like an absolute fool to pay $1,000 for a Sonos Soundbar. Sonos is the only vendor of soundbars that plays really nice with Home Assistant.

Apparently, way back when, some LG Soundbars had Ethernet ports on them, and they played nice with Home Assistant. Those aren’t available anymore; with everything having switched over to Bluetooth.

My current solution is an iPad using Bluetooth to light up the soundbar I hooked up to my TV. It works, often. But it doesn’t work 100%, which is a problem for the functionality of an alarm clock.

Also, there is no volume control: whatever the TV left the volume at, the music will play at that volume the next morning. This is sometimes a problem if the movie the night before was really loud, and I needed to turn down the volume to not blast out the neighbors or the speakers. I want automation to make my life less manual control, instead of “Oh! I changed the volume on the TV! I need to reset to xx for tomorrow morning!” just before I fall asleep. That’s the opposite of starting a nice night’s sleep.

My brother gave me a Mini PC running Windows 11 for Christmas. I was hoping that today I could set it up to use the soundbar as a Bluetooth speaker. Well, yes, when connected to a monitor and keyboard and mouse, I did get an MP3 file to play via Bluetooth on the soundbar.

So close.

But what about when the Mini PC is running headless? Nope. Could not get that to work. It is Microsoft Windows, after all. I’ve been using Microsoft products for 30 years, and they just are not good at automating anything. I suspect they think that automation is a Bad Thing, and should only be wielded by wizards instead of mere mortals.

So here I am at the end of a wasted day, without a better solution for my home automation alarm clock that mostly works. It is depressing.

Microsoft did something good in Windows 11

I know that I dislike Microsoft because they cheat. But if I’m going to have at least a little bit of integrity, I need to admit it when Microsoft does something good. Yes, they did something good in Windows 11, even if it took them 30+ years to copy the idea.

In Windows 11, you can select a file and right-click on it, and the popup menu lets you copy the path of the file to the clipboard.

If you didn’t know about this, and you start using it, you may be surprised at just how useful this is. I’m not, because I’ve had that functionality all along these last 30 years in WinBatch. For 30 years, I’ve had an easier time of it than you, because I’ve always had right-click clipboard tricks at my fingertips.

And I do have some sympathy for Microsoft taking so long to implement this feature. Microsoft had been caught stealing ideas from software vendors who sold (or wanted to sell) Windows utilities. Wilson WindowWare, the publisher of WinBatch, made Windows better by providing a macro recorder for Windows. It was kind of a sham though, because playing back the same mouse and keystrokes – without the ability to edit the macro – was more teaser to buy a product than helpful.

But if you bought the product, it was magical.

And Microsoft decided (this time) to not stab their partner in the back by implementing the partner’s idea themselves.

I did buy WinBatch. I bought it for my personal use. And in fact, I conviced my employer to buy the compiler, at $500 per year. What that gave me was an unlimited site license to run as many WinBatch scripts as I wanted on every machine in my environment. The compiler embedded the scripts inside a .exe much like the Perl PAR modules do, so you get a Windows .exe that runs your Perl script. The interpreter is embedded, the DLLs are embedded, and the script is embedded, and it all launches from the .exe

At work, I put the runtime DLLs on the public folder of every NetWare server where users log in. I compiled scripts to the small .exe option, and then copied the .exe to the file servers. Well, I didn’t copy them, I had a WinBatch copy them for me. Then I edited the Novell login script to launch the WinBatch exes.

Did I need to take an inventory of every drive letter mapping on a machine? Yes. Could I do that for 2,500 machines and write the results to a shared drive? Yes. Oh, and by the way, how about listing which printers were installed too? This was reasonably competent tech for 2005. WinBatch had a set of Windows Registry search-and-replace calls, so I could launch from a login script a utility that changed registry keys on your machine after we migrated you to a new server.

Anyway, I loved WinBatch, and used it daily. And it came with clipboard tricks: any file, any folder, mulitple files and folders: you could right-click and copy either the name(s) or the full path (including file names) to the Windows clipboard.

So when I saw that Windows 11 added right-click copy path to clipboard I was impressed. Microsoft finally did something good.

Now technically, this feature has been in Windows for a decade or more, but you needed to know to shift+right-click to get the menu option. With Windows 11, they finally just made it available without any weird key combinations. Good job, Microsoft.

Windows 11 first impression: it is awful

I want to have a shortcut open cmd.exe with a starting folder location. Not difficult at all in Windows 10.

In Windows 10, I could scroll through the Windows menu and find Command Prompt and then click-and-drag to make a shortcut on my desktop. Then I could modify the properties as I want.

Windows 11 doesn’t let you do this. It will launch the command prompt, and it will let you pin it to either the task bar or the start menu – but those shortcuts do not have properties you can modify. Well, one of them did, but starting folder was not a property I could set.

“Well David, how about choosing New Shortcut and following the prompt?” Okay, sure. Right-click the desktop, choose New ==> Shortcut. It asks “What item would you like to create a shortcut for?” You tell me, dimwits. Under Windows 10, I’d copy the existing shortcut and that would be defined for me already. Does your dialog box have a search function in it? No.

Great. I need to crank up a Windows 10 machine so I can find the location on that box, and on the Windows 11 box browse through arcane mysteries of %windir%\system32\

Finally, I’m getting a shortcut started, and now I need to set the starting directory. Windows 11 helpfully removed the Browse button….

I swear, it seems like whomever is in charge of Windows hates their users and are doing shit just so that the next time their annual review comes up, they can say that they did shit. Sure, it was shit that made user’s lives worse, but there isn’t a feedback mechanism for that, now is there? So that didn’t happen.

At least the icon picker still has a Browse button.

Microsoft is not good at software

“No shit, Sherlock”

All I’m going to complain about at the moment is Task Scheduler, and how I can run a PowerShell script if the script is on the local C: drive, but if the script is on my H: drive (which is on the network) then it’s no longer PowerShell, it must be ImpotentShell and should thus fail.

Apparently networks scare Microsoft?

Task Scheduler will attempt to launch it, with the target being powershell -File H:\blah\foo.ps1

But that run of the task will fail with the result code 0xFFFD0000

The only change I made to the Task Scheduler was to change the target path from -File H:\blah\foo.ps1 to C:\blah\foo.ps1. Now the script runs, where it failed before.

I find the whole attitude of “well, the network is so fragile that we are going to fail when we to try” moronic. The freaking machine this script on is a VM (a file) loading across the network you dolts.

But no…. We can’t have a PowerShell script on a network share. Network shares were invented 39 years ago – there’s no way that Windows can rely on tech that bleeding edge and unstable. So now I have to build stupid shit file synchronizing routines to keep changes made in the official repository up to date with the stupid copy on the stupid C: drive.

Please, Microsoft, keep working on Windows 11. Moving the start menu to the center of the screen is so important.

Also: why on the Lord’s Green Earth is the Task Scheduler All Running Tasks dialog box a fixed width? Wasn’t Windows 3 like, twenty years ago?

Man, I wish I could retire from this job.

Firefox / Mozilla – on Windows – decided I did not need a Bookmarks button. WTH?

Two environments: work and home. Two platforms: Linux and Windows. Symptom is only on Windows, but spanned both work and home.

I do use the Firefox Sync feature, but of course two different email accounts for work versus home. I realize I am kind of stretching things; but, I use the Firefox sync thing across both Windows and Linux for both work and home.

Once I finally figured out how to get the Bookmarks button back, I tried to synchronize now to get the good/repaired installation of Firefox on Windows to propagate over to the broken versions. That did not work.

So: Firefox on Linux (both work and home) did not lose the Bookmarks button. Firefox on Windows (all machines) lost the bookmarks button. If it were a Firefox Sync thing, I would have thought that the repaired Windows installation would have propagated over to the other Windows machines.

Also, if it were a Firefox Sync thing, I don’t think it would have happened at the same time on two different accounts (work and home). Sure, I could have hit a bad keystroke and removed this button I wanted in one browser, and then Sync propagated the bad config. But that it happened at both work and home at the same time makes me think that it was a new build of Firefox that just clobbered the thing.

I am disappointed that 1) Mozilla didn’t have quality checks in place to catch this first, and 2) that Firefox Sync does not propagate the repair to the synchronized machines.

So, on every Windows machine, I now need to do:

(hamburger menu) –> More Tools –> Customize Toolbar

Then on the new screen, find the Bookmarks Menu button, and drag it to the toolbar. Repeat for all the Windows machines you have.

Microsoft as bully, yet again

Personally, I think that people have the capacity to be both humble and bullies. But it is a conflict, and, some people think they are being helpful when actually they are bullying. “If only you did things my way, and then everything will be better” says the bully under the delusion of being helpful.

Recently, Microsoft pushed out an update to Windows 10 which adds a “News and Interests” widget to the Windows task bar. You don’t get a choice; it will be installed whether you want it or not. You can turn it off after the fact, of course. But what the person at Microsoft behind this change does not care to hear is that I didn’t want to be violated in the first place.

All it really does is remind me that I don’t have control of this machine; Microsoft does.

Thanks, Microsoft. I already dislike you, but, I hadn’t gotten a recent reminder of why.

“What’s the big deal‽‽‽ It’s just a little thing. I was being helpful and making your life better” says the bully. Yeah, no. I hear what you are saying, and I see through the deceit (conceit) that this is somehow for my good. It is not. It is an ego stroke for yourself and nothing more.

If it were really for my good, it would be turned off by default, and not installed by default. Microsoft could say “we added a new feature, if you want”, and I’d be fine with that. But pushing it without permission tells the truth of the act.

Wow Perl PAR::Packer sucks

I presented a problem to my boss, where I need to let about 30 desktop technicians run some code I’ve written. My boss said when he is in that position, he writes it in PowerShell, and uses PS2EXE. This is good idea. I found that in the Perl world, the same idea is in PAR::Packer.

A super simple script, running on my Linux box, takes less than one second to run. Open up an SQLite database, fetch all 20 records, sort them, print them. Simple. Less than one second.

The Windows .exe version takes 19 seconds.

Every. single. run.

There is no way that the on-call technicians who have to run the scripts I’m writing are going to be happy with that. And it would make me feel bad, inflicting that sort of this-is-time-of-my-life-that-I-am-not-getting-back on some poor soul who got a call at two in the morning, to deal with whomever for whatever.

Normally, on Windows, I used WinBatch. Did so for 20 years. But alas, WinBatch was always a for-pay product, and eventually hobbyists wrote AutoHotKey (or was it Auto-It?) (for free) to do everything WinBatch does. Also, the real goal was to take my Perl scripts that use REST to get and put JSON or XML at a web service. WinBatch has lots of old extenders, but rarely any new ones. I don’t know of a REST extender for WinBatch. I don’t know of anything in WinBatch that does what DBI does in the Perl world. The WinBatch answer is to install MS Access (or whatever) and use COM to drive the actual database client. Avoiding installing software is part of the goal here. I need something That Just Works.

And preferably works in a second or two; not twenty.

I’ve got REST modules written in Perl. I’ve gotten far enough in my Perl skills to put standardized code in modules, and then use those modules. But that meant putting modifying the search environment for finding modules. Guess what doesn’t work with PAR::Packer?

Okay, crap, I can move all my modules into the root directory where my scripts are. This is stupid, but I’ll do it.

And then I find that the execution speed of even a simple script is terrible.

Searching for a solution, of course the answer is “You’re doing Perl wrong, if you don’t want to install an entire development environment on every workstation”.

Well, thanks for nothing. Apparently I need to give up Perl and start learning PowerShell. PowerShell does rather look like Perl, so maybe it won’t be too terrible of a transition.