From 5da3017b7aee6c4415c37696c63997fc55a1f8d9 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Wed, 16 Sep 2020 17:41:37 +0200 Subject: [PATCH] use sway include instead of yadm template --- .config/sway/{config##template => config} | 34 +++++++++++------------ .config/sway/config.local##hostname.avior | 7 +++++ .config/sway/config.local##hostname.saiph | 7 +++++ 3 files changed, 30 insertions(+), 18 deletions(-) rename .config/sway/{config##template => config} (90%) create mode 100644 .config/sway/config.local##hostname.avior create mode 100644 .config/sway/config.local##hostname.saiph diff --git a/.config/sway/config##template b/.config/sway/config similarity index 90% rename from .config/sway/config##template rename to .config/sway/config index 930ddb9..236093e 100644 --- a/.config/sway/config##template +++ b/.config/sway/config @@ -1,5 +1,15 @@ -# WARNING: Do not edit this file. -# It was generated by processing {{ yadm.source }} +# ------------------------------------------------------------------------------ +# Device specific include +# ------------------------------------------------------------------------------ +# This needs to set the following variables: +# $primary_monitor_identifier - Identifier of the primary monitor +# $primary_monitor_resolution - Resolution for the primary monitor +# $primary_monitor_scale - Scale factor for thr primary monitor +# $secondary_monitor_x_offset - X offset for the secondary monitor +# $audio_out - Name of the audio drain to be controlled by shortcuts +# $audio_in - Name of the audio source to be controlled by shortcuts + +include config.local # ------------------------------------------------------------------------------ # Variables @@ -38,17 +48,13 @@ input 9456:311:Metadot_-_Das_Keyboard_Das_Keyboard_Model_S xkb_model "pc105" # ------------------------------------------------------------------------------ # Outputs # ------------------------------------------------------------------------------ -{% if yadm.hostname == "avior" %} -output eDP-1 pos 0 0 res 3840x2400 scale 2 -{% else %} -output eDP-1 pos 0 0 res 1920x1080 -{% endif %} -output DP-3 pos 1920 0 res 1920x1200 +output $primary_monitor_identifier pos 0 0 res $primary_monitor_resolution scale $primary_monitor_scale +output DP-3 pos $secondary_monitor_x_offset 0 res 1920x1200 output * bg /usr/share/backgrounds/default fill -bindswitch --reload --locked lid:on output eDP-1 disable -bindswitch --reload --locked lid:off output eDP-1 enable +bindswitch --reload --locked lid:on output $primary_monitor_identifier disable +bindswitch --reload --locked lid:off output $primary_monitor_identifier enable # ------------------------------------------------------------------------------ # Font @@ -204,14 +210,6 @@ bindsym XF86Explorer exec --no-startup-id thunar # Audio shortcuts # ------------------------------------------------------------------------------ -{% if yadm.hostname == "avior" %} -set $audio_out alsa_output.pci-0000_00_1f.3.analog-stereo -set $audio_in alsa_input.pci-0000_00_1f.3.analog-stereo -{% else %} -set $audio_out alsa_output.pci-0000_00_1b.0.analog-stereo -set $audio_in alsa_input.pci-0000_00_1b.0.analog-stereo -{% endif %} - bindsym XF86AudioRaiseVolume exec --no-startup-id "pactl set-sink-volume $audio_out +5%; pkill -RTMIN+10 i3blocks" bindsym XF86AudioLowerVolume exec --no-startup-id "pactl set-sink-volume $audio_out -5%; pkill -RTMIN+10 i3blocks" bindsym XF86AudioMute exec --no-startup-id "pactl set-sink-mute $audio_out toggle; pkill -RTMIN+10 i3blocks" diff --git a/.config/sway/config.local##hostname.avior b/.config/sway/config.local##hostname.avior new file mode 100644 index 0000000..f2c4709 --- /dev/null +++ b/.config/sway/config.local##hostname.avior @@ -0,0 +1,7 @@ +set $primary_monitor_identifier eDP-1 +set $primary_monitor_resolution 3840x2400 +set $primary_monitor_scale 2 +set $secondary_monitor_x_offset 1920 + +set $audio_out alsa_output.pci-0000_00_1f.3.analog-stereo +set $audio_in alsa_input.pci-0000_00_1f.3.analog-stereo diff --git a/.config/sway/config.local##hostname.saiph b/.config/sway/config.local##hostname.saiph new file mode 100644 index 0000000..4109255 --- /dev/null +++ b/.config/sway/config.local##hostname.saiph @@ -0,0 +1,7 @@ +set $primary_monitor_identifier eDP-1 +set $primary_monitor_resolution 1920x1080 +set $primary_monitor_scale 1 +set $secondary_monitor_x_offset 1920 + +set $audio_out alsa_output.pci-0000_00_1b.0.analog-stereo +set $audio_in alsa_input.pci-0000_00_1b.0.analog-stereo