You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
1.4 KiB

#!/bin/bash
#----------------------------------------------------------------
# output-profile — Switch sway output profiles
#
# Replaces xrandr shell scripts used in the old i3 config.
# Uses swaymsg output commands to configure displays.
#
# Usage:
# output-profile projector — enable HDMI output (mirror or extend)
# output-profile edp-only — disable all external outputs
# output-profile dual — dual monitor setup
#
# Dependencies: sway
#
# NOTE: Edit the output names to match your hardware.
# Run `swaymsg -t get_outputs` to list connected outputs.
#----------------------------------------------------------------
# Output names — adjust to match your hardware
LAPTOP="eDP-1"
EXTERNAL="HDMI-A-1"
case "$1" in
projector)
# Enable external output, mirror the laptop display
swaymsg output "$EXTERNAL" enable pos 0 0
swaymsg output "$LAPTOP" pos 0 0
;;
edp-only)
# Disable external output, laptop only
swaymsg output "$EXTERNAL" disable
;;
dual)
# Dual monitor: laptop left, external right
swaymsg output "$LAPTOP" pos 0 0
swaymsg output "$EXTERNAL" pos 1920 0
;;
*)
echo "Usage: output-profile {projector|edp-only|dual}"
echo " Edit this script to match your output names."
echo " Run 'swaymsg -t get_outputs' to list connected outputs."
exit 1
;;
esac