Skip to content

Instantly share code, notes, and snippets.

@anoother
Created April 2, 2017 15:07
Show Gist options
  • Save anoother/411c6c76b2c743e9683a3a56544b5997 to your computer and use it in GitHub Desktop.
Save anoother/411c6c76b2c743e9683a3a56544b5997 to your computer and use it in GitHub Desktop.
Automatically enable Freesync on Linux
#!/bin/bash
## Enable freesync - put this in eg. your .xsession
## http://support.amd.com/en-us/kb-articles/Pages/HOW-TO-ENABLE-AMD-FREESYNC-IN-LINUX.aspx
set -u
xrandr --prop | while read line; do
if echo "$line" | grep ' connected' > /dev/null; then
monitor=$(echo $line | awk '{print $1}')
else
if echo "$line" | grep 'freesync_capable: 1' > /dev/null; then
echo "Enabling freesync on $monitor"
xrandr --output $monitor --set "freesync" 1
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment