Commit 8bfc74d

bryfry <bryon@fryer.io>
2016-05-31 02:29:29
suspend autolock service
1 parent 91f90df
files/slock.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Lock X
+
+[Service]
+User=ubuntu
+Environment=DISPLAY=:0
+ExecStart=/usr/local/bin/slock
+
+[Install]
+WantedBy=sleep.target
files/xautolock.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Lock the screen automatically after a timeout.
+Requires=graphical.target
+After=graphical.target
+
+[Service]
+Type=simple
+User=ubuntu
+Environment=DISPLAY=:0
+ExecStart=/usr/bin/xautolock -time 10 -locker "systemctl suspend" -detectsleep
+
+[Install]
+WantedBy=graphical.target
tasks/systemd.yml
@@ -1,9 +1,34 @@
 ---
 # systemd.yml tasks
 
-- name: systemd - config logind
+- name: systemd - apt dependencies
+  apt: 
+    name: xautolock 
+    state: latest
+  become: yes 
+  tags: [systemd, xorg]
+
+- name: systemd - config files
   copy: 
-    src: files/logind.conf
-    dest: /etc/systemd/logind.conf
+    src: "{{ item.src }}"
+    dest: "{{ item.dest }}"
   become: yes
   tags: systemd
+  with_items:
+  - {src: "files/logind.conf", dest: "/etc/systemd/logind.conf"}
+  - {src: "files/slock.service", dest: "/etc/systemd/system/slock.service"}
+  - {src: "files/xautolock.service", dest: "/etc/systemd/system/xautolock.service"}
+
+- name: systemd - services
+  systemd:
+    name: "{{ item }}"
+    state: started
+    enabled: yes
+    daemon_reload: yes
+  become: yes
+  tags: systemd
+  with_items:
+  - slock
+  - xautolock
+
+  
tasks/xorg.yml
@@ -1,9 +1,10 @@
 ---
 # xorg.yml tasks
 
-- name: touchpad configuration
+- name: xorg - touchpad configuration
   copy: 
     src: files/50-synaptics.conf
     dest: /usr/share/X11/xorg.conf.d/
   become: yes
   tags: xorg
+
README.md
@@ -22,7 +22,10 @@ An ansible playbook for setting up Ubuntu 16.04 (server + dwm) on a Dell Chromeb
   - [x] power button sensitivity
   - [ ] dwm statusbar
   - [ ] screen recording
-  - [ ] dwm lock screen
+  - [x] dwm lock screen
+  - [ ] improve boot speed (ext4)
+  - [ ] fix hw errors at initial login
+  - [ ] zmem
 
 ## TODO maybe