Commit c9401c18 authored by Grégor JOUET's avatar Grégor JOUET 🔧
Browse files

Update

parent a6118a55
......@@ -9,6 +9,7 @@
- name: Persist sleep mode stop
register: persist
become: true
tags: sleep
copy:
dest: /etc/profile.d/sleepmode.sh
mode: '0774'
......
---
- name: Setting new hostname
hostname: name={{ inventory_hostname }}
become: yes
tags: hostname
- name: Update /etc/hosts with hostname
become: yes
tags: hostname
lineinfile:
path: /etc/hosts
regexp: "127[.]0[.]0[.]1.*"
line: "127.0.0.1 localhost.localdomain localhost {{ inventory_hostname }}"
state: present
- include: disable_sleepmode.yml
- include: rotate_display.yml
- include: open_browser.yml
\ No newline at end of file
- include: open_browser.yml
- include: reset_idle.yml
\ No newline at end of file
---
- name: Create dir
tags: browser
file:
path: /home/pi/.config/lxsession/LXDE-pi
state: directory
......@@ -7,6 +8,7 @@
- name: Open dvic website on boot
register: appened
tags: browser
copy:
dest: /home/pi/.config/lxsession/LXDE-pi/autostart
mode: '0660'
......@@ -14,6 +16,7 @@
@chromium-browser --kiosk dvic.devinci.fr
- name: Restart
tags: browser
reboot:
when: appened is changed
become: true
---
- name: Install xprintidle
become: true
tags: idle
apt:
name: xprintidle
update_caches: true
update_cache: true
state: present
- name: Install reset script
become: true
tags: idle
copy:
dest: /usr/local/bin/reset_screen.sh
mode: '0775'
content: |
#!/bin/bash
idle=`DISLAY=:0 xprintidle`
idle=`DISPLAY=:0 xprintidle`
if [ $idle -ge 600000 ] && [ $idle -le 1200000 ]; then
pkill chromium-browser
DISPLAY=:0 chromium-browser --kiosk dvic.devinci.fr &
......@@ -21,9 +23,11 @@
- name: Set crontab for idle checking
become: true
tags: idle
cron:
name: "check idle time"
job: /usr/local/bin/reset_screen.sh
minute: "*/10"
user: pi
\ No newline at end of file
---
- name: Get default system target
tags: rotate
become: true
shell: systemctl get-default
register: default_target
- name: Set default target to graphical
tags: rotate
shell: systemctl set-default graphical.target
when: default_target.stdout != "graphical.target"
become: true
- name: Remove display border
tags: rotate
lineinfile:
path: /boot/config.txt
line: "disable_overscan=1"
......@@ -26,12 +29,14 @@
- name: Install xinput-calibrator
become: true
tags: rotate
apt:
name: xinput-calibrator
state: present
- name: Persist rotation and calibration
register: persist
tags: rotate
become: true
copy:
dest: /etc/profile.d/screen.sh
......@@ -42,6 +47,7 @@
DISPLAY=:0 xinput set-prop 6 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1
- name: Restart
tags: rotate
reboot:
when: (display_rotate is changed) or (persist is changed)
become: true
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment