Amazon Echo – Multi-Room Music

Recently, I don’t know when, Amazon added Multi-room Music capability to their Echo devices. Basically, if you have multiple Echo devices, in different rooms, you can, once you set up the group, stream the same music to them all at once. This is a great feature and, to be honest, something that should have been available from the start. However, it comes with a price; it eats up your WiFi bandwidth. I found, through some very basic, unscientific testing on Speedtest.net that when not streaming to all my Echo devices (I have 3 Echo Dots) at once, I had the speeds that I expect (and pay for).

When I streamed across all three devices, there was an approximate 40% drop in bandwidth.

So, if you’re doing other things (like writing a blog no one reads, downloading large Linux ISOs or working) on the ‘Net while streaming to all your Echos, you may feel that degradation in speed.

And that’s all I have to say about that.

Installing Fedora on System76

About

This is about what I went through to install Fedora 27 (XFCE spin) onto my Gazelle system76 laptop. For those not aware, system76 provides hardware that ships with Linux (Ubuntu) instead of Windows; which actually results, depending on what you order, a system just as powerful as the usual suspects (Dell, HP, etc.) but $200-$500 cheaper because you don’t have to pay for Micro$oft Windows (yes, you are still paying for Windows when you buy from those others).

Background

So, as I mentioned earlier, system76 systems (that sounds redundant) comes with Ubuntu. For me, that lasted all of 30 minutes before I replaced it with something else. That wasn’t an easy task. With the newer Skylake processors, kernel 4.x is needed. That left distros like CentOS out the question with its 3.10 kernel; oh, it would some how install completely, but on reboot it would croak. Plus, that Gnome2 UI (think it’s Gnome3 now, but still the 3.10 kernel) just wasn’t for me. Native Debian behaved similarly. So I jumped between various other distros, such as Mint (which I view as Ubuntu with a green color scheme), wattOS (which uses LXDE, a session-managed Openbox, but still based off of Ubuntu). SparkyLinux, another LXDE distro based of the “testing” branch of Debian, wasn’t too bad. There were some others in there as well. The last one, before attempting Fedora, was system76‘s Pop!_OS. Pop!_OS uses a somewhat customized Gnome3 desktop and Ubuntu repositories. I’ve never been a fan of Gnome3. Maybe because I’m used to DEs like XFCE and Openbox where you can right-click on your desktop and get the applications menu right there, as well as being severely limited in customizing; things as simple as date/time formatting, had to find an extension for that. I did “try” to use Gnome3 for a while, but I could never get used to it. So, this is how I got to Fedora.

About Fedora

Fedora is basically a bleeding-edge distro based off RedHat (actually owned by RedHat).

Installation

The initial installation didn’t go to well. I got through everything until the end, when it attempted to write the boot loader, which it failed. Having installed countless distros of Linux, I can’t say that I’ve run into that all to often; OpenSuSe may be the one other distro that had that issue. Through some digging around the ‘Net, I found that the reason may be that the BIOS wasn’t set to UEFI. I normally don’t set my BIOS to UEFI and don’t recall on this system whether or not it was set to that or not. So, I set my BIOS to UEFI and the installation, after creating the requisite /boot/efi partition, worked flawlessly. One of the faster installs, to be honest.

Initial Boot & Login

The initial boot went fine until I tried logging in as a non-root user (who really logs into a system as root anyway?). The screen would flicker and then take me back to the login screen; as root I could log in fine. So I went to the console level, logged in with the non-root account and executed startx. As soon as XFCE came up, SELinux started giving all sorts of messaging about access my $HOME, reading $HOME/.cache, reading some other directory in $HOME, etc.

SELinux

I read/followed how to set up a policy to be OK with that, etc., but after about the fifth one, I went to find how to disabled SELinux, or, at the very least, dial it down. Initially, instead of flat out disabling in /etc/selinux/config, per recommendation from various readings, I set it to permissive. This resulted in not being able to boot at all. That’s not entirely true, it would boot, but a lot of the services would fail to start. This resulted in me having to boot into single-user mode and set SELINUX=disabled in /etc/selinux/config. This worked like a champ and booted up in record time and allowed me to log in. SELinux has been around for a while and while it has it’s purpose, I don’t know that it’s necessary for a home system. I suspect why SELinux was so upset about my $HOME was because it wasn’t encrypted. To me, it’s just a bit overkill.

Conclusion

After working through the above, everything worked as I expected. In the past I used Fedora almost exclusively, right around the time RedHat turned into the Micro$oft of the Linux world and RedHat was no longer free. After a while I started using variations of Debian, with some dabbling with Slackware and OpenBSD (and FreeBSD) of which requires a lot of hand-holding, patience, time and good code compilation error troubleshooting skill. I’ll have to get used to using DNF (Dandified yum, next-gen fork of yum) again versus Debian’s APT. Syntactically, they’re close and I’m not exactly new to using dnf.

That’s it. That was my, not so problematic experience installing Fedora on my system76 device.

And that’s all I have to say about that.

Monitor Hot-plug Script

Background

I recently installed Pop!_OS from system76 (maker of my laptop) which happens to use a customized implementation of the Unity desktop. I’ve never been a fan of Ubuntu and certainly never cared for the Unity desktop. But I figured I would give it a try for a period of time before switching to something that is, in my opinion, more user-friendly and configurable (such as XFCE, Openbox, etc.). This isn’t about my opinion of Ubuntu, Unity or all efforts in Linux that go out of their way to mimic Microsoft Windows and Apple.

