sway smart hdmi and signal
This commit is contained in:
@@ -5,6 +5,7 @@ exec_always eww daemon && (eww open bar0 || true) && (eww open bar1 || true)
|
||||
exec_always mako
|
||||
|
||||
exec /usr/libexec/polkit-mate-authentication-agent-1
|
||||
exec flatpak run org.signal.Signal
|
||||
|
||||
exec swayidle -w \
|
||||
timeout 900 '~/.local/bin/smart-dim.sh' \
|
||||
|
||||
@@ -5,9 +5,9 @@ set $res_y 1890
|
||||
set $resolution 3024x1890
|
||||
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-1 position -5120,0 scale 1.5
|
||||
|
||||
23
sway/.config/sway/scripts/hdmi-setup.sh
Executable file
23
sway/.config/sway/scripts/hdmi-setup.sh
Executable 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
|
||||
@@ -1,3 +1,4 @@
|
||||
for_window [app_id="signal"] move to scratchpad
|
||||
for_window [app_id="hooknloop"] floating enable
|
||||
for_window [app_id="lego-build"] 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 [app_id="mpv"] floating enable
|
||||
for_window [class="snow_trail_sdl"] floating enable
|
||||
for_window [app_id="destinations"] floating enable
|
||||
for_window [class="destinations"] floating enable
|
||||
|
||||
Reference in New Issue
Block a user