Move host defaults to TOML file

This commit is contained in:
Adam Gausmann 2024-08-28 12:59:18 -05:00
parent 0d0d0e7059
commit 40498beeaf
5 changed files with 17 additions and 12 deletions

View file

@ -1,12 +1,18 @@
is-virtual = false is-virtual = false
base16-scheme = "seti" base16-scheme = "seti"
wireless = []
ethernet = []
disks = ["/"] disks = ["/"]
system-font = "Fira Sans" system-font = "Fira Sans"
system-mono-font = "Fira Mono" system-mono-font = "Fira Mono"
#temperature-path = "" #temperature-path = ""
terminal = "alacritty"
lock-cmd = "swaylock -c 000000"
display-on-cmd = "swaymsg \"output * dpms on\""
display-off-cmd = "swaymsg \"output * dpms off\""
inputs = []
[[outputs]] [[outputs]]
match = "*" match = "*"
background = ["~/.local/share/backgrounds/sway-dark-1920x1080.png", "fill"] background = ["~/.local/share/backgrounds/sway-dark-1920x1080.png", "fill"]
inputs = []

View file

@ -1,5 +1,5 @@
[font] [font]
% if host.get('is-virtual', False): % if host['is-virtual']:
size = 10 size = 10
% else: % else:
size = 12 size = 12

View file

@ -5,7 +5,7 @@ general {
${get_base16('i3status')} ${get_base16('i3status')}
% for iface in host.get('wireless', []): % for iface in host['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"
@ -13,7 +13,7 @@ wireless ${iface} {
order += "wireless ${iface}" order += "wireless ${iface}"
% endfor % endfor
% for iface in host.get('ethernet', []): % for iface in host['ethernet']:
ethernet ${iface} { ethernet ${iface} {
format_up = "${iface} %ip" format_up = "${iface} %ip"
format_down = "${iface} down" format_down = "${iface} down"
@ -38,7 +38,7 @@ battery all {
} }
order += "battery all" order += "battery all"
% for disk in host.get('disks', ['/']): % for disk in host['disks']:
disk "${disk}" { disk "${disk}" {
format = "${disk} %avail" format = "${disk} %avail"
} }

View file

@ -37,7 +37,7 @@ client.urgent $base08 $base08 $base00 $base08 $base08
client.placeholder $base01 $base01 $base05 $base01 $base01 client.placeholder $base01 $base01 $base05 $base01 $base01
client.background $base07 client.background $base07
% for output in host.get('outputs', []): % for output in host['outputs']:
output ${repr(output['match'])} { output ${repr(output['match'])} {
% for line in output['sway-lines']: % for line in output['sway-lines']:
${line} ${line}
@ -45,7 +45,7 @@ output ${repr(output['match'])} {
} }
% endfor % endfor
% for input in host.get('inputs', []): % for input in host['inputs']:
input ${repr(input['match'])} { input ${repr(input['match'])} {
% for line in input['sway-lines']: % for line in input['sway-lines']:
${line} ${line}
@ -86,14 +86,14 @@ bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart bindsym $mod+Shift+r restart
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
bindsym $mod+Shift+q kill bindsym $mod+Shift+q kill
bindsym $mod+Shift+p exec ${host.get('lock-cmd', 'swaylock -c 000000')} bindsym $mod+Shift+p exec ${host['lock-cmd']}
# Blank individual displays # Blank individual displays
bindsym $mod+o output - dpms off bindsym $mod+o output - dpms off
# Unblank all displays # Unblank all displays
bindsym $mod+Shift+o output * dpms on bindsym $mod+Shift+o output * dpms on
bindsym $mod+Return exec ${host.get('terminal', 'alacritty')} bindsym $mod+Return exec ${host['terminal']}
bindsym $mod+d exec wofi --show drun bindsym $mod+d exec wofi --show drun
bindsym $mod+Shift+d exec wofi --show run bindsym $mod+Shift+d exec wofi --show run
bindsym $mod+p exec wofi-pass bindsym $mod+p exec wofi-pass

View file

@ -1,2 +1 @@
timeout 10 'pgrep swaylock && ${host.get('display-off-cmd', 'swaymsg "output * dpms off"')}' \ timeout 10 'pgrep swaylock && ${host['display-off-cmd']}' resume 'pgrep swaylock && ${host['display-on-cmd']}'
resume 'pgrep swaylock && ${host.get('display-on-cmd', 'swaymsg "output * dpms on"')}'