Give each default-application role a whole family of types
Every role carried a single representative type, so setting "Images" changed image/png and left image/jpeg wherever it landed. That is how this desktop ended up opening PDFs in GIMP, PNGs in a pixel-art editor and MP3s in a video transcoder: nobody chose any of it, applications registered themselves for everything they could read, and the roles governed one type each. Roles now own families and write every type when set, the settings page exposes the documents, text and archives roles it never offered, and a new seed command curates a fresh machine during setup while always keeping a choice the user has already made. The shipped editor entry launches kitty explicitly. The stock nvim.desktop sets Terminal=true, which defers to whatever the system considers default rather than the terminal this desktop themes. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
This commit is contained in:
@@ -259,3 +259,18 @@ for desktop_file in "$PANAMA_APPLICATION_DIR"/*.desktop; do
|
||||
ln -s "$desktop_file" "$desktop_target"
|
||||
log "Linked $desktop_name → $desktop_target"
|
||||
done
|
||||
|
||||
# Curate what files open with, now that Panama's own entries are linked.
|
||||
#
|
||||
# Left alone, a machine decides this by installation order -- whichever
|
||||
# application registered for image/png last wins it -- which is how a pixel-art
|
||||
# editor ends up owning screenshots and a video transcoder ends up owning MP3s.
|
||||
# Seeding only fills roles nobody has chosen for; an existing "Open With" choice
|
||||
# is always kept.
|
||||
DEFAULT_APPS_HELPER="$PANAMA_PATH/config/dot/quickshell/scripts/panama-default-apps"
|
||||
if [[ -x "$DEFAULT_APPS_HELPER" ]] && command -v xdg-mime >/dev/null 2>&1; then
|
||||
update-desktop-database "$USER_APPLICATION_DIR" >/dev/null 2>&1 || true
|
||||
while IFS= read -r seeded_line; do
|
||||
log "Default applications: $seeded_line"
|
||||
done < <("$DEFAULT_APPS_HELPER" seed 2>&1 || true)
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user