Skip to content

Instantly share code, notes, and snippets.

@thimslugga
Forked from anoother/.xsession
Created September 14, 2018 17:11
Show Gist options
  • Save thimslugga/d25f18d9841dbb87de4d95ac3c772fa6 to your computer and use it in GitHub Desktop.
Save thimslugga/d25f18d9841dbb87de4d95ac3c772fa6 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