GCC / make – pcdPointXYZRGB2txt.cpp:12:24: error: ‘split’ is not a member of ‘boost’

If make fails due to

[ 13%] Building CXX object CMakeFiles/treeseg.dir/src/treeseg.cpp.o
./treeseg/src/pcdPointXYZRGB2txt.cpp: In function ‘int main(int, char**)’:
./treeseg/src/pcdPointXYZRGB2txt.cpp:12:24: error: ‘split’ is not a member of ‘boost’
   12 |                 boost::split(tmp1,args[i],boost::is_any_of("/"));
      |                        ^~~~~
./treeseg/src/pcdPointXYZRGB2txt.cpp:13:24: error: ‘split’ is not a member of ‘boost’
   13 |                 boost::split(tmp2,tmp1[tmp1.size()-1],boost::is_any_of("."));
      |                        ^~~~~
make[2]: *** [CMakeFiles/pcdPointXYZRGB2txt.dir/build.make:79: CMakeFiles/pcdPointXYZRGB2txt.dir/src/pcdPointXYZRGB2txt.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:578: CMakeFiles/pcdPointXYZRGB2txt.dir/all] Error 2

This can be resolved by including the required header (source: boost::split in C++ library | GreeksForGeeks):

#include <boost/algorithm/string.hpp>

change Visual Studio Code application font

Changing the application font (not the text editor font, which can already be changed in settings) in Visual Studio Code can be done via an extension called Custom CSS and JS Loader. After installing the extension, edit/add the following line to settings.json:

"vscode_custom_css.imports": ["file:///C:/Users/nickcummins/Documents/VSCode-Custom.css"],

replacing nickcummins with your username. Then, create this VSCode-Custom.css on your filesystem containing the following:

.windows,
.monaco-workbench.windows {
    font-family: Arial;
}

.monaco-workbench .part > .content {
	font-size: 0.9em;
}

replacing Arial with the preferred font. Finally, re-open VS Code running as Administrator. Search for the command as shown in the screenshot, and click on it.

You’ll be prompted to restart VS Code. You should notice the new font being used when it re-opens. You can close the elevated instance of VS Code and re-open it as a normal user. 

archlinux-pkgbuilds – Arch Linux PKGBUILDs

I maintain a set of PKGBUILDs for the Arch Linux distro in a public GitHub repository: archlinux-pkgbuilds. Many of these are modified versions from the official Arch package repositories or from AUR packages, however some are not found in either. The modifications for existing packages are usually small fixes for issues building with the existing version or to build configured with different CMake variables.

Many of the packages are GIS applications, including

Some of the PKGBUILDs have not been built in several years. I will periodically update this list with recently built packages that are not available in the official repos or AUR.

Changing the default system font in Windows 11

Although Windows 11’s built-in settings provides a Personalization > Fonts section, there actually isn’t a way to change the system font from here:

Windows settings - Personalization - Fonts

This can be easily changed on many Linux distributions using GUI tools, such as the desktop environment’s settings manager. Here you can see Liberation Sans and Liberation Mono configured in the fonts tab of xfce4-settings:

Xfce4 Appearance Settings - Fonts

There is a way to change the system font in Windows, which involves 2 steps:

  1. Using this registry script, changing Arial to the desired Windows font:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
    "Segoe UI (TrueType)"=""
    "Segoe UI Bold (TrueType)"=""
    "Segoe UI Bold Italic (TrueType)"=""
    "Segoe UI Italic (TrueType)"=""
    "Segoe UI Light (TrueType)"=""
    "Segoe UI Semibold (TrueType)"=""
    "Segoe UI Symbol (TrueType)"=""
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
    
    "Segoe UI"="Arial"
    
  2. Changing the WindowMetrics font, via one of the two means:
    • Another registry script, replacing all occurrences of the font represented in hex to the desired font in hex representation. The current font in the script is Arial (which was the default font in many earlier versions of Windows):
      Windows Registry Editor Version 5.00
      
      [HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]
      "IconTitleWrap"="1"
      "Shell Icon Size"="32"
      "BorderWidth"="-15"
      "CaptionFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
        00,00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
      "CaptionHeight"="-330"
      "CaptionWidth"="-330"
      "IconFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,\
        00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
      "MenuFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,\
        00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
      "MenuHeight"="-285"
      "MenuWidth"="-285"
      "MessageFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
        00,00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
      "ScrollHeight"="-255"
      "ScrollWidth"="-255"
      "SmCaptionFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,\
        00,00,00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
      "SmCaptionHeight"="-330"
      "SmCaptionWidth"="-330"
      "StatusFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
        00,00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
        00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
      "PaddedBorderWidth"="0"
      "AppliedDPI"=dword:00000060
      "IconSpacing"="-1125"
      "IconVerticalSpacing"="-1125"
      "MinAnimate"="0"
      
    • Using a 3rd party tool called Advanced System Font Changer. Note, that this tool requires a license for full use.

Change process’s priority in Windows

The simplest means to do this is by simply opening Task Manager in Windows and navigating to the Details pane. Right-click on a process in the list, then select Set priority from the menu.

Alternatively, similar to the Linux renice command, the priority can also be set via command-line in Windows using

wmic process where name="devenv.exe" CALL setpriority "high priority"Code language: JavaScript (javascript)

