Showing posts with label Arch. Show all posts
Showing posts with label Arch. Show all posts

Monday, May 18, 2026

MATLAB on Arch Linux: java.lang.NullPointerException and MATLAB does not start

If MATLAB stopped launching after a recent Arch Linux system update and you see a java.lang.NullPointerException with a stack trace starting at DTSingleClientFrame.mainFrameCreated, likely reason could be a corrupted preferences folder.

You can confirm the issue by checking whether MATLAB works without the desktop:

matlab -nodesktop -nosplash

If that launches fine, the desktop preferences are to blame. The fix is simply to delete MATLAB's local preferences folder:
rm -rf ~/.matlab/R20*/
matlab

MATLAB will recreate the folder fresh on next launch and the desktop should start normally again. No reinstall needed.

Monday, April 13, 2026

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:
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"
STRATA_ROOT="/bedrock/strata/$STRATA"
SRC="$STRATA_ROOT/usr/share/applications"
SRC_CROSS="$STRATA_ROOT/bedrock/cross/applications"
DEST="$HOME/.local/share/applications"

# Icon search dirs within the stratum, in priority order
ICON_SEARCH_DIRS=(
"$STRATA_ROOT/usr/share/icons/hicolor"
"$STRATA_ROOT/usr/share/icons"
"$STRATA_ROOT/usr/share/pixmaps"
)
ICON_EXTENSIONS=("png" "svg" "xpm")
# Preferred sizes in descending order (hicolor subdirs)
ICON_SIZES=("256x256" "128x128" "96x96" "64x64" "48x48" "32x32" "scalable")

