add an application icon
All checks were successful
Release / release (push) Successful in 1m19s

This commit is contained in:
Greg Gauthier 2026-02-14 22:08:38 +00:00
parent b0a0b353cc
commit afd13c660e
5 changed files with 28 additions and 11 deletions

3
.gitignore vendored
View File

@ -6,3 +6,6 @@ publish/
riderModule.iml riderModule.iml
/_ReSharper.Caches/ /_ReSharper.Caches/
poetry.lock poetry.lock
# ImageMagick artifacts
!_*

View File

@ -5,6 +5,7 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault> <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<ApplicationIcon>img\notepad-icon.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -12,6 +12,7 @@ ARCH="x86_64"
PUBLISH_DIR="../publish/linux-x64" PUBLISH_DIR="../publish/linux-x64"
APPDIR="NotePad.AppDir" APPDIR="NotePad.AppDir"
OUTPUT_DIR="../publish/appimage" OUTPUT_DIR="../publish/appimage"
ICON_SOURCE="img/notepad-icon.svg"
echo "============================================================" echo "============================================================"
echo "Building AppImage for $APP_NAME v$VERSION" echo "Building AppImage for $APP_NAME v$VERSION"
@ -47,15 +48,14 @@ Categories=Utility;TextEditor;
Terminal=false Terminal=false
EOF EOF
# Create a simple icon (using text as placeholder - replace with actual icon) # Copy application icon
echo "Creating icon placeholder..." echo "Copying application icon..."
# This creates a simple SVG icon - you should replace with an actual icon if [ ! -f "$ICON_SOURCE" ]; then
cat > "$APPDIR/usr/share/icons/hicolor/256x256/apps/notepad.svg" << EOF echo "❌ ERROR: Icon not found at $ICON_SOURCE"
<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg"> exit 1
<rect width="256" height="256" fill="#4a90e2"/> fi
<text x="128" y="140" font-size="120" fill="white" text-anchor="middle" font-family="sans-serif">N</text> mkdir -p "$APPDIR/usr/share/icons/hicolor/scalable/apps"
</svg> cp "$ICON_SOURCE" "$APPDIR/usr/share/icons/hicolor/scalable/apps/notepad.svg"
EOF
# Create AppRun script # Create AppRun script
echo "Creating AppRun script..." echo "Creating AppRun script..."
@ -71,7 +71,7 @@ chmod +x "$APPDIR/AppRun"
# Copy desktop file and icon to root of AppDir # Copy desktop file and icon to root of AppDir
cp "$APPDIR/usr/share/applications/notepad.desktop" "$APPDIR/" cp "$APPDIR/usr/share/applications/notepad.desktop" "$APPDIR/"
cp "$APPDIR/usr/share/icons/hicolor/256x256/apps/notepad.svg" "$APPDIR/notepad.svg" cp "$APPDIR/usr/share/icons/hicolor/scalable/apps/notepad.svg" "$APPDIR/notepad.svg"
# Check for appimagetool # Check for appimagetool
if ! command -v appimagetool &> /dev/null; then if ! command -v appimagetool &> /dev/null; then

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

View File

@ -8,6 +8,8 @@ APP_NAME="NotePad"
INSTALL_DIR="/opt/notepad" INSTALL_DIR="/opt/notepad"
BIN_LINK="/usr/local/bin/notepad" BIN_LINK="/usr/local/bin/notepad"
DESKTOP_FILE="/usr/share/applications/notepad.desktop" DESKTOP_FILE="/usr/share/applications/notepad.desktop"
ICON_DIR="/usr/share/icons/hicolor/scalable/apps"
ICON_FILE="$ICON_DIR/notepad.svg"
echo "============================================================" echo "============================================================"
echo "$APP_NAME Installer" echo "$APP_NAME Installer"
@ -41,6 +43,11 @@ chmod +x "$INSTALL_DIR/NotePad"
echo "→ Creating symlink: $BIN_LINK" echo "→ Creating symlink: $BIN_LINK"
ln -sf "$INSTALL_DIR/NotePad" "$BIN_LINK" ln -sf "$INSTALL_DIR/NotePad" "$BIN_LINK"
# Install icon
echo "→ Installing application icon..."
mkdir -p "$ICON_DIR"
cp "$SCRIPT_DIR/img/notepad-icon.svg" "$ICON_FILE"
# Create desktop entry # Create desktop entry
echo "→ Creating desktop entry..." echo "→ Creating desktop entry..."
cat > "$DESKTOP_FILE" << EOF cat > "$DESKTOP_FILE" << EOF
@ -48,13 +55,19 @@ cat > "$DESKTOP_FILE" << EOF
Name=NotePad Name=NotePad
Comment=Simple text editor Comment=Simple text editor
Exec=notepad %F Exec=notepad %F
Icon=text-editor Icon=notepad
Type=Application Type=Application
Categories=Utility;TextEditor; Categories=Utility;TextEditor;
Terminal=false Terminal=false
MimeType=text/plain; MimeType=text/plain;
EOF EOF
# Update icon cache if available
if command -v gtk-update-icon-cache &> /dev/null; then
echo "→ Updating icon cache..."
gtk-update-icon-cache -f -t /usr/share/icons/hicolor 2>/dev/null || true
fi
# Update desktop database if available # Update desktop database if available
if command -v update-desktop-database &> /dev/null; then if command -v update-desktop-database &> /dev/null; then
echo "→ Updating desktop database..." echo "→ Updating desktop database..."