{"id":153,"date":"2008-09-27T15:45:12","date_gmt":"2008-09-27T13:45:12","guid":{"rendered":"http:\/\/blog.cipworx.org\/martin\/?p=153"},"modified":"2008-09-27T15:46:43","modified_gmt":"2008-09-27T13:46:43","slug":"xautolock","status":"publish","type":"post","link":"https:\/\/blog.cipworx.org\/laserman\/2008\/09\/27\/xautolock\/","title":{"rendered":"xautolock"},"content":{"rendered":"<p>Um die Umwelt zu schonen und Energiekosten zu senken, ist es sinnvoll, wenn sich ungenutzte PC Arbeitspl\u00e4tze selbst ausschalten. Zu diesem Zweck habe ich das Programm <code>xautolock<\/code> gefunden. Ein normaler user darf aber nicht <code>poweroff, shutdown <\/code> oder <code>halt<\/code> ausf\u00fchren, daher habe ich es mit sudo kombiniert. Die <strong>$HOME\/.profile<\/strong> sieht jetzt so aus:<\/p>\n<p><code><br \/>\n#!\/bin\/bash<\/p>\n<p>\/usr\/bin\/xautolock -bell 100 -notify 120 -killtime 60 -killer \"sudo poweroff\" -time 60  -locker \"kdialog --msgbox 'This PC will turn itself off if you dont use it within the next 60 minutes' \"  &<\/p>\n<p><\/code><\/p>\n<p>und die <strong>\/etc\/sudoers<\/strong>:<\/p>\n<p><code><\/p>\n<p>Cmnd_Alias SYSTEM = \/sbin\/shutdown, \/sbin\/halt, \/sbin\/reboot, \/sbin\/poweroff<\/p>\n<p># Defaults (?)<br \/>\nDefaults        !lecture,tty_tickets,!fqdn<\/p>\n<p># User privilege specification<br \/>\nroot    ALL=(ALL) ALL<\/p>\n<p># ubuntu:<br \/>\n# Members of the admin group may gain root privileges<br \/>\n%admin ALL=(ALL) ALL<\/p>\n<p>gast ALL = NOPASSWD: SYSTEM<\/p>\n<p><\/code><\/p>\n<p>Dabei ist die richtige Reihenfolge der Zeilen wichtig, also erst die <strong>%admin<\/strong>-Zeile und dann die Zeile f\u00fcr den User <strong>gast<\/strong><\/p>\n<p>Bei einer kubuntu Version (feisty) funktioniert das, bei einer anderen nicht,<br \/>\nm\u00f6glicherweise wird <code>.profile<\/code> nicht ausgef\u00fchrt &#8211; ich muss das noch pr\u00fcfen.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Um die Umwelt zu schonen und Energiekosten zu senken, ist es sinnvoll, wenn sich ungenutzte PC Arbeitspl\u00e4tze selbst ausschalten. Zu diesem Zweck habe ich das Programm xautolock gefunden. Ein normaler user darf aber nicht poweroff, shutdown oder halt ausf\u00fchren, daher habe ich es mit sudo kombiniert. Die $HOME\/.profile sieht jetzt so aus: #!\/bin\/bash \/usr\/bin\/xautolock -bell [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,4,9],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-kubuntu","category-linux","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/blog.cipworx.org\/laserman\/wp-json\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cipworx.org\/laserman\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cipworx.org\/laserman\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cipworx.org\/laserman\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cipworx.org\/laserman\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":0,"href":"https:\/\/blog.cipworx.org\/laserman\/wp-json\/wp\/v2\/posts\/153\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.cipworx.org\/laserman\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cipworx.org\/laserman\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cipworx.org\/laserman\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}