def changeDisplays(interactive=True, targetDisplays=None, resolution=None, layout=None): ret = _changeDisplays(interactive, targetDisplays, resolution, layout) try: import background background.set_background() except: pass return ret
def changeDisplays(): from pluginmanager import Menu import background, display import subprocess profile = Menu(['internal', 'work', 'home', 'xrandr'], prompt='Display Profile:')() if profile == 'internal': #New nVidia with xrandr 1.2: subprocess.call('xrandr --output LVDS-0 --off --output DP-1 --mode 1600x1200 --output DP-2 --off'.split()) subprocess.call('xrandr --output LVDS-0 --mode 1600x900 --output DP-1 --off --output DP-2 --off'.split()) #Old nVidia with metamodes hack: # subprocess.call('xrandr -s 1600x900'.split()) #Nouveau (two steps to work around this can't find crtc for display LVDS-1 bug): # subprocess.call('xrandr --output DP-1 --off --output DP-2 --off --output DP-3 --off'.split()) # subprocess.call('xrandr --output LVDS-1 --mode 1600x900'.split()) background.set_background() subprocess.call('dispwin -I /home/ian/colorhug/results/w510/w510.icc'.split()) elif profile == 'work': #New nVidia with xrandr 1.2: subprocess.call('xrandr --output LVDS-0 --off --output DP-1 --mode 1600x1200 --output DP-2 --off'.split()) subprocess.call('xrandr --output LVDS-0 --off --output DP-1 --mode 1600x1200 --output DP-2 --mode 1600x1200 --right-of DP-1'.split()) #Old nVidia with metamodes hack: # subprocess.call('xrandr -s 3200x1200'.split()) #Nouveau (two steps to work around this can't find crtc for display x bug): # subprocess.call('xrandr --output LVDS-1 --off --output DP-1 --off'.split()) # subprocess.call('xrandr --output DP-2 --mode 1600x1200 --output DP-3 --mode 1600x1200 --right-of DP-2'.split()) background.set_background() # This now works with binary nVidia: subprocess.call('dispwin -d 2 -I /home/ian/colorhug/results/r_lut/thinkvision_r_lut.icc'.split()) subprocess.call('dispwin -d 1 -I /home/ian/colorhug/results/left/thinkvision_l.icc'.split()) elif profile == 'home': #Old nVidia with metamodes hack: #REMEMBER: Reconfigure meta-modes & associated DPYs first! # subprocess.call('xrandr -s 3520x1080'.split()) #Nouveau (untested,two steps to work around this can't find crtc for display x bug): subprocess.call('xrandr --output DP-2 --off --output DP-3 --off'.split()) subprocess.call('xrandr --output DP-1 --mode 1920x1080 --output LVDS-1 --mode 1600x900 --right-of DP-1'.split()) background.set_background() subprocess.call('dispwin -I /home/ian/colorhug/results/samsung/samsung.icc'.split()) elif profile == 'xrandr': display.changeDisplays() fix_tray()
import wacom import os, background from pygmi import * import mixer # PCM has no mute switch, Speaker has no volume... # Set headphone as the primary since it has both volume and mute, and slave PCM # and speaker so the volume can be adjusted everywhere. # # My sound card is a pretty new Creative CA0132 which has had some fixes in the # HDA driver recently and I would not be surprised if this changes again in the # next few kernel versions mixer.mixers = ['Headphone', 'PCM', 'Speaker'] background.set_background(os.path.expanduser('~/water-drop1.jpg')) keys.bind('main', ( "Alienware specific keys", ('Mod1-Control-x', "Re-apply X11 settings", lambda k: fixX11()), )) @notify_exception def fixX11(): notify("Applying X11 settings") _launch("setxkbmap -option terminate:ctrl_alt_bksp".split()) _launch("setxkbmap -option keypad:pointerkeys".split()) wacom.apply_profile('Wacom Intuos3 9x12 pad', 'gimp')