File indexing completed on 2024-11-10 04:05:17

0001 #!/bin/bash
0002 
0003 # Add a link to the real home directory of the user
0004 REALHOME=$(getent passwd $UID | cut -d ':' -f 6)
0005 home_dirname=$(basename "$REALHOME")
0006 SNAP_USER_DATA="$REALHOME/snap/krita/current"
0007 [[ -e  "$SNAP_USER_DATA/.shortcut-links" ]] || mkdir -p "$SNAP_USER_DATA/.shortcut-links"
0008 
0009 # Add a link to removable media
0010 if [[ ! -e "$SNAP_USER_DATA/.shortcut-links/removable-media" ]]; then
0011   if [[ -e "/media/$USER" ]]; then
0012     ln -s "/media/$USER" "$SNAP_USER_DATA/.shortcut-links/removable-media"
0013   elif [[ -e "/run/media/$USER" ]]; then
0014     ln -s "/run/media/$USER" "$SNAP_USER_DATA/.shortcut-links/removable-media"
0015   fi
0016 fi
0017 
0018 # Add a link to mtp devices such as smartphones
0019 [[ -e  "$SNAP_USER_DATA/.shortcut-links/removable-devices" ]] || ln -s "/run/user/$UID/gvfs/" "$SNAP_USER_DATA/.shortcut-links/removable-devices"
0020 
0021 qtctl ensure-shortcuts "$REALHOME" "$(xdg-user-dir PICTURES)" "$SNAP_USER_DATA/.shortcut-links/removable-media" "$SNAP_USER_DATA/.shortcut-links/removable-devices" "/mnt"
0022 
0023 exec "$@"