sway smart hdmi and signal

This commit is contained in:
Jonas H
2026-06-19 10:45:19 +02:00
parent dbf2e830cc
commit b1bd84b495
4 changed files with 29 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ exec_always eww daemon && (eww open bar0 || true) && (eww open bar1 || true)
exec_always mako exec_always mako
exec /usr/libexec/polkit-mate-authentication-agent-1 exec /usr/libexec/polkit-mate-authentication-agent-1
exec flatpak run org.signal.Signal
exec swayidle -w \ exec swayidle -w \
timeout 900 '~/.local/bin/smart-dim.sh' \ timeout 900 '~/.local/bin/smart-dim.sh' \

View File

@@ -5,9 +5,9 @@ set $res_y 1890
set $resolution 3024x1890 set $resolution 3024x1890
set $scale 1.5 set $scale 1.5
output eDP-1 resolution $resolution position 0,1445 scale $scale output eDP-1 resolution $resolution scale $scale
output HDMI-A-1 position 0,0 scale 1.5 exec_always ~/.config/sway/scripts/hdmi-setup.sh
output DVI-I-2 position -2560,0 scale 1.5 output DVI-I-2 position -2560,0 scale 1.5
output DVI-I-1 position -5120,0 scale 1.5 output DVI-I-1 position -5120,0 scale 1.5

View File

@@ -0,0 +1,23 @@
#!/bin/bash
OUTPUTS=$(swaymsg -t get_outputs)
HDMI_CONNECTED=$(echo "$OUTPUTS" | jq '[.[] | select(.name == "HDMI-A-1")] | length > 0')
if [ "$HDMI_CONNECTED" = "true" ]; then
IS_4K=$(echo "$OUTPUTS" | jq '[.[] | select(.name == "HDMI-A-1") | .modes[].width] | max >= 3840')
if [ "$IS_4K" = "true" ]; then
RES_H=2160
SCALE=1.5
swaymsg output HDMI-A-1 resolution 3840x2160 scale $SCALE pos 0 0
else
RES_H=1440
SCALE=1.0
swaymsg output HDMI-A-1 resolution 2560x1440 scale $SCALE pos 0 0
fi
HDMI_LOGICAL_H=$(echo "$RES_H / $SCALE" | bc)
swaymsg output eDP-1 resolution 3024x1890 scale 1.5 pos 0 $HDMI_LOGICAL_H
else
swaymsg output eDP-1 resolution 3024x1890 scale 1.5 pos 0 0
fi

View File

@@ -1,3 +1,4 @@
for_window [app_id="signal"] move to scratchpad
for_window [app_id="hooknloop"] floating enable for_window [app_id="hooknloop"] floating enable
for_window [app_id="lego-build"] floating enable for_window [app_id="lego-build"] floating enable
for_window [instance="LEGO_Brain"] floating enable for_window [instance="LEGO_Brain"] floating enable
@@ -7,3 +8,5 @@ for_window [instance="sameboy"] floating enable
for_window [class="feh"] floating enable for_window [class="feh"] floating enable
for_window [app_id="mpv"] floating enable for_window [app_id="mpv"] floating enable
for_window [class="snow_trail_sdl"] floating enable for_window [class="snow_trail_sdl"] floating enable
for_window [app_id="destinations"] floating enable
for_window [class="destinations"] floating enable