由于ubuntu的电源管理有问题,导致笔记本风扇老转,又吵又耗电。搜了一通,发现安装jupiter可以解决。
我的系统是12.04,jupiter是0.1.9,不过有点小小的问题:
02 | Exception in thread Thread-4: |
03 | Traceback (most recent call last): |
04 | File "/usr/lib/python2.7/threading.py" , line 551, in __bootstrap_inner |
06 | File "/usr/lib/python2.7/threading.py" , line 504, in run |
07 | self.__target(*self.__args, **self.__kwargs) |
08 | File "/usr/bin/jupiter" , line 414, in update_screen_resolutions |
09 | res = self.jupiter.get_available_resolutions(display) |
10 | File "/usr/bin/jupiter" , line 181, in get_available_resolutions |
11 | return self.get_device( '/available_resolutions_' + args, 'resolutions' , 'modes ' + args). split ( ' ' ) |
12 | AttributeError: 'bool' object has no attribute 'split' |
14 | Exception in thread Thread-5: |
15 | Traceback (most recent call last): |
16 | File "/usr/lib/python2.7/threading.py" , line 551, in __bootstrap_inner |
18 | File "/usr/lib/python2.7/threading.py" , line 504, in run |
19 | self.__target(*self.__args, **self.__kwargs) |
20 | File "/usr/bin/jupiter" , line 380, in update_screen_orientations |
21 | rotation = self.jupiter.current_rotation(display) |
22 | File "/usr/bin/jupiter" , line 166, in current_rotation |
23 | return self.get_device( '/rotation_saved_' +args, 'rotate' , [ 'normal' ,args]). split ( ' ' )[0] |
24 | AttributeError: 'bool' object has no attribute 'split' |
再搜了一通误解过,只好调试了一通,发现176行的函数def get_displays(self)返回的值有问题,包含空的元素,然后
update_screen_resolutions、get_available_resolutions、current_rotation等函数就会出错
就把错误的函数:
2 | return self .get_device( '/displays' , 'vga-out' , 'mon' ).split( ' ' ) |
改成了:
2 | return filter ( None , self .get_device( '/displays' , 'vga-out' , 'mon' ).split( ' ' )) |
至于那个filter为什么可以去空元素,别问!还是搜索来的,其实我只是半个伸手党。具体自己看python文档,build-in函数里。
|