Skip to content

Instantly share code, notes, and snippets.

@miraculixx
Last active September 26, 2023 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miraculixx/4cfb26cad33943f90742ad98b4ce9f87 to your computer and use it in GitHub Desktop.
Save miraculixx/4cfb26cad33943f90742ad98b4ce9f87 to your computer and use it in GitHub Desktop.
fix barrier issue on suspend/resume on linux mint
#!/bin/bash
# run this from /usr/lib/systemd/system-sleep/pre-suspend.sh
# adopted from https://www.addictivetips.com/ubuntu-linux-tips/run-scripts-and-commands-on-suspend-and-resume-on-linux/
USER=$(ls /home | grep -v root | tail -n1)
if [ "${1}" == "pre" ]; then
killall barrier barrierc
elif [ "${1}" == "post" ]; then
# need to run in background to ensure other post resume processing happens first
sudo su - $USER -c "nohup bash -c 'sleep 10; env DISPLAY=:0 /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=barrier com.github.debauchee.barrier' &"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment