Skip to content

Instantly share code, notes, and snippets.

@meoso
Last active December 3, 2020 17:45
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meoso/a5d337f4427bacf44a82c3e979201bb9 to your computer and use it in GitHub Desktop.
Save meoso/a5d337f4427bacf44a82c3e979201bb9 to your computer and use it in GitHub Desktop.
Shotcut launcher bash script
#!/bin/bash
#assumes new downloads of shotcut is always in ~/Downloads
currpath=$(pwd)
cd ~/Downloads
chmod +x ./[Ss]hotcut-*.AppImage
#always choose the latest Shotcut-*.AppImage download
shotcut=$(ls -Art [Ss]hotcut-*.AppImage | tail -n 1 | cut -d' ' -f 9-)
cd "${currpath}"
#QT fixes for Window-Size problem and Font/Menu Size problem
export "QT_AUTO_SCREEN_SCALE_FACTOR=0" #Disable auto scaling entirely
export "QT_SCREEN_SCALE_FACTORS=1;1;1;1" #Specify scale factor of 1 for all FOUR monitors
export "QT_SCALE_FACTOR=1" #Set monitor-independent scale factor to 1
#launch and log
timestamp=$(date +"%Y%m%d_%H%M%S")
consolefile="/home/${USER}/.local/share/Meltytech/Shotcut/${timestamp}-shotcut-console.log"
crashfile="/home/${USER}/.local/share/Meltytech/Shotcut/${timestamp}-shotcut-crash.log"
echo "console log will be: ${consolefile}"
echo "crash log will be: ${crashfile}"
if [ $# -eq 1 ] ; then
openfile=$(readlink -f "$(dirname "${1}")")/$(basename "${1}")
else
openfile=""
fi
echo "${openfile}"
~/Downloads/${shotcut} "${openfile}" 2>&1 | tee "${consolefile}" "${crashfile}"
# protect privacy by replacing username
sed -i "s/${USER}/USERNAME/g" "${consolefile}"
if [ -f ${crashfile} ]; then
sed -i "s/${USER}/USERNAME/g" "${crashfile}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment