Advertisement
Rnery

xrand escala...

Nov 9th, 2023 (edited)
1,186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.84 KB | Source Code | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. find_hdmi_output() {
  4.     local hdmi_output
  5.     hdmi_output=$(xrandr | grep " connected" | grep "HDMI" | awk '{print $1}')
  6.     echo "$hdmi_output"
  7. }
  8.  
  9. adjust_hdmi_scale() {
  10.     local hdmi_output="$1"
  11.     local horizontal_scale=100
  12.     local vertical_scale=100
  13.  
  14.     if [ -n "$hdmi_output" ]; then
  15.         # Aplique as configurações de escala
  16.         xrandr --output "$hdmi_output" --scale ${horizontal_scale}x${vertical_scale}
  17.         # Se necessário, ajuste a posição da tela
  18.         xrandr --output "$hdmi_output" --pos 0x0
  19.         echo "Escala ajustada para ${horizontal_scale}x${vertical_scale} na saída $hdmi_output"
  20.         exit 1
  21.     fi
  22.     echo "Nenhuma saída HDMI encontrada."
  23. }
  24.  
  25. main() {
  26.     local hdmi_output
  27.     hdmi_output=$(find_hdmi_output)
  28.     adjust_hdmi_scale "$hdmi_output"
  29. }
  30.  
  31. main
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement