{"id":123,"date":"2005-12-23T08:00:54","date_gmt":"2005-12-23T07:00:54","guid":{"rendered":"http:\/\/coding.mu\/archives\/2005\/12\/23\/switching-off-the-backlight-on-dell-latitude-c810-laptop\/"},"modified":"2022-04-17T00:09:13","modified_gmt":"2022-04-16T23:09:13","slug":"minimise-power-consumption-on-a-laptop-computer-running-linux","status":"publish","type":"post","link":"https:\/\/priscimon.net\/coding\/2005\/12\/23\/minimise-power-consumption-on-a-laptop-computer-running-linux\/","title":{"rendered":"How to switch off a screen laptop under Linux"},"content":{"rendered":"<p>In this post, I describe how to write a shell script that switches off a laptop screen. The instructions are tested with Ubuntu Linux 5.10 (Breezy) on a Dell Latitude C810.<\/p>\n<p>First, set the governor for the CPU frequency with the following command.<\/p>\n<pre>echo powersave &gt; \/sys\/devices\/system\/cpu\/cpu0\/cpufreq\/scaling_governor<\/pre>\n<p>This command can be run automatically at run-level 2 by putting it in <code>\/etc\/rc2.d\/S30freq-scaling<\/code>.<\/p>\n<p>Out of the box Breezy is configured to manage power, but we need additional configuration for some laptops.<\/p>\n<p>First, on the C810 the kernel needs the <code>acpi_irq_balance<\/code> option in order to report certain ACPI events (for example, closing the lid). We fix this by adding the kernel option <code>acpi_irq_balance<\/code> in GRUB&#8217;s <code>menu.lst<\/code>.<\/p>\n<pre>title           Ubuntu, kernel 2.6.12-9-686 \nroot            (hd0,0)\nkernel          \/boot\/vmlinuz-2.6.12-9-686 root=\/dev\/hda1 acpi_irq_balance ro quiet splash resume=\/dev\/hda5\ninitrd          \/boot\/initrd.img-2.6.12-9-686\nsavedefault\nboot<\/pre>\n<p>Second, it seems that the command <code>xset dpms force off<\/code> does not switch off the screen. Instead, we must use the command\u00c2\u00a0<code>vbetool<\/code> to do this. Although it is reported to cause unexpected behaviour, it works with the C810.<\/p>\n<p>After configuring the kernel as describe above, we can write the script <code>\/etc\/acpi\/screen.sh<\/code> to turn on and to turn off the laptop screen.<\/p>\n<pre>#!\/bin\/sh\n\ncase \"$1\" in\n        on)\n                \/usr\/sbin\/vbetool dpms on\n                ;;\n        off)\n                \/usr\/sbin\/vbetool dpms off\n                ;;\n        *)\n                N=\/etc\/acpi\/screen.sh\n                echo \"Usage: $N {on|off}\"\n                ;;\n\nesac<\/pre>\n<p>The script takes as argument <code>on<\/code> or <code>off<\/code>, as in the example below.<\/p>\n<pre>\/etc\/acpi\/screen.sh off<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this post, I describe how to write a shell script that switches off a laptop screen. The instructions are tested with Ubuntu Linux 5.10 (Breezy) on a Dell Latitude C810. First, set the governor for the CPU frequency with the following command. echo powersave &gt; \/sys\/devices\/system\/cpu\/cpu0\/cpufreq\/scaling_governor This command can be run automatically at run-level [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-123","post","type-post","status-publish","format-standard","hentry","category-general"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3I4g9-1Z","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/priscimon.net\/coding\/wp-json\/wp\/v2\/posts\/123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/priscimon.net\/coding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/priscimon.net\/coding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/priscimon.net\/coding\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/priscimon.net\/coding\/wp-json\/wp\/v2\/comments?post=123"}],"version-history":[{"count":7,"href":"https:\/\/priscimon.net\/coding\/wp-json\/wp\/v2\/posts\/123\/revisions"}],"predecessor-version":[{"id":1663,"href":"https:\/\/priscimon.net\/coding\/wp-json\/wp\/v2\/posts\/123\/revisions\/1663"}],"wp:attachment":[{"href":"https:\/\/priscimon.net\/coding\/wp-json\/wp\/v2\/media?parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/priscimon.net\/coding\/wp-json\/wp\/v2\/categories?post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/priscimon.net\/coding\/wp-json\/wp\/v2\/tags?post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}