This commit is contained in:
parent
b0a0b353cc
commit
afd13c660e
3
.gitignore
vendored
3
.gitignore
vendored
@ -6,3 +6,6 @@ publish/
|
||||
riderModule.iml
|
||||
/_ReSharper.Caches/
|
||||
poetry.lock
|
||||
|
||||
# ImageMagick artifacts
|
||||
!_*
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
<ApplicationIcon>img\notepad-icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -12,6 +12,7 @@ ARCH="x86_64"
|
||||
PUBLISH_DIR="../publish/linux-x64"
|
||||
APPDIR="NotePad.AppDir"
|
||||
OUTPUT_DIR="../publish/appimage"
|
||||
ICON_SOURCE="img/notepad-icon.svg"
|
||||
|
||||
echo "============================================================"
|
||||
echo "Building AppImage for $APP_NAME v$VERSION"
|
||||
@ -47,15 +48,14 @@ Categories=Utility;TextEditor;
|
||||
Terminal=false
|
||||
EOF
|
||||
|
||||
# Create a simple icon (using text as placeholder - replace with actual icon)
|
||||
echo "Creating icon placeholder..."
|
||||
# This creates a simple SVG icon - you should replace with an actual icon
|
||||
cat > "$APPDIR/usr/share/icons/hicolor/256x256/apps/notepad.svg" << EOF
|
||||
<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="256" height="256" fill="#4a90e2"/>
|
||||
<text x="128" y="140" font-size="120" fill="white" text-anchor="middle" font-family="sans-serif">N</text>
|
||||
</svg>
|
||||
EOF
|
||||
# Copy application icon
|
||||
echo "Copying application icon..."
|
||||
if [ ! -f "$ICON_SOURCE" ]; then
|
||||
echo "❌ ERROR: Icon not found at $ICON_SOURCE"
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p "$APPDIR/usr/share/icons/hicolor/scalable/apps"
|
||||
cp "$ICON_SOURCE" "$APPDIR/usr/share/icons/hicolor/scalable/apps/notepad.svg"
|
||||
|
||||
# Create AppRun script
|
||||
echo "Creating AppRun script..."
|
||||
@ -71,7 +71,7 @@ chmod +x "$APPDIR/AppRun"
|
||||
|
||||
# Copy desktop file and icon to root of 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
|
||||
if ! command -v appimagetool &> /dev/null; then
|
||||
|
||||
BIN
NotePad/img/notepad-icon.ico
Normal file
BIN
NotePad/img/notepad-icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 294 KiB |
@ -8,6 +8,8 @@ APP_NAME="NotePad"
|
||||
INSTALL_DIR="/opt/notepad"
|
||||
BIN_LINK="/usr/local/bin/notepad"
|
||||
DESKTOP_FILE="/usr/share/applications/notepad.desktop"
|
||||
ICON_DIR="/usr/share/icons/hicolor/scalable/apps"
|
||||
ICON_FILE="$ICON_DIR/notepad.svg"
|
||||
|
||||
echo "============================================================"
|
||||
echo "$APP_NAME Installer"
|
||||
@ -41,6 +43,11 @@ chmod +x "$INSTALL_DIR/NotePad"
|
||||
echo "→ Creating symlink: $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
|
||||
echo "→ Creating desktop entry..."
|
||||
cat > "$DESKTOP_FILE" << EOF
|
||||
@ -48,13 +55,19 @@ cat > "$DESKTOP_FILE" << EOF
|
||||
Name=NotePad
|
||||
Comment=Simple text editor
|
||||
Exec=notepad %F
|
||||
Icon=text-editor
|
||||
Icon=notepad
|
||||
Type=Application
|
||||
Categories=Utility;TextEditor;
|
||||
Terminal=false
|
||||
MimeType=text/plain;
|
||||
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
|
||||
if command -v update-desktop-database &> /dev/null; then
|
||||
echo "→ Updating desktop database..."
|
||||
|
||||
Loading…
Reference in New Issue
Block a user