{"id":1641,"date":"2016-02-28T21:51:39","date_gmt":"2016-02-29T05:51:39","guid":{"rendered":"http:\/\/systemsolver.com\/StatlerBlog\/?p=1641"},"modified":"2016-02-28T21:51:39","modified_gmt":"2016-02-29T05:51:39","slug":"asus-laptop-lighted-keyboard-start-on-linux","status":"publish","type":"post","link":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/2016\/02\/28\/asus-laptop-lighted-keyboard-start-on-linux\/","title":{"rendered":"ASUS laptop lighted keyboard start on linux and woofer setup"},"content":{"rendered":"<p>First, to get the sub-woofer to work use the following, but it is a very poor solution so I didn&#8217;t implement it in the final laptop setup:<\/p>\n<p><a href=\"http:\/\/ubuntuforums.org\/showthread.php?t=2217683\">http:\/\/ubuntuforums.org\/showthread.php?t=2217683<\/a><\/p>\n<p>I want the lighted keyboard on an ASUS laptop to start at level 1 everytime it boots or resumes\/thaws from sleep\/hibernate. This worked<\/p>\n<p>I created a conf file in \/etc\/init<\/p>\n<p>Open directory as administrator<\/p>\n<p style=\"padding-left: 30px;\"><code>\/etc\/init<\/code><\/p>\n<p>Create file<\/p>\n<p style=\"padding-left: 30px;\"><code>a.keylights_restart.conf<\/code><\/p>\n<p>Inside that document paste:<\/p>\n<p style=\"padding-left: 30px;\"><code>description \"start keyboard lights\"<br \/>\nauthor \"john statler\"<\/code><\/p>\n<p style=\"padding-left: 30px;\">start on [2345]<\/p>\n<p style=\"padding-left: 30px;\">respawn<\/p>\n<p style=\"padding-left: 30px;\">scrip<\/p>\n<p style=\"padding-left: 30px;\">su &#8211; tech -c &#8220;\/sys\/class\/leds\/asus::kbd_backlight\/brightness&#8221;<\/p>\n<p style=\"padding-left: 30px;\">end script<\/p>\n<p>Save and reboot. &lt;su\u00a0 &#8211; tech&gt; tells the system to run the command as a super user.<\/p>\n<p>=== more complex but also works ===<\/p>\n<p>add the command into<code> \/etc\/rc.local<\/code><\/p>\n<p>or, for an individual user, into\u00a0\u00a0 *home*folder\/.bash_profile (I didn&#8217;t have one of these so I skipped it)<\/p>\n<p>or in cron<\/p>\n<p><code>bash -c <\/code><code>echo 1 &gt; \/sys\/class\/leds\/asus::kbd_backlight\/brightness<\/code><code> <\/code><\/p>\n<p>BUT &#8212; that wasn&#8217;t all, in order to get this to run as per user (the previous command didn&#8217;t pass after user log-in)<\/p>\n<p>This will set the &#8230;backlight\/brightness file so it can be written to without super user privileges.<\/p>\n<p class=\"code\"><code>sudo visudo<\/code><\/p>\n<p class=\"code\">at the end of the file type:<\/p>\n<p><code>ALL ALL = (ALL) NOPASSWD: \/usr\/bin\/tee \/sys\/class\/leds\/asus\\:\\:kbd_backlight\/brightness<\/code><\/p>\n<p>reboot to have it take effect<\/p>\n<p>now, to test the script you can run the following from a command line. You can change the 1 to a 3 for instance.<\/p>\n<p><code>echo 1 | sudo \/usr\/bin\/tee \/sys\/class\/leds\/asus::kbd_backlight\/brightness<\/code><\/p>\n<p>I had to actually create a script file and run that from Menu\/Startup Applications<br \/>\nCreate file \/home\/your_user_name\/<br \/>\nCreate a new text file<\/p>\n<p style=\"padding-left: 30px;\"><code>#!\/bin\/bash<br \/>\n#<br \/>\n# set keyboard lights to level 1<br \/>\n#<br \/>\necho 1 &gt; \/sys\/class\/leds\/asus::kbd_backlight\/brightness<\/code><\/p>\n<p>save as keyboard_lights.sh<br \/>\nRight-click on new file, select properties\/permissions and allow execution<\/p>\n<p>Now put the following line into Menu\/Startup Applications under some name like key_lights<\/p>\n<p><code>bash -c \"exec \/home\/your_user_name\/keyboard_lights.sh\"<\/code><\/p>\n<p>==== the following failed to work but here&#8217;s the notes====<\/p>\n<p>That works except for resuming from hibernation or sleep.\u00a0 To get that create 11_keyboard_lights_pm and put in in \/etc\/pm\/sleep.d (the 11 makes sure it runs among the last of the scripts)<\/p>\n<p><code>#!\/bin\/bash<\/code><\/p>\n<p><code>case \"$1\" in<br \/>\nthaw|resume)<br \/>\necho 3 | sudo \/usr\/bin\/tee \"\/sys\/class\/leds\/asus::kbd_backlight\/brightness\"<br \/>\nesac<\/code><\/p>\n<p>====\u00a0\u00a0 ====<\/p>\n<p>if you want to see the command show in a terminal (I might have gotten something wrong) (I honeslty don&#8217;t know why this is here)<\/p>\n<p><code>mate-terminal bash -c \"echo 1 | sudo \/usr\/bin\/tee '\/sys\/class\/leds\/asus::kbd_backlight\/brightness'; bash\"<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>First, to get the sub-woofer to work use the following, but it is a very poor solution so I didn&#8217;t implement it in the final laptop setup: http:\/\/ubuntuforums.org\/showthread.php?t=2217683 I want the lighted keyboard on an ASUS laptop to start at level 1 everytime it boots or resumes\/thaws from sleep\/hibernate. This worked I created a conf [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1641","post","type-post","status-publish","format-standard","hentry","category-general"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/posts\/1641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/comments?post=1641"}],"version-history":[{"count":0,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/posts\/1641\/revisions"}],"wp:attachment":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/media?parent=1641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/categories?post=1641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/tags?post=1641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}