AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / ubuntu / Perguntas / 1352729
Accepted
xerostomus
xerostomus
Asked: 2021-07-19 22:17:06 +0800 CST2021-07-19 22:17:06 +0800 CST 2021-07-19 22:17:06 +0800 CST

Como faço para aumentar o zoom de 200% em feh sem precisar usar a tela cheia?

  • 772

Isso funciona:

feh --zoom 200 --full-screen picturius.png

Eu preciso do mesmo sem tela cheia:

feh --zoom 200 picturius.png # this does not work

Você tem alguma ideia de onde estou errado?

command-line
  • 2 2 respostas
  • 1900 Views

2 respostas

  • Voted
  1. Best Answer
    sudodus
    2021-07-20T00:43:59+08:002021-07-20T00:43:59+08:00

    fehFundamentos

    No Ubuntu, encontro a seguinte descrição emman feh

     --zoom percent | max | fill
             Zoom images by percent when in full screen mode or when window
             geometry is fixed.  When combined with --auto-zoom, zooming will
             be limited to the specified percent.  Specifying max is like set‐
             ting --auto-zoom, using fill makes feh zoom the image like the
             --bg-fill mode.
    

    O zoom funciona para mim não apenas em tela cheia, mas também com geometria fixa de acordo com o exemplo a seguir,

    feh --zoom 200 --geometry 1500x500 zenity-info-message.png
    

    Shellscript que torna feh --zoommais agradável

    O shellscript a seguir corrige o parâmetro de geometria automaticamente para cada um,

    #!/bin/bash
    
    function usage {
    
     echo "Help for ${0##*/} by Nio Wiklund <nio.wiklund at gmail.com>
    
    Usage:
     ${0##*/} [--zoom <percent> [--position <+X+Y>]] <picture-1> [picture-2] [...]
    
    Examples:
    
    feh-zoom --zoom 200 picture.png
    feh-zoom --zoom 50 --position +400+200 g*.jpg
    
        --zoom <percent>
            Zoom images by percent. Will create a correct window size automatically.
            . this option is modified in this shellscript compared to feh.
            
        --position <+X+Y>
            Position of the picture-window's top left corner
            (offset X pixels and Y pixels from the screen's top left cormer)
            . this is an option only for this shellscript, but not for feh.
    
        <picture-1> [picture-2] [...]
           . Specify at least one picture. Wild-card works, e.g. *.png
     
           . Switch to the next picture with 'q' (while you do it with -> in feh).
             Quit with 'qq' (press 'q' twice within one second).
    
           . The standard options for feh (for example --randomize) will fail
             because feh is called for one picture eash time in a for-loop, and
             no more options are passed.
    
    If the first option is not --zoom, this shellscript passes control to feh
    directly, so that all the standard options for feh will work.
    
    General help for feh: man feh"
    }
    ##############################
    if [ "${1}" == "--zoom" ]
    then
     shift
     if [ "$1" == "" ]
     then
      usage
     fi
     zoom="$1"
    
     shift
     if [ "$1" == "" ]
     then
      usage
     fi
     if [ "${1}" == "--position" ]
     then
      shift
      if [ "$1" == "" ]
      then
       usage
      fi
      position="$1"
    
      shift
      if [ "$1" == "" ]
      then
       usage
      fi
     fi
     cont=1
     for i in "$@"
     do
      if [ $cont -ne 0 ]
      then
       str="$(feh -l "$i"|tail -n1)"
       wide=$(<<< "$str" cut -f3)
       high=$(<<< "$str" cut -f4)
       wide=$((wide*zoom/100+1))
       high=$((high*zoom/100+1))
       geom="${wide}x${high}$position"
    #   echo "$geom"
       feh --zoom "$zoom" --geometry "$geom" "$i"
       read -n1 -s -t1 ans
       cont=$?
      else
       exit 0
      fi
     done
    elif [ "${1}" == "-h" ] || [ "${1}" == "--help" ]
    then
     usage
    else
     if [ "$1" == "" ]
     then
      feh
     else
      feh "$@"
     fi
    fi
    

    Torne o shellscript feh-zoomexecutável e coloque-o no diretório PATH. Há um texto de ajuda,

    $ feh-zoom -h
    Help for feh-zoom by Nio Wiklund <nio.wiklund at gmail.com>
    
    Usage:
     feh-zoom [--zoom <percent> [--position <+X+Y>]] <picture-1> [picture-2] [...]
    
    Examples:
    
    feh-zoom --zoom 200 picture.png
    feh-zoom --zoom 50 --position +400+200 g*.jpg
    
        --zoom <percent>
            Zoom images by percent. Will create a correct window size automatically.
            . this option is modified in this shellscript compared to feh.
            
        --position <+X+Y>
            Position of the picture-window's top left corner
            (offset X pixels and Y pixels from the screen's top left cormer)
            . this is an option only for this shellscript, but not for feh.
    
        <picture-1> [picture-2] [...]
           . Specify at least one picture. Wild-card works, e.g. *.png
     
           . Switch to the next picture with 'q' (while you do it with -> in feh).
             Quit with 'qq' (press 'q' twice within one second).
    
           . The standard options for feh (for example --randomize) will fail
             because feh is called for one picture eash time in a for-loop, and
             no more options are passed.
    
    If the first option is not --zoom, this shellscript passes control to feh
    directly, so that all the standard options for feh will work.
    
    General help for feh: man feh
    
    • 8
  2. xerostomus
    2021-07-22T11:49:05+08:002021-07-22T11:49:05+08:00

    Obrigado, senhor, por sua ajuda!

    Vejo que devo ler o manual com mais cuidado da próxima vez, mas de qualquer maneira tenho certeza de que tenho que usar o seguinte comando para ampliar minha imagem duas vezes?

    feh  --zoom 200 --geometry $(feh  -l pictorius.png |  awk '(NR==2) {print(($3*2)"x"($4*2));}') pictorius.png 
    

    Honestamente, parece uma piada de mau gosto. Ou existe uma maneira mais simples?

    • 1

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Existe um comando para listar todos os usuários? Também para adicionar, excluir, modificar usuários, no terminal?

    • 9 respostas
  • Marko Smith

    Como excluir um diretório não vazio no Terminal?

    • 4 respostas
  • Marko Smith

    Como descompactar um arquivo zip do Terminal?

    • 9 respostas
  • Marko Smith

    Como instalo um arquivo .deb por meio da linha de comando?

    • 11 respostas
  • Marko Smith

    Como instalo um arquivo .tar.gz (ou .tar.bz2)?

    • 14 respostas
  • Marko Smith

    Como listar todos os pacotes instalados

    • 24 respostas
  • Martin Hope
    Flimm Como posso usar o docker sem sudo? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    led-Zepp Como faço para salvar a saída do terminal em um arquivo? 2014-02-15 11:49:07 +0800 CST
  • Martin Hope
    ubuntu-nerd Como descompactar um arquivo zip do Terminal? 2011-12-11 20:37:54 +0800 CST
  • Martin Hope
    TheXed Como instalo um arquivo .deb por meio da linha de comando? 2011-05-07 09:40:28 +0800 CST
  • Martin Hope
    Ivan Como listar todos os pacotes instalados 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    David Barry Como determino o tamanho total de um diretório (pasta) na linha de comando? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher "Os seguintes pacotes foram retidos:" Por que e como resolvo isso? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford Como os PPAs podem ser removidos? 2010-07-30 01:09:42 +0800 CST

Hot tag

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve