xdg-mime default thunar.desktop inode/directory
xdg-mime default thunar.desktop x-scheme-handler/file
Short IT recipes
i.e. some stuff and junk about Python, Perl, Matlab, Ruby, Mac X, Linux, Solaris, ...
Monday, April 13, 2026
distrobox: firefox "Show in Folder" opens vscodium, not thunar or other file manager.
Run in distrobox (make sure thunar is installed in distrobox first):
bedrock linux: krusader in arch strata does not open files with "Open with" menu from strata
On Bedrock Linux (hijacked gentoo with xfce4) with a non-KDE host session, Krusader's (installed in the arch linux strata) "Open With" silently fails for apps in a guest stratum because KDE's KRun launcher depends on session services that are never started outside a KDE session. The fix is to override the affected .desktop files locally and prepend their Exec lines with strat:
The simble bash script to do it automatically (fix-strata-desktop.sh) is:
cp /bedrock/strata/arch/usr/share/applications/appname.desktop ~/.local/share/applications/appname.desktop
sed -i 's|^Exec=|Exec=strat arch |' ~/.local/share/applications/appname.desktop
update-desktop-database ~/.local/share/applications/
The simble bash script to do it automatically (fix-strata-desktop.sh) is:
#!/bin/bash
STRATA="arch"
SRC="/bedrock/strata/$STRATA/usr/share/applications"
SRC_CROSS="/bedrock/strata/$STRATA/bedrock/cross/applications"
DEST="$HOME/.local/share/applications"
mkdir -p "$DEST"
for src_file in "$SRC"/*.desktop "$SRC_CROSS"/*.desktop; do
# Skip if not a regular file (e.g. broken symlinks from Bedrock cross-mount)
[[ ! -f "$src_file" ]] && echo "Skipping: $(basename $src_file)" && continue
filename=$(basename "$src_file")
dest_file="$DEST/$filename"
cp "$src_file" "$dest_file"
# Only modify Exec lines that don't already have strat
if ! grep -q "Exec=strat $STRATA" "$dest_file"; then
sed -i "s|^Exec=|Exec=strat $STRATA |" "$dest_file"
fi
echo "Processed: $filename"
done
update-desktop-database "$DEST"
echo "Done."
Sunday, April 12, 2026
distrobox: firefox does not open file chooser windows
If you run Firefox inside a Distrobox container on a Gentoo (or any) Linux host, you may notice that the "Save Page As" dialog simply never appears. You hit Ctrl+S, nothing happens. No window, no error, just silence.
The culprit is XDG Desktop Portals. Firefox tries to detect whether it's running inside a sandboxed environment like Flatpak, and when it thinks it is, it hands off file chooser dialogs to the XDG portal service instead of opening a native GTK window. Distrobox leaks enough container-like environment variables to trigger this heuristic, so Firefox dutifully tries to call the portal over D-Bus — but the portal either isn't reachable from inside the container or isn't running at all. The call fails silently and you never see a dialog.
The fix is a single preference change in about:config:
Setting this to 0 tells Firefox to never use the portal for the file picker, falling back to the plain GTK file chooser. The dialog comes back immediately, no restart required.
The default value of 2 means "auto-detect", which is the right call for a real Flatpak sandbox where portals are properly set up. In a Distrobox environment though, the detection fires incorrectly and there's no graceful fallback. Until Distrobox masks the relevant environment variables or Firefox improves its detection logic, flipping this preference manually is the most reliable workaround.
The culprit is XDG Desktop Portals. Firefox tries to detect whether it's running inside a sandboxed environment like Flatpak, and when it thinks it is, it hands off file chooser dialogs to the XDG portal service instead of opening a native GTK window. Distrobox leaks enough container-like environment variables to trigger this heuristic, so Firefox dutifully tries to call the portal over D-Bus — but the portal either isn't reachable from inside the container or isn't running at all. The call fails silently and you never see a dialog.
The fix is a single preference change in about:config:
widget.use-xdg-desktop-portal.file-picker = 0
Setting this to 0 tells Firefox to never use the portal for the file picker, falling back to the plain GTK file chooser. The dialog comes back immediately, no restart required.
The default value of 2 means "auto-detect", which is the right call for a real Flatpak sandbox where portals are properly set up. In a Distrobox environment though, the detection fires incorrectly and there's no graceful fallback. Until Distrobox masks the relevant environment variables or Firefox improves its detection logic, flipping this preference manually is the most reliable workaround.
fedora: krusader can't change default application to open files.
Could not find the "keditfiletype" executable in PATH.
Install:
sudo dnf install keditfiletype
gentoo with systemd: simplescan from flatpak does not open Export save file window
Have to make sure that xdg-desktop-portal-gtk portal on gentoo is installed and running (run a regular user, not root):
systemctl --user status xdg-desktop-portal-gtk.service
If it is not running enable it:
systemctl --user enable --now xdg-desktop-portal-gtk.service
Labels:
flatpak,
gentoo,
simplescan
gentoo with systemd and docker: use Nvidia runtime in distrobox through Nvidia container oolkit
Install nvidia container toolbox:
Create distrobox that uses nvidia (fedora 43 as an example):
Enter the distrobox container, fbox, in this example, and test using nvidia-smi:
If inside the distrobox container, nvidia is only avaiable for root user, you have to check what group number is nvidia on the host:
Then in the distrobox container, fbox in this example, you have to edit /etc/group and:
1. add yourself (i.e. normal user) to video group 2. Change video group number to match the one on the host, e.g. 27. For example, /etc/group in fbox
sudo emerge -av nvidia-container-toolkit
restart docker service:
sudo systemctl restart docker
Create and setup /etc/cdi:
mkdir -p /etc/cdi
nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
Check if its working:
nvidia-ctk cdi list
Configure docker to use NVIDIA runtime:
sudo nvidia-ctk runtime configure --runtime=docker
Restart docker service again:
sudo systemctl restart docker
Before creating distrobox container, lets just perfrom basic check if nvidia is avaiable in docker:
docker run --rm --device=nvidia.com/gpu=all ubuntu nvidia-smi
If this shows your Nvidia driver and info about your gpu, than it works.
Create distrobox that uses nvidia (fedora 43 as an example):
distrobox create -i quay.io/fedora/fedora:43 -n fbox -H ~/home-fbox --additional-flags "--device=nvidia.com/gpu=all"
Enter the distrobox container, fbox, in this example, and test using nvidia-smi:
sudo nvidia-smi
This should also give info about your nvidia gpu and its driver.
If inside the distrobox container, nvidia is only avaiable for root user, you have to check what group number is nvidia on the host:
stat -c "%g" /dev/nvidia0
This will show a number, e.g. 27. Then in the distrobox container, fbox in this example, you have to edit /etc/group and:
1. add yourself (i.e. normal user) to video group 2. Change video group number to match the one on the host, e.g. 27. For example, /etc/group in fbox
video:x:27:your-user-name
distrobox with nvidia through NVIDIA Container Toolkit
First setup NVIDIA Container Toolkit and docker support for it based on your host's distrubution. Then you can:
distrobox create -i archlinux -n abox -H ~/home-abox --additional-flags "--device=nvidia.com/gpu=all" && distrobox enter abox -- bash -c "sudo pacman -Sy --noconfirm git base-devel && git clone https://aur.archlinux.org/yay-bin.git /tmp/yay-bin && cd /tmp/yay-bin && makepkg -si --noconfirm && rm -rf /tmp/yay-bin"
nixos: enable nvidia in distrobox container using Nvidia Container Toolkit
What worked for me on nixos with docker (check nixos wiki on Nvidia and Nvidia Container Toolkit) was:
Then in the distrobox container you can check if nvidia is detected, using for example glxinfo. It should show:
Put the following in nixos configuration file:
distrobox create -i archlinux -n archbox --additional-flags "--device=nvidia.com/gpu=all"
Then in the distrobox container you can check if nvidia is detected, using for example glxinfo. It should show:
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:
Put the following in nixos configuration file:
hardware.nvidia-container-toolkit.enable = true;
virtualisation.docker.daemon.settings.features.cdi = true;
Saturday, April 11, 2026
Gentoo and SDDM and Ligthdm: Fixing Inactive Mouse at Display Manager Startup in Gentoo with systemd
If you use Gentoo Linux with systemd and a display manager like SDDM or LightDM, you may have run into an annoying issue where the mouse is completely unresponsive on the display manager's login screen after a reboot or cold start. The keyboard works fine, but the mouse does nothing. A second reboot usually fixes it. The problem does not appear on other distributions like NixOS, Fedora, or Ubuntu.
This is a race condition. Gentoo's minimal default configuration does not add unnecessary delays or dependencies to services, which means your display manager can start before the kernel input subsystem and udev have finished initializing the mouse device. Other distributions work around this implicitly through their own service configurations, but on Gentoo you have to handle it yourself.
The fix is to make the display manager wait for udev to finish settling before it starts. Systemd has a built-in service for exactly this purpose called systemd-udev-settle. It blocks until udev has finished processing all queued device events, which includes input devices like your mouse. You wire your display manager to it using a systemd drop-in file.
For SDDM, first create the drop-in directory:
Then create the drop-in configuration file:
If you use LightDM instead, the steps are identical but with a different directory:
After creating the file, reload the systemd daemon so it picks up the change:
That is all. On the next reboot, systemd will start systemd-udev-settle before launching your display manager, and it will wait for all input devices to be fully registered before the login screen appears. The mouse will work on the very first try.
The reason this only affects Gentoo is that you compile and configure everything yourself. There is no distribution maintainer quietly patching service files or adding conservative boot ordering on your behalf. That level of control is what makes Gentoo great, but it also means issues like this surface in a way they simply would not on a more opinionated distribution.
If the problem persists after applying this fix, the next thing to investigate is whether your mouse and evdev drivers are compiled as kernel modules rather than built into the kernel, and whether INPUT_DEVICES is correctly set in your /etc/portage/make.conf.
This is a race condition. Gentoo's minimal default configuration does not add unnecessary delays or dependencies to services, which means your display manager can start before the kernel input subsystem and udev have finished initializing the mouse device. Other distributions work around this implicitly through their own service configurations, but on Gentoo you have to handle it yourself.
The fix is to make the display manager wait for udev to finish settling before it starts. Systemd has a built-in service for exactly this purpose called systemd-udev-settle. It blocks until udev has finished processing all queued device events, which includes input devices like your mouse. You wire your display manager to it using a systemd drop-in file.
For SDDM, first create the drop-in directory:
mkdir -p /etc/systemd/system/sddm.service.d/
Then create the drop-in configuration file:
cat > /etc/systemd/system/sddm.service.d/wait-for-input.conf << 'EOF'
[Unit]
After=systemd-udev-settle.service
Wants=systemd-udev-settle.service
EOF
If you use LightDM instead, the steps are identical but with a different directory:
mkdir -p /etc/systemd/system/lightdm.service.d/
cat > /etc/systemd/system/lightdm.service.d/wait-for-input.conf << 'EOF'
[Unit]
After=systemd-udev-settle.service
Wants=systemd-udev-settle.service
EOF
After creating the file, reload the systemd daemon so it picks up the change:
systemctl daemon-reload
That is all. On the next reboot, systemd will start systemd-udev-settle before launching your display manager, and it will wait for all input devices to be fully registered before the login screen appears. The mouse will work on the very first try.
The reason this only affects Gentoo is that you compile and configure everything yourself. There is no distribution maintainer quietly patching service files or adding conservative boot ordering on your behalf. That level of control is what makes Gentoo great, but it also means issues like this surface in a way they simply would not on a more opinionated distribution.
If the problem persists after applying this fix, the next thing to investigate is whether your mouse and evdev drivers are compiled as kernel modules rather than built into the kernel, and whether INPUT_DEVICES is correctly set in your /etc/portage/make.conf.
Fedora 43: Install latest foxitreader
Download latest version (FoxitReader.enu.setup.2.4.5.0727). Foxitreader is no longer maintained, so this is the oldest version.
Follow the prompts.
wget https://cdn01.foxitsoftware.com/pub/foxit/reader/desktop/linux/2.x/2.4/en_us/FoxitReader.enu.setup.2.4.5.0727.x64.run.tar.gz
tar xzvf FoxitReader*.tar.gz
chmod +x ./"FoxitReader.enu.setup.2.4.5.0727(rb70e8df).x64.run"
sudo ./"FoxitReader.enu.setup.2.4.5.0727(rb70e8df).x64.run"
Follow the prompts.
Labels:
Fedora,
foxitreader
Subscribe to:
Comments (Atom)