#!/bin/bash SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) if [ -z "$HOME" ]; then echo "HOME variable not set. Aborting..." exit 1 fi EXECUTABLE="${SCRIPT_DIR}/freezer" ICON="${SCRIPT_DIR}/data/flutter_assets/assets/icon.ico" if [ ! -x "$EXECUTABLE" ] || [ ! -f "$ICON" ]; then echo "Icon or executable not found. Aborting..." exit 1 fi APPLICATIONS_DIR="$HOME/.local/share/applications" if [ ! -w "$APPLICATIONS_DIR" ]; then echo "Cannot write to $APPLICATIONS_DIR. Aborting..." exit 1 fi cat < "$APPLICATIONS_DIR/freezer.desktop"