This can be solved by setting the DISPLAY environment variable in your shell’s config file (e.g. ~/.zshrc and /etc/zsh/zprofile if using zsh):
export DISPLAY=$(ip route | grep default | awk '{print $3; exit;}'):0.0
This can be solved by setting the DISPLAY environment variable in your shell’s config file (e.g. ~/.zshrc and /etc/zsh/zprofile if using zsh):
export DISPLAY=$(ip route | grep default | awk '{print $3; exit;}'):0.0
Here are some generally useful extensions I recommend for any Visual Studio user:
Requirements:
import os
import sys
from os import popen, path
def run(cmd):
print(f'Running {cmd} ...')
output = popen(cmd).read()
return output
def pngsize(pngfile):
return pngfile.split('_')[-1].split('x')[0]
if __name__ == '__main__':
icofile = sys.argv[1]
iconname = icofile.replace(".ico", "").replace("-", " ")
if path.exists('tmp'):
run('rm -rf tmp')
os.mkdir('tmp')
run(f'icotool -x {icofile} -o tmp')
pngfiles = os.listdir('tmp')
for pngfile in pngfiles:
run(f'xdg-icon-resource install --novendor --size {pngsize(pngfile)} tmp/{pngfile} "{iconname}"')Code language: JavaScript (javascript)
Usage:
python xdg_icon_resource_install_ico.py folder-pictures.icoCode language: CSS (css)
This error commonly issues with .patch files when the patch and target file use different line ending types (i.e. Windows/DOS/CLRF vs. Unix/LF):
touch .build/x64/status/clone cd .build/x64/src/sshfs && for f in /cygdrive/c/github.com/sshfs-win/patches/*.patch; do patch --binary -p1 <$f; done patching file sshfs.c Hunk #1 FAILED at 365 (different line endings).
The unix2dos / dos2unix and commands can be used to perform conversion. One way to determine the line endings type is to open the files in a text editor like Notepad++ which can indicate the line endings type. But this can also be achieved using the unix2dos command’s -i / --info option:
dos2unix -i 00-passwd.patch
36 0 0 no_bom text 00-passwd.patch
The 36 indicates the number of lines that use DOS-style line endings. Here is a wrapper python script for this which prints out the line endings type:
import os
import sys
import re
if __name__ == '__main__':
filename = sys.argv[1]
infooutput = os.popen(f'dos2unix -i {filename}').read().strip()
doslines = int(re.split(r'\s+', infooutput)[0])
line_ending_type = 'Windows/DOS (CR LF)' if doslines > 0 else 'Unix (LF)'
print(line_ending_type)Code language: JavaScript (javascript)
There are a few different GTK theme configuration tools out there – lxappearance (which doesn’t require the LXDE desktop environment), gnome-tweaks, and xfce4-appearance-settings – to name a few, as well as some desktop-environment agnostic ones such as gtk-chtheme (which supports GTK2 only).
However, my current favorite tool which works for GTK2, GTK3, and GTK4 is nwg-look:

Software developers who work on Windows have likely heard of WSL, which stands for the Windows Subsystem for Windows. Essentially, it is a way to run Linux distributions within Windows somewhat like running a virtual machine (VM) but more seamless – or akin to running a Docker container. WSL provides support for GUI applications out-of-the-box with WSLg. The important thing to note about WSLg is that it is implemented using the RDP protocol, so GUI applications are essentially run via an RDP process running on the host Windows machine. Due to this implementation, the performance of GUI applications running on WSLg will not perform as well as would a native Windows application or compared to running the application on a regular Linux installation.
There are some really cool uses of WSL even outside of software development that may be useful for users who are somewhat technical. Some of these are from the interoperability provided with WSL:
C:\ is mounted in WSL at /mnt/c\\wsl.localhost and can be mounted to network drives (for example I have \\wsl.localhost\Arch mounted as L:\) Windows provides the ability to mount network drives using FTP or SMB – however, it doesn’t provide support natively for mounting network locations using SSH/SFTP. Linux has a FUSE filesystem called sshfs. With WSL, this means network locations can be mounted and accessed from Windows. Similarly, Windows does not natively support mounting external drives containing ext4 formatted partitions.
X410 is a really cool alternative to WSLg, which allows X-Window GUI apps to run like any other Windows application. Note that X410 does require the purchase of a license. The license I purchased is for perpetual for the version when I purchased, though updating to newer versions of X410 will require an additional purchase. Here is an example of Caja running in X410:
Notice how the Window appears like a normal Windows application would. For comparison, here is what Caja looks like in WSLg: 
While it may not look like much of a difference, the advantage of X410 is not about the appearance but performance. The UI responsiveness running X410 is noticeably better than running in WSLg.
Requirements:
param(
[Parameter(Mandatory=$true,Position=0)]
[Alias("s")]
$SvgFilename,
[Parameter(Mandatory=$false,Position=1)]
$IcoFilename = ""
)
if (-not [System.IO.Directory]::Exists("tmp")) {
New-Item -Type Directory -Path tmp
}
$sizes = (16, 20, 24, 32, 40, 48, 64, 128, 256)
$filename = [System.IO.Path]::GetFileNameWithoutExtension($SvgFilename)
for ($i = 0; $i -lt $sizes.length; $i++) {
$size = $sizes[$i];
Write-Host $sizes[$i]
Write-Host $filename
inkscape -z -e tmp/${filename}_${size}.png -w $size -h $size -d 300 $SvgFilename
}
if ($IcoFilename.length -eq 0) {
$IcoFilename = $SvgFilename.Replace(".svg", ".ico")
}
if (-not $IcoFilename.EndsWith(".ico")) {
$IcoFilename = "${IcoFilename}/${filename}.ico"
}
Write-Host "Writing $IcoFilename"
convert tmp/${filename}_16.png tmp/${filename}_20.png tmp/${filename}_24.png tmp/${filename}_32.png tmp/${filename}_40.png tmp/${filename}_48.png tmp/${filename}_64.png tmp/${filename}_128.png tmp/${filename}_256.png ${IcoFilename}
Remove-Item -Path tmp -Recurse
Write-Host "Successfully wrote $IcoFilename"Code language: PHP (php)
Usage:
svg2ico.ps1 device-harddisk-usb.svg device-harddisk-usb.icoCode language: CSS (css) First, create a property called _VersionPrefix in your .csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.1</TargetFrameworks>
<strong> <_VersionPrefix>1.3.1</_VersionPrefix></strong>
</PropertyGroup>
Code language: HTML, XML (xml)
Next, you’ll need to install the dotnet-setversion global tool:
dotnet tool install -g dotnet-setversion
Finally, add the following build targets:
<Target Name="SetGitVersion" BeforeTargets="PreBuildEvent">
<Exec Command="git log -n 1 --format=%25%25h -- ." ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommit" />
</Exec>
<Exec Command="git rev-list --count $(GitCommit)" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GitRevisionNumber" />
</Exec>
</Target>
<Target Name="UpdateCsprojVersion" AfterTargets="SetVersionSuffix">
<Exec Command="setversion $(_VersionPrefix)-r$(GitRevisionNumber).$(GitCommit)"></Exec>
</Target>
</Project>Code language: HTML, XML (xml) IconViewer is a neat little tool for Windows explorer which allows you to view and save icons embedded in any .dll, .exe, or .ico files.
Sysinternals Suite is a set of command-line and GUI tools for Windows.

The default download (for x64/x86 CPUs) contains both 64- and 32-bit binaries. If you are using a 64-bit machine, you can run the following PowerShell script in your directory of the extracted zip files to have the default .exe file be a symlink to the 64-bit version rather than the 32-bit executable:
$files = (ls)
$x64s = @{}
$x86s = @{}
$x64sTox86s = @{}
for ($i = 0; $i -lt $files.Length; $i++) {
$filename = $files[$i].Name
if ($filename.EndsWith("64.exe")) {
$x64s[$filename] = $true
} elseif ($filename.EndsWith(".exe")) {
$x86s[$filename] = $true
}
}
foreach ($x64 in $x64s.Keys) {
$x86 = $x64.Replace("64.exe", ".exe")
if ($x86s.ContainsKey($x86)) {
$x64sTox86s[$x64] = $x86
}
}
foreach ($x64 in $x64sTox86s.Keys) {
$x86 = $x64sTox86s[$x64]
Remove-Item -Path $x86
New-Item -Type SymbolicLink -Path $x86 -Target $x64
}Code language: PHP (php)