From 496219af797ced9513e7d6839ca5c5402651e09c Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Thu, 23 Apr 2026 19:45:49 -0400 Subject: [PATCH 1/9] build(source-os): add office desktop entry --- build/office-suite/desktop/sourceos-office.desktop | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 build/office-suite/desktop/sourceos-office.desktop diff --git a/build/office-suite/desktop/sourceos-office.desktop b/build/office-suite/desktop/sourceos-office.desktop new file mode 100644 index 0000000..0317990 --- /dev/null +++ b/build/office-suite/desktop/sourceos-office.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=SourceOS Office +Comment=Open office documents using the SourceOS office shell +Exec=sh -lc '"$HOME/.local/bin/sourceos-office-open" "%f"' +Terminal=false +MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.presentation;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/msword;application/vnd.ms-excel;application/vnd.ms-powerpoint; +Categories=Office; +NoDisplay=false From 3dbda521a4ef1231946de0da50c0f676f9229102 Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Thu, 23 Apr 2026 19:47:23 -0400 Subject: [PATCH 2/9] build(source-os): add office desktop entry install helper --- .../scripts/install_office_desktop_entry.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 build/office-suite/scripts/install_office_desktop_entry.sh diff --git a/build/office-suite/scripts/install_office_desktop_entry.sh b/build/office-suite/scripts/install_office_desktop_entry.sh new file mode 100644 index 0000000..0c2a822 --- /dev/null +++ b/build/office-suite/scripts/install_office_desktop_entry.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +DESKTOP_SRC="$ROOT/build/office-suite/desktop/sourceos-office.desktop" +BIN_SRC="$ROOT/build/office-suite/scripts/office_open.sh" +APP_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/applications" +BIN_DIR="$HOME/.local/bin" + +mkdir -p "$APP_DIR" "$BIN_DIR" +cp "$DESKTOP_SRC" "$APP_DIR/sourceos-office.desktop" +cp "$BIN_SRC" "$BIN_DIR/sourceos-office-open" +chmod +x "$BIN_DIR/sourceos-office-open" + +echo "installed desktop entry to $APP_DIR/sourceos-office.desktop" +echo "installed launcher helper to $BIN_DIR/sourceos-office-open" From 3856756e946e2004a1755c28c12114a20eccf89a Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Thu, 23 Apr 2026 20:12:10 -0400 Subject: [PATCH 3/9] build(source-os): add desktop entry install smoke helper --- .../scripts/desktop_entry_install_smoke.sh | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 build/office-suite/scripts/desktop_entry_install_smoke.sh diff --git a/build/office-suite/scripts/desktop_entry_install_smoke.sh b/build/office-suite/scripts/desktop_entry_install_smoke.sh new file mode 100644 index 0000000..fb7c8f4 --- /dev/null +++ b/build/office-suite/scripts/desktop_entry_install_smoke.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +TMPDIR="$(mktemp -d)" +trap 'rm -rf "$TMPDIR"' EXIT + +export XDG_DATA_HOME="$TMPDIR/share" +export HOME="$TMPDIR/home" +mkdir -p "$HOME" + +"$ROOT/build/office-suite/scripts/install_office_desktop_entry.sh" >/dev/null + +DESKTOP_FILE="$XDG_DATA_HOME/applications/sourceos-office.desktop" +BIN_FILE="$HOME/.local/bin/sourceos-office-open" + +[[ -f "$DESKTOP_FILE" ]] || { + echo "desktop entry install smoke failed: missing desktop file" >&2 + exit 1 +} + +[[ -x "$BIN_FILE" ]] || { + echo "desktop entry install smoke failed: missing launcher helper" >&2 + exit 1 +} + +echo "desktop entry install smoke passed" From e9351762dde6502b76a8350cca6ad3689c326783 Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Thu, 23 Apr 2026 20:36:32 -0400 Subject: [PATCH 4/9] build(source-os): add office MIME defaults install helper --- .../scripts/install_office_mime_defaults.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 build/office-suite/scripts/install_office_mime_defaults.sh diff --git a/build/office-suite/scripts/install_office_mime_defaults.sh b/build/office-suite/scripts/install_office_mime_defaults.sh new file mode 100644 index 0000000..dbe8623 --- /dev/null +++ b/build/office-suite/scripts/install_office_mime_defaults.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +MIME_SRC="$ROOT/configs/mime/sourceos-office-mimeapps.list" +CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" + +mkdir -p "$CONFIG_DIR" +cp "$MIME_SRC" "$CONFIG_DIR/mimeapps.list" + +echo "installed MIME defaults to $CONFIG_DIR/mimeapps.list" From 56bba6032dcfae8f3a8fc42d7800cd4d49ff19e2 Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Thu, 23 Apr 2026 20:37:28 -0400 Subject: [PATCH 5/9] build(source-os): add office MIME defaults install smoke helper --- .../scripts/mime_defaults_install_smoke.sh | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 build/office-suite/scripts/mime_defaults_install_smoke.sh diff --git a/build/office-suite/scripts/mime_defaults_install_smoke.sh b/build/office-suite/scripts/mime_defaults_install_smoke.sh new file mode 100644 index 0000000..494d60e --- /dev/null +++ b/build/office-suite/scripts/mime_defaults_install_smoke.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +TMPDIR="$(mktemp -d)" +trap 'rm -rf "$TMPDIR"' EXIT + +export XDG_CONFIG_HOME="$TMPDIR/config" + +"$ROOT/build/office-suite/scripts/install_office_mime_defaults.sh" >/dev/null + +TARGET="$XDG_CONFIG_HOME/mimeapps.list" +[[ -f "$TARGET" ]] || { + echo "mime defaults install smoke failed: missing mimeapps.list" >&2 + exit 1 +} + +grep -q "application/vnd.oasis.opendocument.text=libreoffice-writer.desktop" "$TARGET" || { + echo "mime defaults install smoke failed: missing writer association" >&2 + exit 1 +} + +echo "mime defaults install smoke passed" From f088246c01fd3a5db05d1e3f2c3f92ecebf3540e Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Thu, 23 Apr 2026 20:43:14 -0400 Subject: [PATCH 6/9] build(source-os): install office desktop entry and MIME defaults together --- build/office-suite/scripts/install_office_desktop_entry.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/office-suite/scripts/install_office_desktop_entry.sh b/build/office-suite/scripts/install_office_desktop_entry.sh index 0c2a822..2af03b1 100644 --- a/build/office-suite/scripts/install_office_desktop_entry.sh +++ b/build/office-suite/scripts/install_office_desktop_entry.sh @@ -12,5 +12,8 @@ cp "$DESKTOP_SRC" "$APP_DIR/sourceos-office.desktop" cp "$BIN_SRC" "$BIN_DIR/sourceos-office-open" chmod +x "$BIN_DIR/sourceos-office-open" +"$ROOT/build/office-suite/scripts/install_office_mime_defaults.sh" >/dev/null + echo "installed desktop entry to $APP_DIR/sourceos-office.desktop" echo "installed launcher helper to $BIN_DIR/sourceos-office-open" +echo "installed office MIME defaults" From 26d634e5058f9c8326169a9599f8ecbdcedd92d4 Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Thu, 23 Apr 2026 20:47:53 -0400 Subject: [PATCH 7/9] build(source-os): verify desktop entry install also installs MIME defaults --- .../scripts/desktop_entry_install_smoke.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build/office-suite/scripts/desktop_entry_install_smoke.sh b/build/office-suite/scripts/desktop_entry_install_smoke.sh index fb7c8f4..878f202 100644 --- a/build/office-suite/scripts/desktop_entry_install_smoke.sh +++ b/build/office-suite/scripts/desktop_entry_install_smoke.sh @@ -6,6 +6,7 @@ TMPDIR="$(mktemp -d)" trap 'rm -rf "$TMPDIR"' EXIT export XDG_DATA_HOME="$TMPDIR/share" +export XDG_CONFIG_HOME="$TMPDIR/config" export HOME="$TMPDIR/home" mkdir -p "$HOME" @@ -13,6 +14,7 @@ mkdir -p "$HOME" DESKTOP_FILE="$XDG_DATA_HOME/applications/sourceos-office.desktop" BIN_FILE="$HOME/.local/bin/sourceos-office-open" +MIME_FILE="$XDG_CONFIG_HOME/mimeapps.list" [[ -f "$DESKTOP_FILE" ]] || { echo "desktop entry install smoke failed: missing desktop file" >&2 @@ -24,4 +26,14 @@ BIN_FILE="$HOME/.local/bin/sourceos-office-open" exit 1 } +[[ -f "$MIME_FILE" ]] || { + echo "desktop entry install smoke failed: missing MIME defaults" >&2 + exit 1 +} + +grep -q "application/vnd.oasis.opendocument.text=libreoffice-writer.desktop" "$MIME_FILE" || { + echo "desktop entry install smoke failed: missing writer MIME association" >&2 + exit 1 +} + echo "desktop entry install smoke passed" From 70b6c1056e1bf5da8b7187e7fd61dc007fae04da Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Thu, 23 Apr 2026 20:55:04 -0400 Subject: [PATCH 8/9] build(source-os): validate installed desktop entry wiring --- build/office-suite/scripts/desktop_entry_install_smoke.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/office-suite/scripts/desktop_entry_install_smoke.sh b/build/office-suite/scripts/desktop_entry_install_smoke.sh index 878f202..1f11722 100644 --- a/build/office-suite/scripts/desktop_entry_install_smoke.sh +++ b/build/office-suite/scripts/desktop_entry_install_smoke.sh @@ -36,4 +36,9 @@ grep -q "application/vnd.oasis.opendocument.text=libreoffice-writer.desktop" "$M exit 1 } +grep -q "sourceos-office-open" "$DESKTOP_FILE" || { + echo "desktop entry install smoke failed: desktop entry does not reference launcher helper" >&2 + exit 1 +} + echo "desktop entry install smoke passed" From 7a3a6e3d56578ac74965cdda5c2eb0ba9416b57c Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Thu, 23 Apr 2026 20:58:29 -0400 Subject: [PATCH 9/9] build(source-os): add desktop entry verification helper --- .../scripts/verify_office_desktop_entry.sh | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 build/office-suite/scripts/verify_office_desktop_entry.sh diff --git a/build/office-suite/scripts/verify_office_desktop_entry.sh b/build/office-suite/scripts/verify_office_desktop_entry.sh new file mode 100644 index 0000000..8a1d177 --- /dev/null +++ b/build/office-suite/scripts/verify_office_desktop_entry.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +DESKTOP_FILE="$ROOT/build/office-suite/desktop/sourceos-office.desktop" +INSTALLER="$ROOT/build/office-suite/scripts/install_office_desktop_entry.sh" +MIME_INSTALLER="$ROOT/build/office-suite/scripts/install_office_mime_defaults.sh" + +[[ -f "$DESKTOP_FILE" ]] || { + echo "missing desktop entry source" >&2 + exit 1 +} + +[[ -x "$INSTALLER" ]] || { + echo "missing desktop entry installer" >&2 + exit 1 +} + +[[ -x "$MIME_INSTALLER" ]] || { + echo "missing MIME defaults installer" >&2 + exit 1 +} + +grep -q "sourceos-office-open" "$DESKTOP_FILE" || { + echo "desktop entry does not reference launcher helper" >&2 + exit 1 +} + +echo "office desktop entry verification passed"