In this lesson, explain to Linux users a great way to extinguish the laptop screen and one Bzgueth
Do you use a Linux system on your computer, then you're right, because Linux will keep you on your personal computer's battery life more than other systems, and that the nature of the system architecture Is looking for more energy saving? Not looking away our way to this and this lesson will guide you step by step how to create a program or, so to say, Script small does not need you any experience, because this script is just the design of the button closure on the display light on your computer mobile phone, and this lesson experimenter even Edition Ubuntu 11.10 beta 2 ...
Step One: Download and Installation Requirements
The first need is to install Python libraries Python library do not think it's very difficult not only Ba-click on the following link and allow the Director of the installation everything works
After installation and then close the download manager continued the next step.
The second step to prepare the script:
It's very simple and we'll show step photos Ba
Right click and select "Create New Document -> Empty Document" create an empty file is simply as in the picture
Now and then rename the file to monitor_off.sh, now open the file, which it opened, and copy the following code to the file:
#!/usr/bin/python
import time
import subprocess
from Xlib import X
from Xlib.display import Display
display = Display(‘:0′)
root = display.screen().root
root.grab_pointer(True,
X.ButtonPressMask | X.ButtonReleaseMask | X.PointerMotionMask,
X.GrabModeAsync, X.GrabModeAsync, 0, 0, X.CurrentTime)
root.grab_keyboard(True,
X.GrabModeAsync, X.GrabModeAsync, X.CurrentTime)
subprocess.call(‘xset dpms force off’.split())
p = subprocess.Popen(‘gnome-screensaver-command -i’.split())
time.sleep(1)
while True:
print display.next_event()
p.terminate()
break
Then save the file.
Then right click on the file and select Properties, as in the following image:
Then to the tab "Permissions" and then select the property is very important to make a program or script opens without restrictions Admin " Root " and then shut down:
The third step: is to create a shortcut to the program - script -
If you are using the interface Unity Ubuntu Click on the icon in the top to search for installed programs and type the word "Keyboard" clavier, or if you use French, and then open this application, which helps you to identify the acronyms do not you just added:
Go now to the tab "Shortcuts", or a shortcut, or "Raccourcis" according to the language used, then "Custom Shortcuts" for the amendment to the thumbnail and then click on the "+" button in the band's Ba name, type, for example "Monitor Off" is the name of the script, which we prepared, and then in the range of your lower Ba path just paste the file path, which we prepared and then Apply, for example, the ratio I Ba I / home / Os-bever / monitor_off.sh
To specify the path to avoid the mistakes right click on the file and then Properties.
Not anymore, we will define the key to control application example, we choose Ba F10 on the keyboard and how to do it after work he will show us Apply Ba application page and his right to the word "New shortcut" Click it and then F10 or any button you want. As shown in the following image:
Now, we have identified key F10 to control the former Ba script, which works to extinguish the screen and not the computer as a reminder that this example, we hear an audio clip and do not need the screen and do not want to consume energy. Or any reason deemed appropriate for that :-)
Now, we have identified key F10 to control the former Ba script, which works to extinguish the screen and not the computer as a reminder that this example, we hear an audio clip and do not need the screen and do not want to consume energy. Or any reason deemed appropriate for that....
Drop Your Comments And Questions Below.
No comments:
Post a Comment