Skip to content

Instantly share code, notes, and snippets.

@LeReverandNox
Created July 21, 2018 15:41
Show Gist options
  • Select an option

  • Save LeReverandNox/8ad897dccc836de5ebaaa29ece046e1a to your computer and use it in GitHub Desktop.

Select an option

Save LeReverandNox/8ad897dccc836de5ebaaa29ece046e1a to your computer and use it in GitHub Desktop.
Poor's man quicklook
#!/bin/bash
function quick-look() {
SCREEN_WIDTH=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1)
SCREEN_HEIGHT=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2)
WIDTH=$(echo $(( ${SCREEN_WIDTH} * 0.75)) | cut -f1 -d".")
HEIGHT=$(echo $(( ${SCREEN_HEIGHT} * 0.75)) | cut -f1 -d".")
feh --title="feh_quicklook" --scale-down --geometry "${WIDTH}"x"${HEIGHT}" $1 $(pwd) >/dev/null 2>&1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment