Files
dotfiles/scripts/fix-container-desktop-files.sh
Ziad ArafatandClaude Opus 5.5 db20e3d8b2 Autohide panel, Rotom menu icon, centred+blurred wallpapers, audio feedback everywhere, secrets status/add/set
- sounds.nix: per-app notifyrc overrides so app notifications, login/logout,
  lock/unlock, network, bluetooth, konsole, spectacle, etc. all play Portal 2 sounds
- dot sounds test|notify to audition the theme and the notification path
- 18 more Portal 2 events (36 total)
- fix-container-desktop-files: wrap PWA launchers written by Edge inside the
  etv distrobox so they start from the host menu
- dot secrets: file list (config/secret-files.txt), status, add, set; WireGuard opt-in

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 15:01:08 -06:00

22 lines
910 B
Bash
Executable File

#!/usr/bin/env bash
# Browsers inside distroboxes (e.g. Edge in `etv`) write PWA launchers into the
# shared ~/.local/share/applications with Exec paths that only exist inside the
# container. Prefix those with `distrobox-enter -n <box> --` so they work from
# the host menu. Mapping: binary path prefix -> container name.
set -euo pipefail
declare -A BOX=(
[/opt/microsoft/msedge/]=etv
)
dir="${XDG_DATA_HOME:-$HOME/.local/share}/applications"
shopt -s nullglob
for f in "$dir"/*.desktop; do
for prefix in "${!BOX[@]}"; do
# Only bare Exec lines (not already wrapped) whose binary is missing on the host.
if grep -q "^Exec=$prefix" "$f" && [ ! -e "$prefix" ]; then
sed -i "s|^Exec=$prefix|Exec=distrobox-enter -n ${BOX[$prefix]} -- $prefix|" "$f"
grep -q "^TryExec=$prefix" "$f" && sed -i "/^TryExec=/d" "$f"
echo "wrapped $(basename "$f") -> ${BOX[$prefix]}"
fi
done
done