unify build, fix opening files when app is running
This commit is contained in:
78
packaging/linux/install.sh
Executable file
78
packaging/linux/install.sh
Executable file
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
# Install rlogg and create file association for .log files
|
||||
# This script installs to user-local directories (~/.local/) and does not require sudo
|
||||
|
||||
set -e
|
||||
|
||||
echo "Installing RLogg Log Viewer..."
|
||||
echo ""
|
||||
|
||||
# Determine the directory where this script is located
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# Check if rlogg binary exists
|
||||
if [ ! -f "$SCRIPT_DIR/../../target/release/rlogg" ]; then
|
||||
echo "Error: rlogg binary not found at $SCRIPT_DIR/../../target/release/rlogg"
|
||||
echo "Please build the project first with: cargo build --release"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# User-local installation (no sudo required)
|
||||
echo "Installing binary to ~/.local/bin/..."
|
||||
mkdir -p ~/.local/bin
|
||||
cp "$SCRIPT_DIR/../../target/release/rlogg" ~/.local/bin/
|
||||
chmod +x ~/.local/bin/rlogg
|
||||
|
||||
# Install desktop file with correct path
|
||||
echo "Installing desktop file..."
|
||||
mkdir -p ~/.local/share/applications
|
||||
|
||||
# Create desktop file with absolute path to the binary
|
||||
cat > ~/.local/share/applications/rlogg.desktop <<EOF
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=RLogg
|
||||
GenericName=Log Viewer
|
||||
Comment=Fast log file viewer with search, filtering, and highlighting
|
||||
Exec=$HOME/.local/bin/rlogg %F
|
||||
Icon=rlogg
|
||||
Terminal=false
|
||||
Categories=Development;Utility;
|
||||
MimeType=text/x-log;
|
||||
Keywords=log;viewer;search;filter;
|
||||
EOF
|
||||
|
||||
# Update MIME database
|
||||
echo "Installing MIME type definition..."
|
||||
mkdir -p ~/.local/share/mime/packages
|
||||
cp "$SCRIPT_DIR/text-x-log.xml" ~/.local/share/mime/packages/
|
||||
|
||||
# Update desktop and MIME databases
|
||||
echo "Updating databases..."
|
||||
if command -v update-desktop-database &> /dev/null; then
|
||||
update-desktop-database ~/.local/share/applications 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if command -v update-mime-database &> /dev/null; then
|
||||
update-mime-database ~/.local/share/mime 2>/dev/null || true
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Installation complete!"
|
||||
echo ""
|
||||
echo "RLogg has been installed to: ~/.local/bin/rlogg"
|
||||
echo ""
|
||||
echo "IMPORTANT: Make sure ~/.local/bin is in your PATH."
|
||||
echo "Add this line to your ~/.bashrc or ~/.zshrc if it's not already there:"
|
||||
echo ' export PATH="$HOME/.local/bin:$PATH"'
|
||||
echo ""
|
||||
echo "File associations have been configured for .log files."
|
||||
echo "You may need to log out and log back in for file associations to take effect."
|
||||
echo ""
|
||||
echo "To uninstall, run:"
|
||||
echo " rm ~/.local/bin/rlogg"
|
||||
echo " rm ~/.local/share/applications/rlogg.desktop"
|
||||
echo " rm ~/.local/share/mime/packages/text-x-log.xml"
|
||||
echo " update-desktop-database ~/.local/share/applications"
|
||||
echo " update-mime-database ~/.local/share/mime"
|
||||
14
packaging/linux/rlogg.desktop
Normal file
14
packaging/linux/rlogg.desktop
Normal file
@@ -0,0 +1,14 @@
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=RLogg
|
||||
GenericName=Log Viewer
|
||||
Comment=Fast log file viewer with search, filtering, and highlighting
|
||||
# NOTE: Use absolute path for Exec to work in GUI file managers
|
||||
# The install.sh script will automatically set this to $HOME/.local/bin/rlogg
|
||||
Exec=/usr/local/bin/rlogg %F
|
||||
Icon=rlogg
|
||||
Terminal=false
|
||||
Categories=Development;Utility;
|
||||
MimeType=text/x-log;
|
||||
Keywords=log;viewer;search;filter;
|
||||
7
packaging/linux/text-x-log.xml
Normal file
7
packaging/linux/text-x-log.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||
<mime-type type="text/x-log">
|
||||
<comment>Log file</comment>
|
||||
<glob pattern="*.log"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
Reference in New Issue
Block a user