Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Toggle prime on gnome
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
You can’t perform that action at this time.