# Resolve an icon name to an absolute path inside the stratum.
# Returns the path on stdout, or nothing if not found.
resolve_icon() {
local icon_name="$1"

# Already an absolute path — verify it exists (possibly via stratum root)
if [[ "$icon_name" == /* ]]; then
[[ -f "$icon_name" ]] && echo "$icon_name" && return
[[ -f "$STRATA_ROOT$icon_name" ]] && echo "$STRATA_ROOT$icon_name" && return
return
fi

# Strip any accidental extension for a clean name-based search
local base_name="${icon_name%.*}"

# 1. Search hicolor theme with preferred sizes first
for size in "${ICON_SIZES[@]}"; do
for ext in "${ICON_EXTENSIONS[@]}"; do
local candidate="$STRATA_ROOT/usr/share/icons/hicolor/$size/apps/$base_name.$ext"
[[ -f "$candidate" ]] && echo "$candidate" && return
done
done

# 2. Check pixmaps directly (flat directory, no subdirs) — catches vscodium, cups, etc.
for ext in "${ICON_EXTENSIONS[@]}"; do
local candidate="$STRATA_ROOT/usr/share/pixmaps/$base_name.$ext"
[[ -f "$candidate" ]] && echo "$candidate" && return
done

# 3. Walk all icon theme dirs (any size/category subdir)
for icon_dir in "${ICON_SEARCH_DIRS[@]}"; do
for ext in "${ICON_EXTENSIONS[@]}"; do
# Direct file in dir (pixmaps style — already handled above, but kept for custom dirs)
local candidate="$icon_dir/$base_name.$ext"
[[ -f "$candidate" ]] && echo "$candidate" && return
# Subdir search (themes with size/category layout)
# Prefer largest size by sorting descending on the size component
while IFS= read -r found; do
echo "$found" && return
done < <(find "$icon_dir" -name "$base_name.$ext" 2>/dev/null \
| sort -t'/' -k1,1 -r | head -1)
done
done
}

mkdir -p "$DEST"

for src_file in "$SRC"/*.desktop "$SRC_CROSS"/*.desktop; do
# Skip broken symlinks or non-files
[[ ! -f "$src_file" ]] && echo "Skipping: $(basename "$src_file")" && continue

filename=$(basename "$src_file")
dest_file="$DEST/$filename"

# FIX 1: Remove existing file first so cp never hits a permission-denied
# on files previously written by root (e.g. from an earlier sudo run).
if [[ -e "$dest_file" && ! -w "$dest_file" ]]; then
echo "Warning: removing unwritable existing file: $dest_file"
rm -f "$dest_file" || { echo "Error: cannot remove $dest_file — skipping"; continue; }
fi

cp -- "$src_file" "$dest_file" || { echo "Error: cp failed for $filename"; continue; }

# Fix Exec= lines that don't already use strat
if ! grep -q "Exec=strat $STRATA" "$dest_file"; then
sed -i "s|^Exec=|Exec=strat $STRATA |" "$dest_file"
fi

# Fix Icon= lines — resolve to absolute path inside the stratum
icon_value=$(grep -m1 "^Icon=" "$dest_file" | cut -d'=' -f2-)
if [[ -n "$icon_value" ]]; then
resolved=$(resolve_icon "$icon_value")
if [[ -n "$resolved" ]]; then
# Escape any special characters for sed
escaped=$(printf '%s\n' "$resolved" | sed 's/[[\.*^$()+?{|]/\\&/g')
sed -i "s|^Icon=.*|Icon=$escaped|" "$dest_file"
echo "Processed: $filename (icon -> $resolved)"
else
echo "Processed: $filename (icon '$icon_value' not resolved — left as-is)"
fi
else
echo "Processed: $filename (no Icon= entry)"
fi
done

update-desktop-database "$DEST"
echo "Done."

Tuesday, March 31, 2026

distrobox: create archlinux container with automatic yay installation

distrobox create -i archlinux -n abox -H ~/home-abox && 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"

Saturday, March 28, 2026

distrobox: start krusader with dark them from host

/run/current-system/sw/bin/distrobox-enter -n abox -- bash -c 'env GTK_THEME=Adwaita:dark ICON_THEME=Papirus QT_QPA_PLATFORMTHEME=qt6ct krusader -qwindowtitle %c %u'

Fixing KDE App Theming in Distrobox on XFCE

If you run a KDE application (like Krusader) inside a Distrobox container on an XFCE host with a dark theme, you might notice that the icons are dark and nearly invisible against the dark background. This happens because the app inherits a mismatched icon theme from the host, and no Qt platform theme manager is configured inside the container.

The Fix

First, enter your container and install the required packages:

distrobox enter abox
sudo pacman -S papirus-icon-theme qt6ct

Note: check whether your KDE app links against Qt5 or Qt6 before choosing between qt5ct and qt6ct:

ldd $(which krusader) | grep -i qt

Next, tell Qt to use qt6ct as the platform theme. In fish shell, set it as a universal variable so it persists across sessions:

set -Ux QT_QPA_PLATFORMTHEME qt6ct

Then configure the theme and icons by editing the qt6ct config directly:

mkdir -p ~/.config/qt6ct
cat > ~/.config/qt6ct/qt6ct.conf << 'EOF'
[Appearance]
icon_theme=Papirus-Dark
style=Breeze
EOF

Finally, set up kdeglobals so KDE apps pick up the correct color scheme and icon theme:

cat > ~/.config/kdeglobals << 'EOF'
[General]
ColorScheme=BreezeDark

[KDE]
widgetStyle=Breeze

[Icons]
Theme=Papirus-Dark
EOF

Open a fresh container session and launch your KDE app — the icons and theme should now render correctly.

Thursday, March 26, 2026

Friday, January 30, 2026

distrobox-assembly: Install arch with yay and some default packages

distrobox.ini:
[abox]
additional_packages="git base-devel sudo curl"
home=~/home-abox
image=archlinux:latest
init=true
start_now=true
init_hooks='useradd -m -G wheel builder && echo "%wheel ALL=NOPASSWD: ALL" >> /etc/sudoers.d/wheel && su - builder -c "git clone https://aur.archlinux.org/yay-bin.git && cd yay-bin && makepkg -si --noconfirm" && rm -rf /home/builder/yay-bin && su - builder -c "yay -S --noconfirm --needed mc vim htop tmux fd zoxide fzf terminator freerdp rdesktop bash-completion firefox firefox-developer-edition brave-bin vscodium-bin onlyoffice-bin libreoffice-fresh gwenview okular wine krusader krename kdiff3 konsole xdg-desktop-portal-kde ipython tigervnc fluxbox rofi xterm xorg-xeyes masterpdfeditor vlc mpv qt6-imageformats kimageformats vlc-plugins-all fish chromium librewolf-bin go python-uv gimp ttf-roboto otf-font-awesome rar p7zip octave yt-dl sshfs ebook-tools xarchiver kdegraphics-mobipocket gnome-boxes" && cd /etc/xdg/menus && ln -sf ./plasma-applications.menu applications.menu && ln -sf ./plasma-applications.menu gnome-applications.menu && ln -sf ./plasma-applications.menu kde-applications.menu && su - builder -c "NONINTERACTIVE=1 /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\" && eval \"\$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)\" && brew install claude-code gemini-cli opencode qwen-code web-ext" && echo "eval \"\$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)\"" >> ~/.bashrc
nvidia=true
pull=true
root=false
replace=false

Monday, January 26, 2026

distrobox: Basic programs for archlinux and fedora in distrobox

yay --noconfirm -S mc vim fish htop tmux fd zoxide fzf terminator freerdp rdesktop bash-completion firefox firefox-developer-edition brave-bin vscodium-bin libreoffice-fresh gwenview okular wine krusader krename kdiff3 konsole sshfs xarchiver xdg-desktop-portal-kde tigervnc fluxbox rofi xterm xorg-xeyes vlc mpv vlc-plugins-all chromium ipython librewolf-bin go python-uv gimp ttf-roboto otf-font-awesome rar p7zip octave ebook-tools kdegraphics-mobipocket gnome-boxes qt6-imageformats kimageformats curl wget foxitreader thunar npm kate

sudo dnf -y install --skip-unavailable vim firefox brave-browser krusader krename konsole kate keditfiletype kdiff3 chromium okular vlc htop tmux mc fish go python-uv codium unrar p7zip nvtop glx-utils xfreerdp rdesktop tigervnc libreoffice gwenview wine sshfs xarchiver xdg-desktop-portal-kde mpv gnome-boxes curl wget fzf zoxide terminator fontawesome-fonts-all librewolf gimp thunar octave yazi nodejs kwrite firefox-devedition Note: Will have to add custom repos to fedora for firefox-dev, brave-browser, codium and rpmfusion for codeks

Tuesday, December 16, 2025

Monday, December 15, 2025

Arch: Install matlab

mpm install --release=R2024b --destination=/mnt/b/opt/matlab MATLAB Parallel_Computing_Toolbox
https://wiki.archlinux.org/title/MATLAB

Wednesday, December 03, 2025

Tuesday, November 25, 2025

Arch: Krusader does not have open with menu

install yay xdg-desktop-portal-kde
and
cd /etc/xdg/menus
ls -Agl # to show the links in the directory as they are
sudo ln -sf ./plasma-applications.menu applications.menu
sudo ln -sf ./plasma-applications.menu gnome-applications.menu
sudo ln -sf ./plasma-applications.menu kde-applications.menu
ls -Agl # to see of they changed

https://forum.openmandriva.org/t/krusader-does-not-remember-file-associations/6449/13

Thursday, April 10, 2025

Monday, September 09, 2024

Distrobox: archlinux with separate networking for installaion of VPN inside a dropbox

distrobox create --nvidia -i archlinux -n abox -H ~/home-abox --unshare-netns --init --additional-packages "systemd"

Saturday, September 07, 2024

distrobox: arch linux with systemd

distrobox create --nvidia -i archlinux -n abox -H ~/home-abox --init --additional-packages "systemd"

Friday, July 19, 2024

gentoo arch-chroot not working for gui appliacations

chroot from gentoo to arch:


XAUTHORITY=/root/.xauthcOumRQ arch-chroot /mnt/arch/


More: https://unix.stackexchange.com/a/47579/90216 Use xauth info to find the correct XAUTHORITY file path.

Wednesday, November 16, 2022

Arch: Install dotnet 6.0 and jupyter kernel

wget https://dot.net/v1/dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --install-dir /usr/share/dotnet -channel STS -version 6.0.110
/usr/share/dotnet/dotnet tool install -g Microsoft.dotnet-interactive
/usr/share/dotnet/dotnet interactive jupyter install
Also add `/usr/share/dotnet` to `PATH`.
https://github.com/dotnet/interactive/blob/main/docs/NotebookswithJupyter.md
https://dotnet.microsoft.com/en-us/download/dotnet/6.0