diff --git a/local-bin/.local/bin/wlrecord.sh b/local-bin/.local/bin/wlrecord.sh index c399c45..2aba94a 100755 Binary files a/local-bin/.local/bin/wlrecord.sh and b/local-bin/.local/bin/wlrecord.sh differ diff --git a/npm/.config/npm/npmrc b/npm/.config/npm/npmrc index 80eff59..59bc855 100644 Binary files a/npm/.config/npm/npmrc and b/npm/.config/npm/npmrc differ diff --git a/ssh/.ssh/config b/ssh/.ssh/config index 20a8b1c..abb18ed 100644 Binary files a/ssh/.ssh/config and b/ssh/.ssh/config differ diff --git a/zsh/.config/zsh/functions.zsh b/zsh/.config/zsh/functions.zsh index 813e035..291227d 100644 --- a/zsh/.config/zsh/functions.zsh +++ b/zsh/.config/zsh/functions.zsh @@ -69,7 +69,8 @@ function dc() { commit_msg="dev: automated commit - ${timestamp}" fi - git commit -m "$commit_msg" --no-gpg-sign + # pass other args + git commit -m "$commit_msg" --no-gpg-sign "$@" git push &>/dev/null || { echo "Push failed"; return 1; } } @@ -263,13 +264,13 @@ function cat { } function toggle_resolution() { - local projector_mode=false + local mirror_mode=false - # Verificar si se pasó el flag -p o --projector + # Verificar flags while [[ $# -gt 0 ]]; do case $1 in - -p|--projector) - projector_mode=true + -m|--mirror) + mirror_mode=true shift ;; *) @@ -278,25 +279,55 @@ function toggle_resolution() { esac 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)"') - if [[ "$projector_mode" == true ]]; then - echo "Switching to projector mode (1024x768)..." - swaymsg output eDP-1 resolution 1024x768@120Hz scale 1.0 + # Detectar monitores externos conectados + external_monitor="" + if swaymsg -t get_outputs | jq -r '.[].name' | grep -q "DP-2"; then + external_monitor="DP-2" + elif swaymsg -t get_outputs | jq -r '.[].name' | grep -q "HDMI-A-1"; then + external_monitor="HDMI-A-1" + fi - # Si hay proyector conectado, configurarlo también - if swaymsg -t get_outputs | jq -r '.[].name' | grep -q "HDMI-A-1"; then - swaymsg output HDMI-A-1 resolution 1024x768 position 0,0 - swaymsg output eDP-1 position 0,0 - echo "Projector mirror mode enabled" + if [[ "$mirror_mode" == true ]] || [[ -n "$external_monitor" ]]; then + echo "Switching to mirror mode (1920x1080)..." + + # Configurar monitor interno a 1920x1080 + swaymsg output eDP-1 resolution 1920x1080@120Hz scale 1.0 pos 0 0 + + # 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 + elif [[ "$current_state" == "2880x1920:2.0" ]]; then echo "Switching to 1920x1080 (16:9)..." 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 - echo "Switching to 2880x1920 (3:2)..." + echo "Switching to 2880x1920 (3:2) native..." 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 + + # 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 { diff --git a/zsh/.config/zsh/zsh_history_fw b/zsh/.config/zsh/zsh_history_fw new file mode 100644 index 0000000..8d56597 Binary files /dev/null and b/zsh/.config/zsh/zsh_history_fw differ