First version, copied from Raspberry Display

This commit is contained in:
Jorge Enrique Gómez Gómez 2022-10-10 17:30:26 -05:00
parent d478449580
commit 6a5d51defd
9 changed files with 256 additions and 0 deletions

1
hosts Normal file
View File

@ -0,0 +1 @@
localhost ansible_connection=local

8
local.yml Normal file
View File

@ -0,0 +1,8 @@
---
- hosts: localhost
gather_facts: yes
user: root
roles:
- attendance

View File

@ -0,0 +1 @@
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor

View 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>

View File

@ -0,0 +1,4 @@
[Service]
ExecStart=
ExecStart=-/sbin/agetty --noissue --autologin auto --noclear %I $TERM

View 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

View 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

View 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 }}'

View 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/'