Give the app an icon, and a script that installs it
The launcher pointed at `Icon=story-editor`, a name that only the Breeze theme happened to ship, and only at 16 and 22 px -- so anywhere the desktop wanted a larger icon it fell back to something generic. assets/md-manuscript.svg is the source: a sheaf of manuscript pages, an amber chapter-title line over three of prose. Drawn in plain rounded rectangles because a finer design silts up into a grey smear at 16 px. It is rasterised to the eight sizes a desktop asks for, and the 256px PNG is compiled into the binary as the window icon, so the title bar and the task switcher carry it whether or not anything is installed. That costs no new dependency: eframe already pulls `image` with png decoding. A test decodes the bundled PNG, since a rename would otherwise show up only as a blank icon at runtime. Installation is now `./assets/install.sh` -- binary, icons, launcher and both cache refreshes, safe to re-run after a rebuild. The launcher is a file in the repository rather than a here-document in the instructions: pasting one into a terminal leaves the shell sat at a `>` prompt waiting for a terminator that never arrives, which is exactly what happened, and this way the launcher is versioned along with everything else. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GYSGPDwkSzhm4qLqjCbqxU
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 710 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
@@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
|
||||
<title>md-manuscript</title>
|
||||
<!-- App tile: ink -->
|
||||
<rect width="64" height="64" rx="13" fill="#22304a"/>
|
||||
<!-- A sheaf of pages: the sheet behind peeks out above and to the right -->
|
||||
<rect x="19" y="9" width="30" height="40" rx="2.5" fill="#c9c1b0"/>
|
||||
<rect x="14" y="14" width="30" height="40" rx="2.5" fill="#f6f1e6"/>
|
||||
<!-- The chapter title, then prose. Few lines, widely spaced: at 16px a
|
||||
denser block of them silts up into an illegible grey smear. -->
|
||||
<rect x="19" y="21" width="16" height="3.4" rx="1.7" fill="#c8763c"/>
|
||||
<rect x="19" y="30" width="20" height="3" rx="1.5" fill="#3f5578"/>
|
||||
<rect x="19" y="37" width="20" height="3" rx="1.5" fill="#3f5578"/>
|
||||
<rect x="19" y="44" width="12" height="3" rx="1.5" fill="#3f5578"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 850 B |
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
# Install md-manuscript for the current user: the binary, the icon set and the
|
||||
# desktop launcher. Safe to re-run; it overwrites what it installed last time.
|
||||
#
|
||||
# Everything lands under ~/.local, so no root is needed. Set PREFIX to install
|
||||
# somewhere else (PREFIX=/usr/local sudo ./assets/install.sh).
|
||||
set -eu
|
||||
|
||||
# Resolve paths against the repo, not the working directory, so this runs from
|
||||
# anywhere.
|
||||
here=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
prefix=${PREFIX:-$HOME/.local}
|
||||
binary=$here/target/release/md-manuscript
|
||||
|
||||
if [ ! -x "$binary" ]; then
|
||||
echo "No release binary at $binary" >&2
|
||||
echo "Build it first: cargo build --release" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
install -Dm755 "$binary" "$prefix/bin/md-manuscript"
|
||||
|
||||
for size in 16 22 24 32 48 64 128 256; do
|
||||
install -Dm644 \
|
||||
"$here/assets/icons/hicolor/${size}x${size}/apps/md-manuscript.png" \
|
||||
"$prefix/share/icons/hicolor/${size}x${size}/apps/md-manuscript.png"
|
||||
done
|
||||
install -Dm644 "$here/assets/icons/hicolor/scalable/apps/md-manuscript.svg" \
|
||||
"$prefix/share/icons/hicolor/scalable/apps/md-manuscript.svg"
|
||||
|
||||
install -Dm644 "$here/assets/md-manuscript.desktop" \
|
||||
"$prefix/share/applications/md-manuscript.desktop"
|
||||
|
||||
# Best-effort cache refreshes: the launcher works without them, it may just take
|
||||
# a re-login to show up.
|
||||
gtk-update-icon-cache -f -t "$prefix/share/icons/hicolor" 2>/dev/null || true
|
||||
update-desktop-database "$prefix/share/applications" 2>/dev/null || true
|
||||
|
||||
echo "Installed to $prefix"
|
||||
case ":$PATH:" in
|
||||
*":$prefix/bin:"*) ;;
|
||||
*) echo "Note: $prefix/bin is not on your PATH." >&2 ;;
|
||||
esac
|
||||
@@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=md-manuscript
|
||||
Comment=Draggable markdown manuscript editor with git sync and ODT export
|
||||
Exec=md-manuscript
|
||||
Icon=md-manuscript
|
||||
StartupWMClass=md-manuscript
|
||||
Categories=Office;TextEditor;
|
||||
Terminal=false
|
||||
@@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
|
||||
<title>md-manuscript</title>
|
||||
<!-- App tile: ink -->
|
||||
<rect width="64" height="64" rx="13" fill="#22304a"/>
|
||||
<!-- A sheaf of pages: the sheet behind peeks out above and to the right -->
|
||||
<rect x="19" y="9" width="30" height="40" rx="2.5" fill="#c9c1b0"/>
|
||||
<rect x="14" y="14" width="30" height="40" rx="2.5" fill="#f6f1e6"/>
|
||||
<!-- The chapter title, then prose. Few lines, widely spaced: at 16px a
|
||||
denser block of them silts up into an illegible grey smear. -->
|
||||
<rect x="19" y="21" width="16" height="3.4" rx="1.7" fill="#c8763c"/>
|
||||
<rect x="19" y="30" width="20" height="3" rx="1.5" fill="#3f5578"/>
|
||||
<rect x="19" y="37" width="20" height="3" rx="1.5" fill="#3f5578"/>
|
||||
<rect x="19" y="44" width="12" height="3" rx="1.5" fill="#3f5578"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 850 B |