add xorg autoconfiguration, install some config files for vdr, update nfs- and avahi configuration

This commit is contained in:
Alexander Grothe 2017-07-08 13:37:35 +02:00
parent 87600748ee
commit 2a4dc82e21
28 changed files with 2134 additions and 74 deletions

1124
Manual.org

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,6 @@
# this is the standard text to put in templates
ansible_managed_file: "*** YAVDR: ANSIBLE MANAGED FILE ***"
branch: unstable
ppa_owner: 'ppa:yavdr'
# a list of all package repositories to be added to the installation
@ -13,7 +12,6 @@ repositories:
- '{{ ppa_owner }}/{{branch}}-vdr'
- '{{ ppa_owner }}/{{branch}}-yavdr'
- '{{ ppa_owner }}/{{branch}}-kodi'
# properties of the user vdr and vdr-related options
vdr:
user: vdr
@ -21,6 +19,7 @@ vdr:
uid: 666
gid: 666
home: /var/lib/vdr
confdir: /var/lib/vdr
recdir: /srv/vdr/video
hide_first_recording_level: false
safe_dirnames: true # escape characters (useful for windows clients and FAT/NTFS file systems)
@ -32,7 +31,6 @@ vdr_plugins:
- vdr-plugin-markad
- vdr-plugin-restfulapi
- vdr-plugin-softhddevice
# dictionary of directories for (shared) files. Automatically exported via NFS and Samba if those roles are enabled
media_dirs:
audio: /srv/audio
@ -41,21 +39,17 @@ media_dirs:
files: /srv/files
backups: /srv/backups
recordings: '{{ vdr.recdir }}'
nfs:
insecure: false # set to true for OS X clients or if you plan to use libnfs as unprivileged user (e.g. KODI)
samba:
workgroup: YAVDR
windows_compatible: '{{ vdr.safe_dirnames }}' # set to true to disable unix extensions, enable follow symlinks and wide links
# additional packages you want to install
extra_packages:
- vim
- tree
- w-scan
- bpython3
#system:
# shutdown: poweroff
grub:

View File

@ -1,4 +1,3 @@
- name: Restart Samba
systemd:
name: smbd.service

View File

@ -1,5 +1,4 @@
#!/bin/bash
if (( $EUID != 0 )); then
echo "This script must be run using sudo or as root"
exit

View File

@ -1,5 +1,4 @@
#!/usr/bin/env/python
# This Module collects the vendor- and device ids for USB- and PCI(e)-devices and currently loaded kernel modules.
DOCUMENTATION = '''
---

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python2
DOCUMENTATION = '''
---
module: hardware_facts

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python2
from __future__ import print_function
import ast
import binascii
import csv
import re
import subprocess
from collections import namedtuple
@ -23,11 +23,6 @@ options:
default: ":0"
description:
- the DISPLAY variable to use when calling xrandr
multi_display:
required: False
default: "False"
description:
- check additional screens (:0.0 .. :0.n) until xrandr fails to collect information
preferred_outpus:
required: False
default: ["HDMI", "DP", "DVI", "VGA", "TV": 0]
@ -60,7 +55,6 @@ EXAMPLES = '''
ARG_SPECS = {
'display': dict(default=":0", type='str', required=False),
'multi_display': dict(default=False, type='bool', required=False),
'preferred_outputs': dict(
default=["HDMI", "DP", "DVI", "VGA", "TV"], type='list', required=False),
'preferred_refreshrates': dict(
@ -174,6 +168,45 @@ def parse_xrandr_verbose(iterator):
break
return xorg
def parse_edid_data(edid):
vendor = "Unknown"
model = "Unknown"
data = subprocess.check_output("parse-edid < {}".format(edid), shell=True, universal_newlines=True)
for line in data.splitlines():
if "VendorName" in line:
vendor = line.strip().split('"')[1]
if "ModelName" in line:
model = line.strip().split('"')[1]
return vendor, model
def collect_nvidia_data():
BusID_RE = re.compile((
'(?P<domain>[0-9a-fA-F]+)'
':'
'(?P<bus>[0-9a-fA-F]+)'
':'
'(?P<device>[0-9a-fA-F]+)'
'\.'
'(?P<function>[0-9a-fA-F]+)'
))
try:
data = subprocess.check_output(["nvidia-smi", "--query-gpu=name,pci.bus_id", "--format=csv", "-i0"],
universal_newlines=True)
except subprocess.CalledProcessError:
pass
else:
for row in csv.DictReader(data.splitlines(), delimiter=',', skipinitialspace=True):
name = row['name']
bus_id = row['pci.bus_id']
# pci.bus_id structure as reported by nvidia-smi: "domain:bus:device.function", in hex.
match = BusID_RE.search(bus_id)
if match:
domain, bus, device, function = (int(n, 16) for n in match.groups())
bus_id = "PCI:{:d}@{:d}:{:d}:{:d}".format(bus, domain, device, function)
return name, bus_id
raise ValueError
def output_data(data, write_edids=True):
if data:
modes = []
@ -186,11 +219,40 @@ def output_data(data, write_edids=True):
for refreshrate in refreshrates:
modes.append(Mode(connector, resolution, refreshrate))
if modes:
best_mode = max(modes, key=sort_mode)
data['best_tv_mode'] = best_mode
result = {}
try:
gpu_name, bus_id = collect_nvidia_data()
except ValueError:
gpu_name = None
bus_id = None
def create_entry(my_dict, name, connector, resolution, refreshrate, vendor, model):
my_dict[name] = {
'connector': connector,
'resolution': resolution,
'refreshrate': refreshrate,
'edid': '/etc/X11/edid.{}.bin'.format(connector),
'mode': "{}_{}".format(resolution, refreshrate),
'vendor': vendor,
'model': model,
}
if gpu_name and bus_id:
result[name]['gpu_name'] = gpu_name
result[name]['bus_id'] = bus_id
connector_0, resolution_0, refreshrate_0 = max(modes, key=sort_mode)[:3]
vendor_0, model_0 = parse_edid_data('/etc/X11/edid.{}.bin'.format(connector_0))
create_entry(result, 'primary', connector_0, resolution_0, refreshrate_0, vendor_0, model_0)
# check if additional monitors exist
other_modes = [mode for mode in modes if mode[0] != connector_0]
if other_modes:
connector_1, resolution_1, refreshrate_1 = max(other_modes, key=sort_mode)[:3]
vendor_1, model_1 = parse_edid_data('/etc/X11/edid.{}.bin'.format(connector_1))
create_entry(result, 'secondary', connector_1, resolution_1, refreshrate_1, vendor_1, model_1)
#print(json.dumps(data, sort_keys=True, indent=4))
module.exit_json(changed=True if write_edids else False, ansible_facts={'xrandr': data})
module.exit_json(changed=True if write_edids else False, ansible_facts={'xrandr': data, 'xorg': result})
if __name__ == '__main__':
module = AnsibleModule(argument_spec=ARG_SPECS, supports_check_mode=False,)

View File

@ -0,0 +1,60 @@
<lircmap>
<remote device="linux-input-layer">
<altname>cx23885_remote</altname>
<altname>devinput</altname>
<up>KEY_UP</up>
<down>KEY_DOWN</down>
<menu>KEY_MENU</menu>
<select>KEY_OK</select>
<back>KEY_ESC</back>
<left>KEY_LEFT</left>
<right>KEY_RIGHT</right>
<red>KEY_RED</red>
<green>KEY_GREEN</green>
<yellow>KEY_YELLOW</yellow>
<blue>KEY_BLUE</blue>
<zero>KEY_0</zero>
<one>KEY_1</one>
<two>KEY_2</two>
<three>KEY_3</three>
<four>KEY_4</four>
<five>KEY_5</five>
<six>KEY_6</six>
<seven>KEY_7</seven>
<eight>KEY_8</eight>
<nine>KEY_9</nine>
<info>KEY_INFO</info>
<play>KEY_PLAY</play>
<play>KEY_PLAYPAUSE</play>
<pause>KEY_PAUSE</pause>
<stop>KEY_STOP</stop>
<record>KEY_RECORD</record>
<forward>KEY_FASTFORWARD</forward>
<reverse>KEY_REWIND</reverse>
<skipplus>KEY_NEXT</skipplus>
<skipminus>KEY_BACK</skipminus>
<power>KEY_POWER2</power>
<channelplus>KEY_CHANNELUP</channelplus>
<channelminus>KEY_CHANNELDOWN</channelminus>
<title>KEY_PROG3</title>
<volumeplus>KEY_VOLUMEUP</volumeplus>
<volumeminus>KEY_VOLUMEDOWN</volumeminus>
<teletext>KEY_TEXT</teletext>
<mute>KEY_MUTE</mute>
<start>KEY_SELECT</start>
<subtitle>KEY_SUBTITLE</subtitle>
<audio>KEY_MODE</audio>
<mute>KEY_MUTE</mute>
<myvideo>KEY_VIDEO</myvideo>
<mymusic>KEY_AUDIO</mymusic>
<mypictures>KEY_IMAGES</mypictures>
<recordedtv>KEY_PVR</recordedtv>
<guide>KEY_EPG</guide>
<display>KEY_SCREEN</display>
<enter>KEY_PROG4</enter>
<playlist>KEY_ZOOM</playlist>
<livetv>KEY_CHANNEL</livetv>
<mytv>KEY_TV</mytv>
<liveradio>KEY_FN</liveradio>
</remote>
</lircmap>

View File

@ -0,0 +1,539 @@
<!-- This file contains the mapping of keys (gamepad, remote, and keyboard) to actions within XBMC -->
<!-- The <global> section is a fall through - they will only be used if the button is not -->
<!-- used in the current window's section. Note that there is only handling -->
<!-- for a single action per button at this stage. -->
<!-- For joystick/gamepad configuration under linux/win32, see below as it differs from xbox -->
<!-- gamepads. -->
<!-- The format is: -->
<!-- <device> -->
<!-- <button>action</button> -->
<!-- </device> -->
<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
<!-- <universalremote> -->
<!-- <obc45>Stop</obc45> -->
<!-- </universalremote> -->
<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
<!-- Joysticks / Gamepads: -->
<!-- See the sample PS3 controller configuration below for the format. -->
<!-- -->
<!-- Joystick Name: -->
<!-- Do 'cat /proc/bus/input/devices' or see your xbmc log file to find the names of -->
<!-- detected joysticks. The name used in the configuration should match the detected name. -->
<!-- -->
<!-- Button Ids: -->
<!-- 'id' is the button ID used by SDL. Joystick button ids of connected joysticks appear -->
<!-- in xbmc.log when they are pressed. Use your log to map custom buttons to actions. -->
<!-- -->
<!-- Axis Ids / Analog Controls -->
<!-- Coming soon. -->
<keymap>
<global>
<universalremote>
<obc150>XBMC.ejecttray()</obc150>
<obc151>Playlist</obc151>
</universalremote>
<remote>
<play>PlayPause</play>
<pause>Pause</pause>
<stop>Stop</stop>
<forward>FastForward</forward>
<reverse>Rewind</reverse>
<left>Left</left>
<right>Right</right>
<up>Up</up>
<down>Down</down>
<select>Select</select>
<pageplus>PageUp</pageplus>
<pageminus>PageDown</pageminus>
<back>ParentDir</back>
<menu>PreviousMenu</menu>
<title>ContextMenu</title>
<info>Info</info>
<skipplus>SkipNext</skipplus>
<skipminus>SkipPrevious</skipminus>
<display>FullScreen</display>
<start>PreviousMenu</start>
<record>Screenshot</record>
<volumeplus>VolumeUp</volumeplus>
<volumeminus>VolumeDown</volumeminus>
<mute>Mute</mute>
<power>XBMC.Quit()</power>
<myvideo>XBMC.ActivateWindow(MyVideos)</myvideo>
<mymusic>XBMC.ActivateWindow(MyMusic)</mymusic>
<mypictures>XBMC.ActivateWindow(MyPictures)</mypictures>
<!--- <mytv>XBMC.ActivateWindow(Home)</mytv> -->
<recordedtv>XBMC.ActivateWindowAndFocus(MyPVR, 34,0, 13,0)</recordedtv>
<!-- PVR: EPG -->
<guide>XBMC.ActivateWindowAndFocus(MyPVR, 31,0, 10,0)</guide>
<!-- PVR: Channellist -->
<livetv>XBMC.ActivateWindowAndFocus(MyPVR, 32,0, 11,0)</livetv>
<!-- PVR: Radio -->
<liveradio>XBMC.ActivateWindowAndFocus(MyPVR, 33,0, 12,0)</liveradio>
<red>XBMC.ActivateWindow(Home)</red>
<yellow>XBMC.ActivateWindow(MyVideos)</yellow>
<green>XBMC.ActivateWindow(MyMusic)</green>
<!-- <blue>XBMC.ActivateWindow(MyPictures)</blue> -->
<zero>Number0</zero>
<one>Number1</one>
<two>JumpSMS2</two>
<three>JumpSMS3</three>
<four>JumpSMS4</four>
<five>JumpSMS5</five>
<six>JumpSMS6</six>
<seven>JumpSMS7</seven>
<eight>JumpSMS8</eight>
<nine>JumpSMS9</nine>
<audio>AudioNextLanguage</audio>
<subtitle>ShowSubtitles</subtitle>
<enter>FullScreen</enter>
<blue>ContextMenu</blue>
<playlist>XBMC.ActivateWindow(MyMusicPlaylist)</playlist>
</remote>
</global>
<Home>
<remote>
<menu>XBMC.Skin.ToggleSetting(HomeViewToggle)</menu>
<info>XBMC.ActivateWindow(SystemInfo)</info>
<clear>XBMC.ActivateWindow(Weather)</clear>
<blue>XBMC.ActivateWindow(Settings)</blue>
<red>FullScreen</red>
<back>FullScreen</back>
</remote>
</Home>
<MyFiles>
<remote>
<clear>Delete</clear>
</remote>
</MyFiles>
<MyMusicPlaylist>
<remote>
<back>Playlist</back> <!-- Close playlist -->
<clear>Delete</clear>
</remote>
</MyMusicPlaylist>
<MyMusicPlaylistEditor>
<remote>
<zero>Queue</zero>
</remote>
</MyMusicPlaylistEditor>
<MyMusicFiles>
<remote>
<zero>Queue</zero>
<star>Queue</star>
<start>ContextMenu</start>
</remote>
</MyMusicFiles>
<MyMusicLibrary>
<remote>
<zero>Queue</zero>
<star>Queue</star>
</remote>
</MyMusicLibrary>
<FullscreenVideo>
<remote>
<back>FullScreen</back>
<zero>Number0</zero>
<one>Number1</one>
<two>Number2</two>
<three>Number3</three>
<four>Number4</four>
<five>Number5</five>
<six>Number6</six>
<seven>Number7</seven>
<eight>Number8</eight>
<nine>Number9</nine>
<left>Rewind</left>
<right>FastForward</right>
<up>Play</up>
<down>Pause</down>
<yellow>StepForward</yellow>
<green>StepBack</green>
<blue>CodecInfo</blue>
<menu>OSD</menu>
<start>OSD</start>
<info>XBMC.ActivateWindow(PVROSDChannels)</info>
<title>XBMC.ActivateWindow(PVROSDChannels)</title>
<display>AspectRatio</display>
<select>Info</select>
<teletext>XBMC.ActivateWindow(Teletext)</teletext>
<channelplus>SkipNext</channelplus>
<channelminus>SkipPrevious</channelminus>
<record>XBMC.PlayerControl(Record)</record>
</remote>
</FullscreenVideo>
<FullscreenInfo>
<remote>
<back>FullScreen</back>
<left>Rewind</left>
<right>FastForward</right>
<up>Play</up>
<down>Pause</down>
<yellow>StepForward</yellow>
<green>StepBack</green>
<display>AspectRatio</display>
<info>CodecInfo</info>
<select>Close</select>
<menu>OSD</menu>
</remote>
</FullscreenInfo>
<PlayerControls>
<remote>
<back>Close</back>
<menu>Close</menu>
</remote>
</PlayerControls>
<Visualisation>
<universalremote>
<obc151>XBMC.ActivateWindow(MyMusicPlaylist)</obc151>
</universalremote>
<remote>
<red>FullScreen</red>
<yellow>AnalogSeekForward</yellow>
<green>AnalogSeekBack</green>
<blue>CodecInfo</blue>
<left>Rewind</left>
<right>FastForward</right>
<pageplus>SkipNext</pageplus>
<pageminus>SkipPrevious</pageminus>
<up>Play</up>
<down>Pause</down>
<info>XBMC.ActivateWindow(PVROSDChannels)</info>
<back>XBMC.ActivateWindow(MyMusicPlaylist)</back>
<select>Info</select>
<menu>XBMC.ActivateWindow(MusicOSD)</menu>
<start>XBMC.ActivateWindow(MusicOSD)</start>
</remote>
</Visualisation>
<MusicOSD>
<remote>
<back>Close</back>
<menu>Close</menu>
<start>Close</start>
<info>CodecInfo</info>
</remote>
</MusicOSD>
<VisualisationSettings>
<remote>
<back>Close</back>
<menu>Close</menu>
</remote>
</VisualisationSettings>
<VisualisationPresetList>
<remote>
<back>Close</back>
<menu>Close</menu>
</remote>
</VisualisationPresetList>
<SlideShow>
<remote>
<zero>ZoomNormal</zero>
<one>ZoomLevel1</one>
<two>ZoomLevel2</two>
<three>ZoomLevel3</three>
<four>ZoomLevel4</four>
<five>ZoomLevel5</five>
<six>ZoomLevel6</six>
<seven>ZoomLevel7</seven>
<eight>ZoomLevel8</eight>
<nine>ZoomLevel9</nine>
<info>CodecInfo</info>
<pageplus>ZoomIn</pageplus>
<pageminus>ZoomOut</pageminus>
<select>Rotate</select>
<up>Pause</up>
<down>Play</down>
<back>PreviousMenu</back>
</remote>
</SlideShow>
<ScreenCalibration>
<remote>
<select>NextCalibration</select>
<enter>NextCalibration</enter>
<zero>ResetCalibration</zero>
<display>NextResolution</display>
<xbox>NextResolution</xbox>
</remote>
</ScreenCalibration>
<GUICalibration>
<remote>
<select>NextCalibration</select>
<enter>NextCalibration</enter>
<zero>ResetCalibration</zero>
</remote>
</GUICalibration>
<SelectDialog>
<remote>
<back>Close</back>
</remote>
</SelectDialog>
<VideoOSD>
<remote>
<back>PreviousMenu</back>
<menu>Close</menu>
<start>Close</start>
</remote>
</VideoOSD>
<VideoMenu>
<remote>
<menu>OSD</menu>
<back>PreviousMenu</back>
<info>Info</info>
<title>CodecInfo</title>
<zero>Number0</zero>
<one>Number1</one>
<two>Number2</two>
<three>Number3</three>
<four>Number4</four>
<five>Number5</five>
<six>Number6</six>
<seven>Number7</seven>
<eight>Number8</eight>
<nine>Number9</nine>
</remote>
</VideoMenu>
<OSDVideoSettings>
<remote>
<back>Close</back>
<menu>Close</menu>
<start>Close</start>
</remote>
</OSDVideoSettings>
<OSDAudioSettings>
<remote>
<back>Close</back>
<menu>Close</menu>
<start>Close</start>
</remote>
</OSDAudioSettings>
<VideoBookmarks>
<remote>
<back>Close</back>
<menu>Close</menu>
<start>Close</start>
<zero>Delete</zero>
</remote>
</VideoBookmarks>
<MyVideoLibrary>
<remote>
<zero>Queue</zero>
<clear>Delete</clear>
<green>ToggleWatched</green>
<yellow>Queue</yellow>
</remote>
</MyVideoLibrary>
<MyVideoFiles>
<remote>
<zero>Queue</zero>
<star>Queue</star>
<blue>ContextMenu</blue>
<green>ToggleWatched</green>
<yellow>Queue</yellow>
</remote>
</MyVideoFiles>
<MyPictures>
<remote>
<zero>Queue</zero>
<star>Queue</star>
<start>ContextMenu</start>
</remote>
</MyPictures>
<MyVideoPlaylist>
<remote>
<back>Playlist</back> <!-- Close playlist -->
<clear>Delete</clear>
<zero>Delete</zero>
</remote>
</MyVideoPlaylist>
<VirtualKeyboard>
<remote>
<back>BackSpace</back>
<star>Shift</star>
<hash>Symbols</hash>
<zero>Number0</zero>
<one>Number1</one>
<two>Number2</two>
<three>Number3</three>
<four>Number4</four>
<five>Number5</five>
<six>Number6</six>
<seven>Number7</seven>
<eight>Number8</eight>
<nine>Number9</nine>
<pageminus>CursorLeft</pageminus>
<pageplus>CursorRight</pageplus>
</remote>
</VirtualKeyboard>
<ContextMenu>
<remote>
<blue>Close</blue>
<back>Close</back>
</remote>
</ContextMenu>
<FileStackingDialog>
<remote>
<back>Close</back>
</remote>
</FileStackingDialog>
<Scripts>
<remote>
<info>XBMC.ActivateWindow(ScriptsDebugInfo)</info>
</remote>
</Scripts>
<ScriptsDebugInfo>
<remote>
<info>Info</info> <!-- clears debug python info -->
</remote>
</ScriptsDebugInfo>
<NumericInput>
<remote>
<zero>Number0</zero>
<one>Number1</one>
<two>Number2</two>
<three>Number3</three>
<four>Number4</four>
<five>Number5</five>
<six>Number6</six>
<seven>Number7</seven>
<eight>Number8</eight>
<nine>Number9</nine>
<back>BackSpace</back>
</remote>
</NumericInput>
<Weather>
<remote>
<back>PreviousMenu</back>
</remote>
</Weather>
<Settings>
<remote>
<back>PreviousMenu</back>
</remote>
</Settings>
<MyPicturesSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</MyPicturesSettings>
<MyProgramsSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</MyProgramsSettings>
<MyWeatherSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</MyWeatherSettings>
<MyMusicSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</MyMusicSettings>
<SystemSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</SystemSettings>
<MyVideosSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</MyVideosSettings>
<NetworkSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</NetworkSettings>
<AppearanceSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</AppearanceSettings>
<Profiles>
<remote>
<back>PreviousMenu</back>
</remote>
</Profiles>
<systeminfo>
<remote>
<back>PreviousMenu</back>
</remote>
</systeminfo>
<shutdownmenu>
<remote>
<back>PreviousMenu</back>
</remote>
</shutdownmenu>
<submenu>
<remote>
<back>PreviousMenu</back>
</remote>
</submenu>
<MusicInformation>
<remote>
<back>Close</back>
</remote>
</MusicInformation>
<MovieInformation>
<remote>
<back>Close</back>
</remote>
</MovieInformation>
<LockSettings>
<remote>
<menu>Close</menu>
<back>PreviousMenu</back>
</remote>
</LockSettings>
<ProfileSettings>
<remote>
<menu>Close</menu>
<back>PreviousMenu</back>
</remote>
</ProfileSettings>
<PictureInfo>
<remote>
<skipplus>NextPicture</skipplus>
<skipminus>PreviousPicture</skipminus>
<info>Close</info>
<back>Close</back>
</remote>
</PictureInfo>
<Teletext>
<remote>
<zero>number0</zero>
<one>number1</one>
<two>number2</two>
<three>number3</three>
<four>number4</four>
<five>number5</five>
<six>number6</six>
<seven>number7</seven>
<eight>number8</eight>
<nine>number9</nine>
<red>Red</red>
<green>Green</green>
<yellow>Yellow</yellow>
<blue>Blue</blue>
<info>Info</info>
<back>Close</back>
<menu>Close</menu>
<start>Close</start>
<teletext>Close</teletext>
</remote>
</Teletext>
<Favourites>
<remote>
<back>Close</back>
</remote>
</Favourites>
</keymap>

View File

@ -22,3 +22,17 @@
mode: 0755
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
- name: create kodi user directory
file:
dest: '{{ vdr.home }}/{{ item }}'
state: directory
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: "0775"
with_items:
- .kodi
- .kodi/userdata
- .kodi/userdata/keymaps
# TODO: Add configuration files

View File

@ -0,0 +1,11 @@
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">{{ item.value|capitalize }} on %h</name> ## Name
<service>
<type>_nfs._tcp</type>
<port>2049</port>
<txt-record>path={{ item.value }}</txt-record> ## path to shared Folder
<txt-record>subtype={% 'vdr' if item == 'recordings' else item %}</txt-record> ## subtype
</service>
</service-group>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">{{ item.key|capitalize }} on %h</name> ## Name
<service>
<type>_nfs._tcp</type>
<port>2049</port>
<txt-record>path={{ item.value }}</txt-record> ## path to shared Folder
<txt-record>subtype={{ 'vdr' if item.key == 'recordings' else item.key }}</txt-record> ## subtype
</service>
</service-group>

View File

@ -77,7 +77,6 @@
follow symlinks= yes
wide links= yes
{% endif %}
{% for name, path in media_dirs.iteritems() %}
[{{ name }}]
path = {{ path }}
@ -93,5 +92,4 @@
wide links = yes
{% endfor %}
include = /etc/samba/smb.conf.custom

View File

@ -0,0 +1,14 @@
# Remote control key macros for VDR
#
# Format:
#
# macrokey key1 key2 key3...
# macrokey @plugin key1 key2 key3...
#
# See man vdr(5)
Red Recordings
Green Schedule
Yellow Info
Blue Timers
User0 @osdteletext

128
roles/vdr/files/remote.conf Normal file
View File

@ -0,0 +1,128 @@
LIRC.Up KEY_UP
LIRC.Down KEY_DOWN
LIRC.Menu KEY_MENU
LIRC.Ok KEY_OK
LIRC.Back KEY_ESC
LIRC.Left KEY_LEFT
LIRC.Right KEY_RIGHT
LIRC.Red KEY_RED
LIRC.Green KEY_GREEN
LIRC.Yellow KEY_YELLOW
LIRC.Blue KEY_BLUE
LIRC.0 KEY_0
LIRC.1 KEY_1
LIRC.2 KEY_2
LIRC.3 KEY_3
LIRC.4 KEY_4
LIRC.5 KEY_5
LIRC.6 KEY_6
LIRC.7 KEY_7
LIRC.8 KEY_8
LIRC.9 KEY_9
LIRC.Info KEY_INFO
LIRC.Play KEY_PLAY
LIRC.Pause KEY_PAUSE
LIRC.Play/Pause KEY_PLAYPAUSE
LIRC.Stop KEY_STOP
LIRC.Record KEY_RECORD
LIRC.FastFwd KEY_FASTFORWARD
LIRC.FastRew KEY_REWIND
LIRC.Next KEY_NEXT
LIRC.Prev KEY_BACK
LIRC.Power KEY_POWER2
LIRC.Channel+ KEY_CHANNELUP
LIRC.Channel- KEY_CHANNELDOWN
LIRC.PrevChannel KEY_PREVIOUS
LIRC.Volume+ KEY_VOLUMEUP
LIRC.Volume- KEY_VOLUMEDOWN
LIRC.Mute KEY_MUTE
LIRC.Subtitles KEY_SUBTITLE
LIRC.Schedule KEY_EPG
LIRC.Channels KEY_CHANNEL
LIRC.Commands KEY_FAVORITES
LIRC.Audio KEY_MODE
LIRC.Timers KEY_TIME
LIRC.Recordings KEY_PVR
LIRC.Setup KEY_SETUP
LIRC.User0 KEY_TEXT
LIRC.User1 KEY_PROG1
LIRC.User2 KEY_PROG2
LIRC.User3 KEY_PROG3
LIRC.User4 KEY_PROG4
LIRC.User5 KEY_AUDIO
LIRC.User6 KEY_VIDEO
LIRC.User7 KEY_IMAGES
LIRC.User8 KEY_FN
LIRC.User9 KEY_SCREEN
XKeySym.Up Up
XKeySym.Down Down
XKeySym.Menu Home
XKeySym.Menu Tab
XKeySym.Menu KP_Home
XKeySym.Ok Return
XKeySym.Ok KP_Enter
XKeySym.Back BackSpace
XKeySym.Back KP_Separator
XKeySym.Left Left
XKeySym.Right Right
XKeySym.Up KP_Up
XKeySym.Down KP_Down
XKeySym.Left KP_Left
XKeySym.Right KP_Right
XKeySym.Red F1
XKeySym.Green F2
XKeySym.Yellow F3
XKeySym.Blue F4
XKeySym.0 0
XKeySym.1 1
XKeySym.2 2
XKeySym.3 3
XKeySym.4 4
XKeySym.5 5
XKeySym.6 6
XKeySym.7 7
XKeySym.8 8
XKeySym.9 9
XKeySym.0 KP_0
XKeySym.1 KP_1
XKeySym.2 KP_2
XKeySym.3 KP_3
XKeySym.4 KP_4
XKeySym.5 KP_5
XKeySym.6 KP_6
XKeySym.7 KP_7
XKeySym.8 KP_8
XKeySym.9 KP_9
XKeySym.Info End
XKeySym.Info KP_End
XKeySym.Pause F9
XKeySym.FastFwd F6
XKeySym.FastRew F5
XKeySym.Power Pause
XKeySym.Volume+ F12
XKeySym.Volume- F11
XKeySym.Volume+ KP_Add
XKeySym.Volume- KP_Subtract
XKeySym.Mute F10
XKeySym.User1 F5
XKeySym.User2 F6
XKeySym.User3 F7
XKeySym.User4 F8
XKeySym.User5 Print
XKeySym.User6 Scroll_Lock
XKeySym.User7 Insert
XKeySym.User8 KP_Divide
XKeySym.User9 KP_Multiply
XKeySym.Audio Menu
XKeySym.Channel+ Prior
XKeySym.Channel- Next
XKeySym.Channel+ KP_Prior
XKeySym.Channel- KP_Next
XKeySym.Volume+ XF86AudioRaiseVolume
XKeySym.Volume- XF86AudioLowerVolume
XKeySym.Mute XF86AudioMute
XKeySym.Stop XF86AudioStop
XKeySym.Play/Pause XF86AudioPlay
XKeySym.Prev XF86AudioPrev
XKeySym.Next XF86AudioNext

View File

@ -10,7 +10,6 @@
- vdr
- vdrctl
- vdr-plugin-dbus2vdr
- name: add svdrp to /etc/services
lineinfile:
dest: /etc/services
@ -22,7 +21,6 @@
dest: /etc/services
state: present
line: "svdrp-disc 6419/udp"
- name: create vdr recdir
file:
state: directory
@ -52,7 +50,6 @@
vdr.hide_first_recording_level
# TODO: set recdir, user etc. in /etc/vdr/conf.d/
- name: apt | install additional vdr plugins
apt:
name: '{{ item }}'
@ -61,17 +58,26 @@
with_items:
'{{ vdr_plugins | default({}) }}'
notify: [ 'Restart VDR' ]
- name: ensure vdr is stopped
systemd:
name: vdr.service
state: stopped
notify: [ 'Start VDR' ]
- name: 'vdr configuration | expand template for remote.conf'
template:
src: templates/remote.conf.j2
dest: '/var/lib/vdr/remote.conf'
- name: "vdr configuration | copy remote.conf if it doesn't exist yet"
copy:
src: files/remote.conf
dest: '{{ vdr.confdir }}/remote.conf'
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: 0644
force: no
- name: "vdr configuration | copy keymacros.conf if it doesn't exist yet"
copy:
src: files/keymacros.conf
dest: '{{ vdr.confdir }}/keymacros.conf'
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: 0644
force: no

View File

@ -1,7 +1,6 @@
---
# file: roles/yavdr-common/defaults/main.yml
branch: unstable
repositories:
- 'ppa:yavdr/main'
@ -9,16 +8,13 @@ repositories:
- 'ppa:yavdr/{{branch}}-vdr'
- 'ppa:yavdr/{{branch}}-kodi'
- 'ppa:yavdr/{{branch}}-yavdr'
drivers:
sundtek: auto
ddvb-dkms: auto
extra_packages:
- vim
- tree
- w-scan
vdr:
user: vdr
group: vdr

View File

@ -4,12 +4,10 @@
template:
src: templates/90-norecommends.j2
dest: /etc/apt/apt.conf.d/90norecommends
- name: use bash instead of dash
shell: |
echo "set dash/sh false" | debconf-communicate
dpkg-reconfigure -f noninteractive dash
- name: create vdr group
group:
gid: '{{ vdr.gid }}'
@ -25,7 +23,6 @@
shell: '/bin/bash'
state: present
append: true
- name: disable release-upgrade notifications
lineinfile:
dest: /etc/update-manager/release-upgrades
@ -33,7 +30,6 @@
state: present
regexp: '^(Prompt=).*$'
line: '\1never'
- name: add yaVDR PPAs
apt_repository:
repo: '{{ item }}'
@ -45,7 +41,6 @@
apt:
upgrade: dist
update_cache: yes
- name: apt | install basic packages
apt:
name: '{{ item }}'
@ -55,7 +50,7 @@
- anacron
- at
- bash-completion
- biosdevname
#- biosdevname # caution: may change device names after a minimal installation!
- debconf-utils
- linux-firmware
- psmisc
@ -68,7 +63,6 @@
- wpasupplicant
- usbutils
- xfsprogs
- name: apt | install extra packages
apt:
name: '{{ item }}'
@ -76,7 +70,6 @@
install_recommends: no
with_items:
'{{ extra_packages }}'
- name: get information about usb and pci hardware and loaded kernel modules
hardware_facts:
usb: True
@ -95,7 +88,6 @@
- debug:
var: gpus
verbosity: 1
- name: create media directories
file:
dest: '{{ item.value }}'

View File

@ -0,0 +1,11 @@
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">{{ item.value|capitalize }} on %h</name> ## Name
<service>
<type>_nfs._tcp</type>
<port>2049</port>
<txt-record>path={{ item.value }}</txt-record> ## path to shared Folder
<txt-record>subtype={% 'vdr' if item == 'recordings' else item %}</txt-record> ## subtype
</service>
</service-group>

View File

@ -21,7 +21,7 @@
# register: wol
# with_items: '{% for interface in ansible_interfaces if interface != 'lo' and interface != 'bond0' %}'
- name: restart autofs
- name: restart autofs if running
systemd:
name: autofs
state: restarted
@ -35,6 +35,13 @@
enabled: yes
masked: no
- name: restart avahi-linker if running
systemd:
name: avahi-linker
state: restarted
enabled: yes
masked: no
- name: start avahi-linker
systemd:
name: avahi-linker

View File

@ -13,6 +13,17 @@
when:
- install_lircd is defined and install_lircd
- name: disable lircd.socket and lircd.service (conflict with eventlircd with default configuration)
systemd:
name: '{{ item }}'
enabled: no
state: stopped
masked: yes
with_items:
- lircd.service
- lircd.socket
ignore_errors: yes
- name: install eventlircd
apt:
name: eventlircd
@ -20,6 +31,7 @@
when:
install_eventlircd is defined and install_eventlircd
# TODO: upload lircd2uinput package to PPA
#- name: install lircd2uinput
# tag: install

View File

@ -43,6 +43,7 @@
- openbox
- tmux
- kiosk-browser
- read-edid
#- yavdr-xorg
- name: "stop x@vt7.service"
@ -55,6 +56,11 @@
src: "templates/systemd/system/x-verbose@.service.j2"
dest: "/etc/systemd/system/x-verbose@.service"
- name: "expand template for xorg-verbose.conf"
template:
src: "templates/xorg-verbose.conf.j2"
dest: "/etc/X11/xorg-verbose.conf"
- name: "start x-verbose@.service"
systemd:
name: "x-verbose@vt7.service"
@ -70,6 +76,13 @@
- name: "detect xorg configuration"
action: xrandr_facts
- debug:
var: xorg.primary
- debug:
var: xorg.secondary
when: xorg.secondary is defined
- name: "stop x-verbose@vt7.service"
systemd:
name: "x-verbose@vt7.service"
@ -78,6 +91,11 @@
masked: true
### TODO: Create xorg configuration
- name: create xorg.conf (test)
template:
src: templates/xorg.conf.j2
dest: /etc/X11/xorg.conf
backup: yes
- name: create folders for user session
file:

View File

@ -1,5 +1,4 @@
#!/bin/bash
# forward environment variables to an environment file and the systemd user session
env | grep "DISPLAY\|DBUS_SESSION_BUS_ADDRESS\|XDG_RUNTIME_DIR" > ~/.session-env
systemctl --user import-environment DISPLAY XAUTHORITY XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS

View File

@ -798,7 +798,7 @@
<decor>no</decor>
<maximized>true</maximized>
<!--<skip_pager>yes</skip_pager>-->
<skip_taskbar>yes</skip_taskbar>
<skip_taskbar>no</skip_taskbar>
</application>
<application title="browser">
<decor>no</decor>

View File

@ -5,4 +5,4 @@ Before=graphical.target
[Service]
Type=forking
ExecStart=/usr/bin/x-daemon -logverbose 6 -noreset %I
ExecStart=/usr/bin/x-daemon -logverbose 6 -noreset %I -config /etc/X11/xorg-debug.conf

View File

@ -0,0 +1,2 @@
[Service]
EnvironmentFile=-/var/lib/vdr/.session-env

View File

@ -0,0 +1,20 @@
Section "Device"
Identifier "nvidia"
Driver "nvidia"
Option "NoLogo" "true"
Option "DynamicTwinView" "true"
Option "NoFlip" "false"
# Option "FlatPanelProperties" "Scaling = Native"
# Option "ModeValidation" "NoVesaModes, NoXServerModes"
# Option "ModeDebug" "true"
# Option "HWCursor" "false"
EndSection
Section "Screen"
Identifier "screen"
Device "nvidia"
EndSection
Section "Extensions"
Option "Composite" "false"
EndSection

View File

@ -0,0 +1,98 @@
{{ ansible_managed_file | comment }}
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
{% if xorg.secondary is defined %}
Screen 1 "Screen1" RightOf "Screen0"
{% endif %}
#InputDevice "Keyboard0" "CoreKeyboard"
#InputDevice "Mouse0" "CorePointer"
EndSection
Section "InputClass"
Identifier "exclude eventlircd devices"
MatchTag "eventlircd"
Option "Ignore" "True"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "{{ xorg.primary.vendor }}"
ModelName "{{ xorg.primary.model }}"
Option "DPMS"
Option "ExactModeTimingsDVI" "True"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
Option "NoLogo" "true"
{% if xorg.primary.bus_id is defined %}
BoardName "{{ xorg.primary.gpu_name }}"
BusID "{{ xorg.primary.bus_id }}"
{% else %}
BoardName "Unknown"
{% endif %}
Screen 0
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "nvidiaXineramaInfoOrder" "{{ xorg.primary.connector }}"
Option "ConnectedMonitor" "{{ xorg.primary.connector }}"
Option "UseDisplayDevice" "{{ xorg.primary.connector }}"
Option "CustomEDID" "{{ xorg.primary.connector }}:/etc/X11/edid.{{ xorg.primary.connector }}.bin"
Option "metamodes" "{{ xorg.primary.connector }}: {{ xorg.primary.mode }} +0+0"
Option "SLI" "Off"
Option "MultiGPU" "Off"
Option "BaseMosaic" "off"
SubSection "Display"
Depth 24
EndSubSection
EndSection
{% if xorg.secondary is defined %}
Section "Device"
Identifier "Device1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
Option "NoLogo" "true"
{% if xorg.secondary.bus_id is defined %}
BoardName "{{ xorg.primary.gpu_name }}"
BusID "{{ xorg.primary.bus_id }}"
{% else %}
BoardName "Unknown"
{% endif %}
Screen 1
EndSection
Section "Monitor"
Identifier "Monitor1"
VendorName "{{ xorg.secondary.vendor }}"
ModelName "{{ xorg.secondary.model }}"
EndSection
Section "Screen"
Identifier "Screen1"
Device "Device1"
Monitor "Monitor1"
DefaultDepth 24
Option "nvidiaXineramaInfoOrder" "{{ xorg.secondary.connector }}"
Option "ConnectedMonitor" "{{ xorg.secondary.connector }}"
Option "UseDisplayDevice" "{{ xorg.secondary.connector }}"
Option "CustomEDID" "{{ xorg.secondary.connector }}:/etc/X11/edid.{{ xorg.secondary.connector }}.bin"
Option "metamodes" "{{ xorg.secondary.connector }}: {{ xorg.secondary.mode }} +0+0"
Option "SLI" "Off"
Option "MultiGPU" "Off"
Option "BaseMosaic" "off"
SubSection "Display"
Depth 24
EndSubSection
EndSection
{% endif %}