Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:howtos-tips [2011/12/27 04:09]
cyril [Lock on wake up]
linux:howtos-tips [2014/03/28 16:18] (current)
cyril
Line 427: Line 427:
 Ensure that the file misc.start is executable. Ensure that the file misc.start is executable.
  
 +===== Fix laptop wakes up immediately after suspend =====
 +
 +May be due to some USB devices, even if not plugged. Look if some USB* or EHC* or XHC* are enabled in ''/proc/acpi/wakeup'', and disable them:<code>
 +echo EHC1 > /proc/acpi/wakeup
 +</code>
 +
 +You can run it in a script at boot time right before suspending:<code>
 +for usb in "EHC1" "EHC2" "XHC"; do
 +        state=`cat /proc/acpi/wakeup | grep $usb | cut -f3 | cut -d' ' -f1 | tr -d '*'`
 +        echo "device = $usb, state = $state"
 +        if [ "$state" == "enabled" ]; then echo $usb > /proc/acpi/wakeup; fi
 +done
 +</code>
 ===== Keep screen off when lid shut ===== ===== Keep screen off when lid shut =====
  
Line 500: Line 513:
 A more complete one to automatically detect the user name is available here: A more complete one to automatically detect the user name is available here:
 [[https://wiki.archlinux.org/index.php/Pm-utils#Locking_the_screen_saver_on_hibernate_or_suspend]] [[https://wiki.archlinux.org/index.php/Pm-utils#Locking_the_screen_saver_on_hibernate_or_suspend]]
 +
 +
 +== With systemd ==
 +
 +Create service ''/usr/lib/systemd/system/slimlock.service'':<code>
 +[Unit]
 +Description=Lock X session using slimlock
 +
 +[Service]
 +User=cyril
 +ExecStart=/usr/bin/slimlock
 +
 +[Install]
 +WantedBy=sleep.target
 +</code>
 +
 +Ensure right permissions and enable it:<code>
 +chmod a+r /usr/lib/systemd/system/slimlock.service
 +systemctl enable slimlock
 +</code>
 +
 +Now when you suspend the system with ''systemctl suspend'' the screen will be locked.
 +
  
 ===== Hard Drive power management ===== ===== Hard Drive power management =====
Line 528: Line 564:
 +gvalue = gclient.get('/desktop/gnome/session/idle_delay') +gvalue = gclient.get('/desktop/gnome/session/idle_delay')
 </code> </code>
 +
 +===== Automatically enable/disable second screen =====
 +
 +disper -s
 +disper -e
 +
 +autodisper
 +
 +for completely automatic with dock:
 +http://askubuntu.com/questions/42741/how-to-automatically-switch-monitors-with-my-laptop-dock/48627#48627
linux/howtos-tips.1324958974.txt.gz ยท Last modified: 2013/09/19 16:42 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0