While it is a laptop that I use, I do, for the most part have an external monitor connected to it via an A/B switch for my work laptop and my personal one. One the functionalities lacking in Gnome3 (as well as other desktop environments) in general is the detection of when an external monitor is connected. Sure, you could use something like arandr the will generate a script for you and you can map it to a keyboard shortcut (binding), but that requires some manual effort that, frankly, shouldn’t be necessary. So, what I did was create a utility (chreli-monitor-hotplug) that simulates detecting when an external monitor is connected or disconnected, leveraging xrandr. The script is written in Perl and loops continuously (sleeping for 5 seconds) parsing the output of xrandr to see what’s connected, primary, etc. It’s not elegant, as I’m sure there are other like scripts or applications out there that can do the same thing better, but this gets the job done (for me any way).

Requirements

The following are required for chreli-monitor-hotplug:

  • x11-xserver-utils (needed for xrandr)
  • perl

Installation

To install, download chreli-monitor-hotplug-1.0.20171103.deb and execute the following command:

Disclaimer: This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

sudo /usr/bin/dpkg -i chreli-monitor-hotplug-1.0.20171103.deb

Usage

Using GNOME Tweaks, navigate to Startup Applications, click the + and in dialog, search for ChrEli.

Select ChrEli Monitor Hotplug and click the Add button.

Alternatively, you could just copy /usr/share/applications/chreli-monitor-hotplug.desktop to ~/.config/autostart.

The above will result in chreli-monitor-hotplug auto-starting on next restart (or re-login).

Configuration

Upon initial execution of chreli-monitor-hotplug, it will create and set defaults in ~/.config/chreli-monitor-hotplug/chreli-monitor-hotplug:

# chreli-monitor-hotplug 1.0.20171104
#
# configuration file for chreli-monitor-hotplug

# debug
# default: 0
chreli-monitor-hotplug.debug=0

# interval (in seconds) to check monitor changes
# default: 5
chreli-monitor-hotplug.interval=5

# dual
#  o flag to use both connected monitors
# default: 0
chreli-monitor-hotplug.usedual=0

# external.primary
#  o flag to make external primary monitor
# default: 1
chreli-monitor-hotplug.external.primary=1

Conclusion

That’s it. Nothing complex, but gets the job done and meets my needs (at least on my system). Given that every system and distro is different in how they behave, name devices, etc., chreli-monitor-hotplug may not work out-of-the-box on all system, but should for most.

And that’s all I have to say about that.

Yet Another Random Wallpaper Changer

Here’s yet another utility that, yep, you guessed it, is written in perl called chreli-randomwall. As the name implies, it’s random (keyword) wallpaper changer for desktop environments such as Openbox.

Requirements

The following are required for chreli-randomwall:

  • x11-xserver-utils (needed for xrandr)
  • nitrogen

The following are required for chreli-randomwall-hsetroot:

  • x11-xserver-utils (needed for xrandr)
  • hsetroot

Installation

To install, download chreli-randomwall_1.1.20170522.deb or chreli-randomwall-hsetroot_1.0.20170527.deb and execute the following command:

Disclaimer: This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

sudo /usr/bin/dpkg -i chreli-randomwall_1.1.20170527.deb

Or

sudo /usr/bin/dpkg -i chreli-randomwall-hsetroot_1.0.20170527.deb

Usage

For Openbox, add the following, for example in ~/.config/openbox/autostart:

sleep 2 && /usr/bin/chreli-randomwall &

Or

sleep 2 && /usr/bin/chreli-randomwall-hsetroot &

The above will start chreli-randomwall upon login to Openbox.

Configuration

Upon initial execution of chreli-randomwall, it will create and set defaults in ~/.config/chreli-randomwall/chreli-randomwall.conf:

# chreli-randomwall 1.1.20170527
#
# configuration file for chreli-randomwall

# interval (in seconds) to change wallpaper
# default: 300
chreli-randomwall.interval=300

# directories to search for images
#  o comma separate for multiple directories
# default: /home/cygnus/Pictures
chreli-randomwall.image.dirs=/home/cygnus/Pictures,/home/cygnus/pics

The default interval (when to change the wallpaper) is 300 seconds (5 minutes). The default directory to look for images is ~/Pictures. If there is a desire to use multiple directories, that can be accomplished by a comma separated list. Any new images that are added while chreli-randomwall is running will be used the next time it re-reads the image dir(s), which it does after it cycles though showing all the images. This could take a while depending on how many images are involved. For the impatient, the process id for chreli-randomwall can be killed off and started again; be sure to send it background.

As stated earlier, chreli-randomwall randomly change the wallpaper. Meaning that if you have 100 unique images, once you see the first one, you should not see it again until the other 99 are displayed; unless, of course, you have the same image multiple times in the directory with a different file name.

If you have multiple monitors (who doesn’t, right), chreli-randomwall will detect (via xrandr)that too and update ~/.config/nitrogen/bg-saved.cfg as shown in the example below:

[xin_-1]
file=/home/cygnus/Pictures/c62314c087379a9f2306412ca4268925.jpg
mode=0
bgcolor=#242424
[:0.0]
file=/home/cygnus/Pictures/c62314c087379a9f2306412ca4268925.jpg
mode=0
bgcolor=#242424

The current version of chreli-randomwall will show the same image on all monitors that may be configured. A future release may allow for a different image on each screen.

And that’s all I have to say about that.