Automatic Backlight Per Power Source

I love the feature when Windows sets different backlight level depending whether I am plugged in or on battery. I really fits how I use my laptop. But then one day that feature seemingly disappeared. Cause seemed to be a Windows Update and to fix it I would essentially need to restore my old driver.

Well, either that or this small utility. Once installed, it will run a service in the background tracking your power source and backlight level. Whatever level you last set on battery will be used whenever you unplug and whatever you set while plugged in will be used when your AC adapter is connected. Essentially, the same behavior as what once came by default.

While this will never be a full application as I doubt there will ever be enough interested people, download is available at GitHub.


PS: For Linux version check Backlight Tracer.

Editing Scanner Profile

Changing default scanner under Windows is possible but requires manually editing XML files.

Well, this utility at least removes that step. While knowledge of scanner profiles is necessary, one can now do it using application and without messing with XML files directly.

While this will never be a full application as I doubt there will ever be enough interested people, download is available at GitHub.

Wait For Mountpoint

I have quite a few scripts running on my home server and they love writing on disk. They love it so much that, after reboot, they don’t necessarily wait for mount points to appear – they just start writing. Unfortunately, such eagerness also means that my other scripts mounting ZFS might find directory already in use and give up.

What I needed was a way to check if mount point is already there before starting with write. The easiest approach for me was using mountpoint command.

TEST_PATH=/test/directory
while(true); do # wait for mount point
mountpoint "$TEST_PATH" >/dev/null
if [[ $? != 0 ]]; then
sleep 1
continue
fi
break
done

Script fragment above will check if given directory has something mounted and, if not, wait for 1 more second. Once test succeeds, it will break out of the infinite loop and proceed with whatever follows.

Easy enough.