Created
July 6, 2011 10:41
-
-
Save andycodes00/1066978 to your computer and use it in GitHub Desktop.
Replacing Jockey-text with a few short lines of simplified python
This file contains hidden or 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
#!/usr/bin/env python | |
import apt | |
import subprocess | |
#import fnctrl <-- filelock on modprobe blacklists... | |
#import XKit.xutils <-- xorg.conf file editing | |
driver = "nvidia-current" | |
xorg_conf_path = "/etc/X11/xorg.conf" | |
apt.apt_pkg.Config.Set('DPkg::options::','--force-confnew') | |
c = apt.Cache() | |
c[driver].markInstall() | |
c.commit() | |
#dunno if this is really required... | |
subprocess.call(['/sbin/modprobe', driver]) | |
#could possibly need to handle removing module name from blacklists | |
#in /etc/modprobe.d/* | |
#optional rebind. Primarily used for firmware driver updates. | |
## We can either try to edit the xorg.conf file ourselves... | |
#xorg_conf = XKit.xutils.XUtils(xorg_conf_path) | |
#org_conf.setDriver('Device', self.xorg_driver, device) | |
# or let nvidia do the hard work. | |
subprocess.call(['nvidia-xconfig']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment