2022-02-12 13:06:53 +00:00
|
|
|
from os import listdir
|
|
|
|
from os.path import join
|
|
|
|
|
|
|
|
actions = {
|
|
|
|
'fc-cache_flush': {
|
|
|
|
'command': 'fc-cache -f',
|
|
|
|
'triggered': True,
|
|
|
|
'needs': {
|
|
|
|
'pkg_pacman:fontconfig',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'i3pystatus_create_virtualenv': {
|
|
|
|
'command': '/usr/bin/python3 -m virtualenv -p python3 /opt/i3pystatus/venv/',
|
|
|
|
'unless': 'test -d /opt/i3pystatus/venv/',
|
|
|
|
'needs': {
|
|
|
|
'directory:/opt/i3pystatus/src',
|
2022-03-09 12:02:35 +00:00
|
|
|
'pkg_pacman:python-virtualenv',
|
2022-02-12 13:06:53 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
'i3pystatus_install': {
|
|
|
|
'command': ' && '.join([
|
|
|
|
'cd /opt/i3pystatus/src',
|
2022-03-10 19:59:55 +00:00
|
|
|
'/opt/i3pystatus/venv/bin/pip install --upgrade pip colour netifaces basiciw',
|
2022-02-12 13:06:53 +00:00
|
|
|
'/opt/i3pystatus/venv/bin/pip install --upgrade -e .',
|
|
|
|
]),
|
|
|
|
'needs': {
|
|
|
|
'action:i3pystatus_create_virtualenv',
|
|
|
|
},
|
|
|
|
'triggered': True,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
directories = {
|
|
|
|
'/etc/sddm.conf.d': {
|
|
|
|
'purge': True,
|
|
|
|
},
|
|
|
|
'/opt/i3pystatus/src': {},
|
|
|
|
'/usr/share/fonts/bundlewrap': {
|
|
|
|
'purge': True,
|
|
|
|
'triggers': {
|
|
|
|
'action:fc-cache_flush',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
svc_systemd = {
|
|
|
|
'sddm': {
|
|
|
|
'needs': {
|
|
|
|
'pkg_pacman:sddm',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
git_deploy = {
|
|
|
|
'/opt/i3pystatus/src': {
|
|
|
|
'repo': 'https://github.com/enkore/i3pystatus.git',
|
|
|
|
'rev': 'current',
|
|
|
|
'triggers': {
|
|
|
|
'action:i3pystatus_install',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
for filename in listdir(join(repo.path, 'data', 'arch-with-gui', 'files', 'fonts')):
|
|
|
|
if filename.startswith('.'):
|
|
|
|
continue
|
|
|
|
|
|
|
|
if filename.endswith('.vault'):
|
|
|
|
font_name = filename[:-6]
|
|
|
|
attrs = {
|
|
|
|
'content': repo.vault.decrypt_file_as_base64(join('arch-with-gui', 'files', 'fonts', filename)),
|
|
|
|
'content_type': 'base64',
|
|
|
|
}
|
|
|
|
else:
|
|
|
|
font_name = filename
|
|
|
|
attrs = {
|
|
|
|
'source': join('fonts', filename),
|
|
|
|
'content_type': 'binary',
|
|
|
|
}
|
|
|
|
|
|
|
|
files[f'/usr/share/fonts/bundlewrap/{font_name}'] = {
|
|
|
|
'triggers': {
|
|
|
|
'action:fc-cache_flush',
|
|
|
|
},
|
|
|
|
**attrs,
|
|
|
|
}
|
|
|
|
|
2022-03-10 19:59:55 +00:00
|
|
|
if node.metadata.get('arch-with-gui/autologin_as', None):
|
2022-02-12 13:06:53 +00:00
|
|
|
files['/etc/sddm.conf.d/autologin.conf'] = {
|
2022-03-10 19:59:55 +00:00
|
|
|
'context': {
|
|
|
|
'user': node.metadata.get('arch-with-gui/autologin_as'),
|
|
|
|
},
|
2022-02-12 13:06:53 +00:00
|
|
|
'content_type': 'mako',
|
|
|
|
'before': {
|
|
|
|
'svc_systemd:sddm',
|
|
|
|
},
|
|
|
|
}
|