How to Add a Custom Breadcrumb Template Tag

Since version 4.4.0, it has been possible to add additional custom template tags to supplement the defaults included in Breadcrumb NavXT. Adding a custom template tag is relatively easy. All one has to do is write a function that hooks into the bcn_template_tags filter and adds the new template tag.

bcn_template_tags has three parameters, two for helping identify the resource the breadcrumb represents, and one for the actual replacement set. Today, we’ll focus on the first parameter, the $replacements array. This associative array has the template tag as the key and the value is the actual value that should replace the tag in breadcrumbs. To add a new template tag, simply add a new key-value pair to the array and return the modified $replacements array.

For example, to add a breadcrumb template tag that inserts the current theme’s directory, one could use the following:

function my_bcn_template_tag($replacements, $type, $id)
{
    //Add the %template_directory% template tag
    $replacements['%template_directory%'] = get_bloginfo('template_directory');
    //Return our new set of templates and replacements
    return $replacements;
}
add_filter('bcn_template_tags', 'my_bcn_template_tag', 3, 10);

In the code above, %template_directory% is the breadcrumb template tag being added; its value is retrieved using the get_bloginfo() function. Simple, right?

-John Havlik

[end of transmission, stay tuned]

Notes on XPS 15 9550 Linux Support

Tired of waiting for a 3D XPoint based SSD to become available, I decided to grab a 512GB Intel SSD 600p for my XPS 15 9550. The intent was to switch over from Windows 10 to Linux on the 9550 while preserving the original SSD should I want to go back.

The actual SSD swap was not too difficult. A Torx T5 and small Phillips screwdriver are needed to remove the back of the 9550 and the m.2 SSD. This being my first NVMe system, I ran into a few gotchas while getting Linux installed. Though, the bulk of the issues are related to Broadcom’s poor Linux support.
Continue reading

Fixing the Onkyo TX-SR806 Receiver’s Blue in Deep Black Issue

This issue manifests itself as bands of blue in what should be a dark black gradient. A good example of this is the top AMD Catalyst Control Center as seen below.

AMD Catalyst Control Center Header in YCbCr 4:4:4 Mode

AMD Catalyst Control Center Header in YCbCr 4:4:4 Mode

The above is a picture taken by a camera of a TV connected to a Onkyo TX-SR806. The graphics card was set to use the YCbCr 4:4:4 color pixel format in this instance. This causes problems for the TX-SR806 which has problems with certain dark colors, rendering them blue rather than black—directly connecting to the TV does not have this issue.

To fix this, change the color pixel format to RGB 4:4:4 mode. For AMD Radeon users, AMD Radeon Software Crimson can do this (in the drop down menu, it is called “RGB 4:4:4 Pixel Format PC Standard (Full RGB)”).

AMD Catalyst Control Center Header in RGB 4:4:4 Mode

AMD Catalyst Control Center Header in RGB 4:4:4 Mode

Ignoring the moiré pattern due to the alignment of the camera, the dark area looks much better when in RGB 4:4:4 mode. Lastly, this is not an AMD specific issue. The previous HTPC which had Intel graphics also exhibited the same behavior.

-John Havlik

[end of transmission, stay tuned]

Tagged: ,
Updated:

Automatically Reconnect a Bluetooth Device in KDE Plasma 5

If  you’re having issues getting your Bluetooth device to automatically reconnect between KDE sessions (or rebooting your computer), try opening a terminal (e.g. Konsole) and clear the contents of your /var/lib/bluetooth directory. After doing this you will need to restart the bluetooth daemon. For reference, in a Gentoo/Funtoo system, the following will accomplish this:

rm -rf /var/lib/bluetooth/*
/etc/init.d/bluetooth restart

Note that the above needs to be run as root (or use sudo). After removing the contents of your /var/lib/bluetooth directory, you will need re-pair your device in the Bluetooth manager. When paring your device, make sure it is set a trusted device.

Now, KDE should automatically reconnect the Bluetooth device after rebooting your computer. Note that the device may not reconnect until after you have logged in. To reconnect sooner, try using a command line Bluetooth device manager.

-John Havlik

[end of transmission, stay tuned]

Tagged:
Updated:

Calling the Breadcrumb Trail

There are several ways of calling Breadcrumb NavXT’s breadcrumb trail. The first decision is between using the included widget, or calling one of the bcn_display* functions. This guide covers some examples for calling the breadcrumb trail using the bcn_display() function.
Continue reading