The aforementioned methods will not persist upon system restart. Permanently setting the default priority of a process can be achieved using a registry script. This file can contain as many entries as desired. In this example below, I set the default process priority of devenv.exe and sqlservr.exe to High 00000003:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe\PerfOptions] 
"CpuPriorityClass"=dword:00000003

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sqlservr.exe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sqlservr.exe\PerfOptions] 
"CpuPriorityClass"=dword:00000003

ripgrep: grep like equivalent for Windows

While Windows provides similar capabilities out-of-the-box with PowerShell, most Linux users will undoubtedly be familiar with the grep command:

> grep --help
Usage: grep [OPTION]... PATTERNS [FILE]...
Search for PATTERNS in each FILE.
Example: grep -i 'hello world' menu.h main.c
PATTERNS can contain multiple patterns separated by newlines.

GNU grep home page: <https://www.gnu.org/software/grep/>
General help using GNU software: <https://www.gnu.org/gethelp/>

Fortunately, there is a cross-platform grep like equivalent for Windows (and MacOS/Linux) called ripgrep:

PS> ripgrep --help
ripgrep 14.1.0 (rev e50df40a19)
Andrew Gallant <jamslam@gmail.com>

ripgrep (rg) recursively searches the current directory for lines matching 
a regex pattern. 'By default, ripgrep will respect gitignore rules 
and automatically skip hidden files/directories and binary file

Use -h for short descriptions and --help for more details.

Project home page: https://github.com/BurntSushi/ripgrep

After installing to a location in your PATH, I also recommend creating a symlink so you can use simply type the command grep rather than ripgrep (this may require admin to create depending on your Windows settings):

New-Item -Type SymbolicLink -Path grep.exe -Target rg.exe

Alternatively, you can create a PowerShell alias using Set-Alias command.

error launching Qt6 applications: Cannot mix incompatible Qt library (6.5.2) with this library (6.5.3)

> qt6ct
Cannot mix incompatible Qt library (6.5.2) with this library (6.5.3)
[1]    26923 IOT instruction (core dumped)  qt6ct

In order to determine the problematic library, use the strace command:

> sudo strace qt6ct
mmap(NULL, 24912, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 9, 0) = 0x7f90a0382000
mmap(0x7f90a0385000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x3000) = 0x7f90a0385000
mmap(0x7f90a0386000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x4000) = 0x7f90a0386000
mmap(0x7f90a0387000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x4000) = 0x7f90a0387000
close(9)                                = 0
mprotect(0x7f90a0387000, 4096, PROT_READ) = 0
statx(AT_FDCWD, "/root/.config/qt6ct/qt6ct.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=855, ...}) = 0
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=2852, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib/qt6/plugins/styles/libqt6gtk2-style.so.avx2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
access("/usr/lib/qt6/plugins/styles/libqt6gtk2-style.so.avx2", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/qt6/plugins/styles/libqt6gtk2-style.so", O_RDONLY|O_CLOEXEC) = 9
read(9, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
newfstatat(9, "", {st_mode=S_IFREG|0755, st_size=236056, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 234272, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 9, 0) = 0x7f909bc9a000
mmap(0x7f909bca5000, 155648, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0xb000) = 0x7f909bca5000
mmap(0x7f909bccb000, 24576, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x31000) = 0x7f909bccb000
mmap(0x7f909bcd1000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x37000) = 0x7f909bcd1000
close(9)                                = 0
mprotect(0x7f909bcd1000, 8192, PROT_READ) = 0
openat(AT_FDCWD, "/dev/tty", O_RDONLY|O_CLOEXEC) = 9
close(9)                                = 0
write(2, "Cannot mix incompatible Qt libra"..., 69Cannot mix incompatible Qt library (6.5.2) with this library (6.5.3)

After finding the problematic library, use pacman -Qo to find the package providing this file:

> pacman -Qo /usr/lib/qt6/plugins/styles/libqt6gtk2-style.so      
/usr/lib/qt6/plugins/styles/libqt6gtk2-style.so is owned by qt6gtk2-git 0.2.r5.g441f266-1

After rebuilding qt6gtk2, qt6ct launches successfully.

Linux, Plank Dock & Desktop Entries: Add an open ‘New Window’ action

Plank is a popular application launcher dock in Linux. By default, most application desktop entries do not provide any additional actions. Say we want to add an open ‘new window’ action to our desktop entry for pkgbrowser:

/usr/share/applications/pkgbrowser.desktop

Our desktop entry file looks as follows:

[Desktop Entry]
Name=PkgBrowser
GenericName=Package Browser
Comment=A utility for browsing pacman databases and the AUR
Exec=pkgbrowser
Terminal=false
Type=Application
Icon=pkgbrowser
StartupNotify=false
Categories=Qt;System;
Code language: JavaScript (javascript)

Simply add the following to the end of the file. Of course, if your desktop entry already has a defined Actions property, you’ll want to add this new-window to it.

Actions=new-window;

[Desktop Action new-window]
Name=New Window
Exec=pkgbrowser
Code language: JavaScript (javascript)

Now, right-clicking the desktop entry will appear as follows:

By default, any desktop entries that come from packages for your Linux distro will be overwritten during a package update. To prevent this from happening, you can made the file read-only using chattr:

sudo chattr +i /usr/share/applications/pkgbrowser.desktop