Last active
August 13, 2017 10:16
-
-
Save nielsvanvelzen/2a10c45aebdc7a192533529dc6da99f4 to your computer and use it in GitHub Desktop.
Toggle prime on gnome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CURRENT_DRIVER=$(prime-select query) | |
NEW_DRIVER="intel" | |
if [ "$CURRENT_DRIVER" = "intel" ]; then | |
NEW_DRIVER="nvidia" | |
fi | |
pkexec prime-select "$NEW_DRIVER" > /dev/null | |
echo "Switched from $CURRENT_DRIVER to $NEW_DRIVER" | |
notify-send "GPU switched" "Switched to $NEW_DRIVER from $CURRENT_DRIVER" --icon=video-display | |
sync | |
gnome-session-quit --logout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment