Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/profiles/awesome.py
blob: a0267156617cdbdf8a289d66ff4735311f708cde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# A desktop environemtn using "Awesome" window manager.

import archinstall

def _prep_function(*args, **kwargs):
	"""
	Magic function called by the importing installer
	before continuing any further. It also avoids executing any
	other code in this stage. So it's a safe way to ask the user
	for more input before any other installer steps start.
	"""

	profile = archinstall.Profile(None, 'xorg')
	with profile.load_instructions() as imported:
		if hasattr(imported, '_prep_function'):
			return imported._prep_function()
		else:
			print('Deprecated (??): xorg profile has no _prep_function() anymore')

# Ensures that this code only gets executed if executed
# through importlib.util.spec_from_file_location("awesome", "/somewhere/awesome.py")
# or through conventional import awesome
if __name__ == 'awesome':
	# Install dependency profiles
	installation.install_profile('xorg')

	arguments = {
		'keyboard_layout' : 'sv-latin1',
		"editor" : "nano",
		"mediaplayer" : "lollypop gstreamer gst-plugins-good gnome-keyring",
		"filebrowser" : "nemo gpicview-gtk3",
		"webbrowser" : "chromium",
		"window_manager" : "awesome",
		"virtulization" : "qemu ovmf",
		"utils" : "openssh sshfs git htop pkgfile scrot dhclient wget smbclient cifs-utils libu2f-host",
		"audio" : "pulseaudio pulseaudio-alsa pavucontrol"
	}

	installation.add_additional_packages("{webbrowser} {utils} {mediaplayer} {window_manager} {virtulization} {filebrowser} {editor}".format(**arguments))

	with open(f'{installation.mountpoint}/etc/X11/xinit/xinitrc', 'a') as X11:
		X11.write('setxkbmap se\n')

	with open(f'{installation.mountpoint}/etc/vconsole.conf', 'a') as vconsole:
		vconsole.write('KEYMAP={keyboard_layout}\n'.format(**arguments))
		vconsole.write('FONT=lat9w-16\n')

	awesome = archinstall.Application(installation, 'awesome')
	awesome.install()