Disper can be found at http://launchpad.net/disper.
As far as I know this is the only command line utility which can handle the TwinView settings for Nvidia cards.
import gobject
import gtk
import appindicator
import commands
def single(w):
commands.getstatusoutput('disper -s')
def extend(w):
commands.getstatusoutput('disper -e')
def clone(w):
commands.getstatusoutput('disper -c')
def add_menu_item(name, action):
menu_item = gtk.MenuItem(name)
menu.append(menu_item)
menu_item.connect("activate", action)
menu_item.show()
if __name__ == "__main__":
ind = appindicator.Indicator ("disper-indicator",
"gsd-xrandr",
appindicator.CATEGORY_HARDWARE)
ind.set_status (appindicator.STATUS_ACTIVE)
menu = gtk.Menu()
add_menu_item('Single', single)
add_menu_item('Extend', extend)
add_menu_item('Clone', clone)
ind.set_menu(menu)
gtk.main()
2 comments:
Alexander, this is useful stuff, I know nothing about Python, but I had no need to kown it, and in fact, I will modify it for a new mode, "Secondary only" (disper -S) and to clone monitor on a fixed resolution (disper -c -r 1024x768).
Good stuff, I can get the icon to show up in the menu bar after I run it with python, but would you be kind enough to have a tutorial on how to make this start up automatically on reboots? Thanks!
Post a Comment