First version, copied from Raspberry Display
This commit is contained in:
parent
d478449580
commit
6a5d51defd
8
local.yml
Normal file
8
local.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
- hosts: localhost
|
||||
gather_facts: yes
|
||||
user: root
|
||||
roles:
|
||||
- attendance
|
||||
|
||||
1
roles/attendance/files/bash_profile
Normal file
1
roles/attendance/files/bash_profile
Normal file
@ -0,0 +1 @@
|
||||
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor
|
||||
133
roles/attendance/files/openbox_rc
Normal file
133
roles/attendance/files/openbox_rc
Normal file
@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<openbox_config xmlns="http://openbox.org/3.4/rc"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<resistance>
|
||||
<strength>10</strength>
|
||||
<screen_edge_strength>20</screen_edge_strength>
|
||||
</resistance>
|
||||
|
||||
<focus>
|
||||
<focusNew>yes</focusNew>
|
||||
<followMouse>no</followMouse>
|
||||
<focusLast>yes</focusLast>
|
||||
<underMouse>no</underMouse>
|
||||
<focusDelay>200</focusDelay>
|
||||
<raiseOnFocus>no</raiseOnFocus>
|
||||
</focus>
|
||||
|
||||
<placement>
|
||||
<policy>Smart</policy>
|
||||
<center>yes</center>
|
||||
<monitor>Primary</monitor>
|
||||
<primaryMonitor>1</primaryMonitor>
|
||||
</placement>
|
||||
|
||||
<theme>
|
||||
<name>Clearlooks</name>
|
||||
<titleLayout>NLIMC</titleLayout>
|
||||
<keepBorder>yes</keepBorder>
|
||||
<animateIconify>yes</animateIconify>
|
||||
<font place="ActiveWindow">
|
||||
<name>sans</name>
|
||||
<size>8</size>
|
||||
<weight>bold</weight>
|
||||
<slant>normal</slant>
|
||||
</font>
|
||||
<font place="InactiveWindow">
|
||||
<name>sans</name>
|
||||
<size>8</size>
|
||||
<weight>bold</weight>
|
||||
<slant>normal</slant>
|
||||
</font>
|
||||
<font place="MenuHeader">
|
||||
<name>sans</name>
|
||||
<size>9</size>
|
||||
<weight>normal</weight>
|
||||
<slant>normal</slant>
|
||||
</font>
|
||||
<font place="MenuItem">
|
||||
<name>sans</name>
|
||||
<size>9</size>
|
||||
<weight>normal</weight>
|
||||
<slant>normal</slant>
|
||||
</font>
|
||||
<font place="ActiveOnScreenDisplay">
|
||||
<name>sans</name>
|
||||
<size>9</size>
|
||||
<weight>bold</weight>
|
||||
<slant>normal</slant>
|
||||
</font>
|
||||
<font place="InactiveOnScreenDisplay">
|
||||
<name>sans</name>
|
||||
<size>9</size>
|
||||
<weight>bold</weight>
|
||||
<slant>normal</slant>
|
||||
</font>
|
||||
</theme>
|
||||
|
||||
<desktops>
|
||||
<number>1</number>
|
||||
<firstdesk>1</firstdesk>
|
||||
<names>
|
||||
</names>
|
||||
<popupTime>0</popupTime>
|
||||
</desktops>
|
||||
|
||||
<resize>
|
||||
<drawContents>yes</drawContents>
|
||||
<popupShow>Nonpixel</popupShow>
|
||||
<popupPosition>Center</popupPosition>
|
||||
<popupFixedPosition>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
</popupFixedPosition>
|
||||
</resize>
|
||||
|
||||
<margins>
|
||||
<top>0</top>
|
||||
<bottom>0</bottom>
|
||||
<left>0</left>
|
||||
<right>0</right>
|
||||
</margins>
|
||||
|
||||
<keyboard>
|
||||
<chainQuitKey>C-g</chainQuitKey>
|
||||
|
||||
<!-- Keybindings for desktop switching -->
|
||||
<keybind key="W-d">
|
||||
<action name="ToggleShowDesktop"/>
|
||||
</keybind>
|
||||
|
||||
<!-- Keybindings for window switching -->
|
||||
<keybind key="A-Tab">
|
||||
<action name="NextWindow">
|
||||
<finalactions>
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="Unshade"/>
|
||||
</finalactions>
|
||||
</action>
|
||||
</keybind>
|
||||
|
||||
</keyboard>
|
||||
|
||||
<menu>
|
||||
<!-- default menu file (or custom one in $HOME/.config/openbox/) -->
|
||||
<!-- system menu files on Debian systems -->
|
||||
<file>/var/lib/openbox/debian-menu.xml</file>
|
||||
<file>menu.xml</file>
|
||||
<hideDelay>200</hideDelay>
|
||||
<middle>no</middle>
|
||||
<submenuShowDelay>100</submenuShowDelay>
|
||||
<submenuHideDelay>400</submenuHideDelay>
|
||||
<showIcons>yes</showIcons>
|
||||
<manageDesktops>yes</manageDesktops>
|
||||
</menu>
|
||||
|
||||
<applications>
|
||||
</applications>
|
||||
|
||||
</openbox_config>
|
||||
|
||||
4
roles/attendance/files/tty_unit
Normal file
4
roles/attendance/files/tty_unit
Normal file
@ -0,0 +1,4 @@
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty --noissue --autologin auto --noclear %I $TERM
|
||||
|
||||
56
roles/attendance/tasks/autologin_auto_user.yml
Normal file
56
roles/attendance/tasks/autologin_auto_user.yml
Normal file
@ -0,0 +1,56 @@
|
||||
---
|
||||
|
||||
- name: Setup silent login for user auto
|
||||
file:
|
||||
path: /home/auto/.hushlogin
|
||||
state: touch
|
||||
mode: 0644
|
||||
owner: auto
|
||||
|
||||
- name: Create openbox config dir
|
||||
file:
|
||||
path: /home/auto/.config/openbox
|
||||
state: directory
|
||||
owner: auto
|
||||
mode: 0755
|
||||
|
||||
- name: Setup openbox autostart for user auto
|
||||
template:
|
||||
src: autostart.j2
|
||||
dest: /home/auto/.config/openbox/autostart
|
||||
mode: 0644
|
||||
owner: auto
|
||||
|
||||
- name: Configure Openbox
|
||||
copy:
|
||||
src: openbox_rc
|
||||
dest: /home/auto/.config/openbox/rc.xml
|
||||
owner: auto
|
||||
|
||||
- name: Start graphical screen when user logs in
|
||||
copy:
|
||||
src: bash_profile
|
||||
dest: /home/auto/.bash_profile
|
||||
mode: 0644
|
||||
owner: auto
|
||||
|
||||
- name: Create autostart config dir
|
||||
file:
|
||||
path: /etc/systemd/system/getty@tty1.service.d
|
||||
state: directory
|
||||
owner: root
|
||||
mode: 0755
|
||||
|
||||
- name: Login user auto when system starts
|
||||
copy:
|
||||
src: tty_unit
|
||||
dest: /etc/systemd/system/getty@tty1.service.d/override.conf
|
||||
mode: 0644
|
||||
owner: root
|
||||
|
||||
- name: Restart the login service
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
name: getty@tty1
|
||||
state: restarted
|
||||
|
||||
20
roles/attendance/tasks/main.yml
Normal file
20
roles/attendance/tasks/main.yml
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
|
||||
- name: Install required packages
|
||||
apt:
|
||||
update_cache: yes
|
||||
pkg: '{{ required_packages }}'
|
||||
|
||||
- name: Create the auto user
|
||||
user:
|
||||
name: auto
|
||||
uid: 1001
|
||||
home: /home/auto
|
||||
group: users
|
||||
groups:
|
||||
- video
|
||||
shell: /usr/bin/bash
|
||||
password: '!'
|
||||
|
||||
- import_tasks: autologin_auto_user.yml
|
||||
|
||||
19
roles/attendance/templates/autostart.j2
Normal file
19
roles/attendance/templates/autostart.j2
Normal file
@ -0,0 +1,19 @@
|
||||
# Disable any form of screen saver / screen blanking / power management
|
||||
xset s off
|
||||
xset s noblank
|
||||
xset -dpms
|
||||
|
||||
# Allow quitting the X server with CTRL-ATL-Backspace
|
||||
setxkbmap -option terminate:ctrl_alt_bksp
|
||||
|
||||
# Start Chromium in kiosk mode
|
||||
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' \
|
||||
~/snap/chromium/common/chromium/Local\ State
|
||||
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' \
|
||||
~/snap/chromium/common/chromium/Default/Preferences
|
||||
|
||||
chromium-browser --disable-infobars --noerrdialogs \
|
||||
--disable-session-crashed-bubble --disable-component-update \
|
||||
--overscroll-history-navigation=0 --disable-features=Translate \
|
||||
--kiosk '{{ kiosk_url }}'
|
||||
|
||||
14
roles/attendance/vars/main.yml
Normal file
14
roles/attendance/vars/main.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
|
||||
required_packages:
|
||||
- xserver-xorg
|
||||
- xserver-xorg-video-fbdev
|
||||
- x11-xserver-utils
|
||||
- xinit
|
||||
- xdotool
|
||||
- openbox
|
||||
- nitrogen
|
||||
- chromium-browser
|
||||
|
||||
kiosk_url: 'https://attendance.agofer.net/'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user