How bauca/graphics-switcher works
Project type and purpose
• This is an open-source CLI tool (a single Bash script named “Graphics-Switcher”) whose sole mission is to detect and switch between NVIDIA and Intel GPUs on Ubuntu 16.04, and to apply a screen-tearing fix when using the Intel driver.
File structure
• Top-level entries are all documentation and one executable script:
• Graphics-Switcher (the Bash script)
• README.md, CONTRIBUTING.md, CodeOfConduct.md, IssueTemplate.md, LICENSE
• No subdirectories or backend/frontend split—this is a self-contained shell utility.
README for additional insights
• Key dependencies: Ubuntu 16.04, NVIDIA proprietary driver (375.66), mesa-utils (provides glxinfo), optionally prime-select
• Workflow: the user invokes the script; it queries the active GPU; it switches the driver; if Intel is selected, it also applies a tear-fix.
Detailed breakdown
• Layer 1 (User Layer): “CLI Prompt” → calls → “Graphics-Switcher”
• Layer 2 (Script Layer): script’s internal phases:
• Detect → Switch → Fix
• Layer 3 (Utility Layer): glxinfo, prime-select
• Layer 4 (OS Layer):
• GPU Drivers (NVIDIA, Intel)
• X Server / Display Manager