Compare commits

..

No commits in common. "453a39b412ad6d877af044d8cf646d14f5920087" and "5cb31bc54047f56b42d26fe488a9e20d3b1ff00b" have entirely different histories.

5 changed files with 14 additions and 45 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -69,8 +69,7 @@ function dc() {
commit_msg="dev: automated commit - ${timestamp}" commit_msg="dev: automated commit - ${timestamp}"
fi fi
# pass other args git commit -m "$commit_msg" --no-gpg-sign
git commit -m "$commit_msg" --no-gpg-sign "$@"
git push &>/dev/null || { echo "Push failed"; return 1; } git push &>/dev/null || { echo "Push failed"; return 1; }
} }
@ -264,13 +263,13 @@ function cat {
} }
function toggle_resolution() { function toggle_resolution() {
local mirror_mode=false local projector_mode=false
# Verificar flags # Verificar si se pasó el flag -p o --projector
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
-m|--mirror) -p|--projector)
mirror_mode=true projector_mode=true
shift shift
;; ;;
*) *)
@ -279,55 +278,25 @@ function toggle_resolution() {
esac esac
done done
# Obtener estado actual del monitor interno
current_state=$(swaymsg -t get_outputs | jq -r '.[] | select(.name == "eDP-1") | "\(.current_mode.width)x\(.current_mode.height):\(.scale)"') current_state=$(swaymsg -t get_outputs | jq -r '.[] | select(.name == "eDP-1") | "\(.current_mode.width)x\(.current_mode.height):\(.scale)"')
# Detectar monitores externos conectados if [[ "$projector_mode" == true ]]; then
external_monitor="" echo "Switching to projector mode (1024x768)..."
if swaymsg -t get_outputs | jq -r '.[].name' | grep -q "DP-2"; then swaymsg output eDP-1 resolution 1024x768@120Hz scale 1.0
external_monitor="DP-2"
elif swaymsg -t get_outputs | jq -r '.[].name' | grep -q "HDMI-A-1"; then
external_monitor="HDMI-A-1"
fi
if [[ "$mirror_mode" == true ]] || [[ -n "$external_monitor" ]]; then # Si hay proyector conectado, configurarlo también
echo "Switching to mirror mode (1920x1080)..." if swaymsg -t get_outputs | jq -r '.[].name' | grep -q "HDMI-A-1"; then
swaymsg output HDMI-A-1 resolution 1024x768 position 0,0
# Configurar monitor interno a 1920x1080 swaymsg output eDP-1 position 0,0
swaymsg output eDP-1 resolution 1920x1080@120Hz scale 1.0 pos 0 0 echo "Projector mirror mode enabled"
# Configurar monitor externo si está conectado
if [[ -n "$external_monitor" ]]; then
swaymsg output "$external_monitor" resolution 1920x1080@60Hz pos 0 0
echo "Mirror mode enabled: eDP-1 + $external_monitor at 1920x1080"
else
echo "Monitor interno configurado a 1920x1080 (sin monitor externo detectado)"
fi fi
elif [[ "$current_state" == "2880x1920:2.0" ]]; then elif [[ "$current_state" == "2880x1920:2.0" ]]; then
echo "Switching to 1920x1080 (16:9)..." echo "Switching to 1920x1080 (16:9)..."
swaymsg output eDP-1 resolution 1920x1080@120Hz scale 1.0 swaymsg output eDP-1 resolution 1920x1080@120Hz scale 1.0
# Deshabilitar mirroring si hay monitor externo
if [[ -n "$external_monitor" ]]; then
swaymsg output "$external_monitor" pos 1920 0
echo "Extended mode: $external_monitor positioned to the right"
fi
else else
echo "Switching to 2880x1920 (3:2) native..." echo "Switching to 2880x1920 (3:2)..."
swaymsg output eDP-1 resolution 2880x1920@120Hz scale 2.0 swaymsg output eDP-1 resolution 2880x1920@120Hz scale 2.0
# Deshabilitar mirroring si hay monitor externo
if [[ -n "$external_monitor" ]]; then
swaymsg output "$external_monitor" pos 1440 0
echo "Extended mode: $external_monitor positioned to the right"
fi
fi fi
# Mostrar estado final
echo "Current configuration:"
swaymsg -t get_outputs | jq -r '.[] | select(.active == true) | " \(.name): \(.current_mode.width)x\(.current_mode.height)@\(.current_mode.refresh/1000)Hz scale:\(.scale) pos:(\(.rect.x),\(.rect.y))"'
} }
function cb { function cb {

Binary file not shown.