This seems kind of lame but solves two problems.
One of my USB audio devices only shows up with a Speaker channel, so I
can't just use my keyboard shortcut to adjust Master all the time.
Trying to adjust channels that don't exist doesn't hurt anything, so I
might as well just adjust all 3 outputs that I potentially care about.
Sometimes I'll end up with Capture off and Mic unmuted or vice versa.
Toggling them both together means they're always in the same state,
making it easier to figure out what is going on.
I'm assuming this won't break anything because most users will already
be 1000. Existing users whose primary accounts have a different UID
should set the var appropriately.
Existing users should remove the old udev rules.
# rm /etc/udev/rules.d/99-lowbat.rules
notify-send doesn't work since the script is being called as root, but
that is fixable. This at least gets the low battery notification via
wall and suspension at critical levels working consistently, unlike the
unreliable udev approach.
For shady PDFs, firewarden is still the better solution, but jailing
zathura with the generic profile isn't going to hurt anything when
viewing trusted docs.
I think I originally got this from the official TLP docs, but
systemd-rfkill isn't a template, so we don't actually want the @ in
there.
Fixes some of #18.
udev was not distinguishing between multiple batteries. It was
suspending the system when the secondary battery reached the threshold,
even if the primary battery was still full, which is not the desired
behaviour.
There may be a way to tell udev which battery we care about, but it was
easier for me to just write a shell script that handles all the logic.
The script warns when the primary battery is low and suspends when the
primary battery is critical.
I tried calling the script with a single udev rule with a capacity range
of 0-10, however that resulted in no warnings and suspending only when
the battery went to 0%. Not useful. With two rules with different ranges
like this, the system is consistently suspended at 5%, which is what I
want. I sometimes get warnings in the 6-10% range, but not consistently.
I don't know why.
If the warnings won't work, we could create a systemd timer to call the
script every ~60 seconds or so. That will definitely work, but it seems
like udev should be able to handle this.
After making these changes to an existing system, rebuild grub and make
images.
# grub-mkconfig -o /boot/grub/grub.cfg
# mkinitcpio -p linux
# mkinitcpio -p linux-grsec