Separate hosts file and add seraph, xinitrc
This commit is contained in:
parent
915201e650
commit
6afa15d7d7
7 changed files with 47 additions and 11 deletions
|
@ -1,4 +0,0 @@
|
||||||
[ayypad.i3status]
|
|
||||||
wireless = ["wlp4s0"]
|
|
||||||
ethernet = ["enp2s0"]
|
|
||||||
disks = ["/", "/home"]
|
|
12
hosts/ayypad.toml
Normal file
12
hosts/ayypad.toml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[i3status]
|
||||||
|
wireless = ["wlp4s0"]
|
||||||
|
ethernet = ["enp2s0"]
|
||||||
|
disks = ["/", "/home"]
|
||||||
|
|
||||||
|
[xinit]
|
||||||
|
outputs = [
|
||||||
|
{ name = "eDP", config = ["--auto", "--primary"] },
|
||||||
|
{ name = "HDMI-A-0" },
|
||||||
|
{ name = "DisplayPort-0" },
|
||||||
|
{ name = "DisplayPort-1" },
|
||||||
|
]
|
10
hosts/seraph.toml
Normal file
10
hosts/seraph.toml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[i3status]
|
||||||
|
ethernet = ["enp5s0"]
|
||||||
|
disks = ["/", "/home"]
|
||||||
|
|
||||||
|
[xinit]
|
||||||
|
outputs = [
|
||||||
|
{ name = "HDMI-A-0", config = ["--auto", "--primary"] },
|
||||||
|
{ name = "DVI-D-0", config = ["--auto", "--left-of", "HDMI-A-0"] },
|
||||||
|
{ name = "DisplayPort-0" },
|
||||||
|
]
|
1
install
1
install
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cd $(dirname "$0")
|
cd $(dirname "$0")
|
||||||
git submodule update --init
|
|
||||||
pipenv run -- ./install.py "$@"
|
pipenv run -- ./install.py "$@"
|
||||||
|
|
10
install.py
10
install.py
|
@ -38,9 +38,13 @@ def main():
|
||||||
|
|
||||||
templates_dir = args.dotfiles / 'templates'
|
templates_dir = args.dotfiles / 'templates'
|
||||||
include_dir = args.dotfiles / 'include'
|
include_dir = args.dotfiles / 'include'
|
||||||
|
host_filename = args.dotfiles / 'hosts' / '{}.toml'.format(args.hostname)
|
||||||
|
|
||||||
with open(args.dotfiles / 'hosts.toml') as hosts_file:
|
if host_filename.exists():
|
||||||
hosts_config = toml.load(hosts_file)
|
with open(host_filename) as host_file:
|
||||||
|
host_config = toml.load(host_file)
|
||||||
|
else:
|
||||||
|
host_config = {}
|
||||||
|
|
||||||
lookup = mako.lookup.TemplateLookup(
|
lookup = mako.lookup.TemplateLookup(
|
||||||
directories=[
|
directories=[
|
||||||
|
@ -58,7 +62,7 @@ def main():
|
||||||
lookup=lookup,
|
lookup=lookup,
|
||||||
)
|
)
|
||||||
output = template.render(
|
output = template.render(
|
||||||
host=hosts_config[args.hostname]
|
host=host_config
|
||||||
)
|
)
|
||||||
output_path = args.home / template_path.relative_to(templates_dir)
|
output_path = args.home / template_path.relative_to(templates_dir)
|
||||||
with open(output_path, 'w+') as output_file:
|
with open(output_path, 'w+') as output_file:
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
|
<% i3status = host.get('i3status', {}) %>\
|
||||||
general {
|
general {
|
||||||
colors = true
|
colors = true
|
||||||
interval = 5
|
interval = 5
|
||||||
}
|
}
|
||||||
|
|
||||||
% for iface in host['i3status']['wireless']:
|
% for iface in i3status.get('wireless', []):
|
||||||
wireless ${iface} {
|
wireless ${iface} {
|
||||||
format_up = "${iface} %ip %essid %quality"
|
format_up = "${iface} %ip %essid %quality"
|
||||||
format_down = "${iface} down"
|
format_down = "${iface} down"
|
||||||
|
@ -11,7 +12,7 @@ wireless ${iface} {
|
||||||
order += "wireless ${iface}"
|
order += "wireless ${iface}"
|
||||||
|
|
||||||
% endfor
|
% endfor
|
||||||
% for iface in host['i3status']['ethernet']:
|
% for iface in i3status.get('ethernet', []):
|
||||||
ethernet ${iface} {
|
ethernet ${iface} {
|
||||||
format_up = "${iface} %ip"
|
format_up = "${iface} %ip"
|
||||||
format_down = "${iface} down"
|
format_down = "${iface} down"
|
||||||
|
@ -19,7 +20,7 @@ ethernet ${iface} {
|
||||||
order += "ethernet ${iface}"
|
order += "ethernet ${iface}"
|
||||||
|
|
||||||
% endfor
|
% endfor
|
||||||
% for disk in host['i3status']['disks']:
|
% for disk in i3status.get('disks', ['/']):
|
||||||
disk "${disk}" {
|
disk "${disk}" {
|
||||||
format = "${disk} %avail"
|
format = "${disk} %avail"
|
||||||
}
|
}
|
||||||
|
|
14
templates/.xinitrc
Normal file
14
templates/.xinitrc
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<% xinit = host.get('xinit', {}) %>\
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
% for output in xinit.get('outputs', []):
|
||||||
|
xrandr --output '${output['name']}' --set TearFree on \
|
||||||
|
% if output.get('config'):
|
||||||
|
${' '.join(output['config'])}
|
||||||
|
%endif
|
||||||
|
% endfor
|
||||||
|
|
||||||
|
xset s 0 0
|
||||||
|
xset -dpms
|
||||||
|
|
||||||
|
exec /usr/bin/ck-launch-session /usr/bin/dbus-launch --sh-syntax --exit-with-session /usr/bin/i3
|
Loading…
Add table
Reference in a new issue