Prime-ng is a project mainly written in Shell, it's free.
Optimus Support for Linux Through VirtualGL
#
#
The prime-ng project has been renamed to bumblebee and is available here:
https://github.com/MrMEEE/bumblebee
Status updates can be found here: http://www.martin-juhl.dk or on twitter http://twitter.com/martinjuhl