blob: 4582f3042477138b93a0dcf840174322c2dbd489 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/bash
# Define the paths
TARGET_PATH="/usr/bin/joplin-desktop"
EXPECTED_LINK_TARGET="/opt/appimages/Joplin.AppImage"
# Check if the target path is a symlink
if [ -L "$TARGET_PATH" ] && [ "$(readlink "$TARGET_PATH")" = "$EXPECTED_LINK_TARGET" ]; then
echo "$TARGET_PATH is a symbolic link to $EXPECTED_LINK_TARGET. Proceeding with replacement."
# Remove the existing symlink
rm "$TARGET_PATH"
# Create a new script to replace the symlink
echo "#!/bin/bash" > "$TARGET_PATH"
echo "exec $EXPECTED_LINK_TARGET --enable-features=UseOzonePlatform --ozone-platform=wayland \"\$@\"" >> "$TARGET_PATH"
# Make the new script executable
chmod +x "$TARGET_PATH"
else
echo "$TARGET_PATH is not a symbolic link to $EXPECTED_LINK_TARGET. No action taken."
fi
|