getcharsize 576 B

123456789101112131415
  1. #!/bin/bash
  2. [ -z "$1" ] && echo "1st argument must be a font string in a format that urxvt recognizes" && exit 1
  3. tmpfile="${TMPDIR:-/tmp}/${0##*/}$RANDOM"
  4. trap 'rm "$tmpfile"' EXIT
  5. # disable as many options as possible.
  6. urxvtopts=( -iconic -name donotloadanyresources -geometry 1x1 +rv +ss +j -fade 0 +is +ls +vb +sb +si -sl 0 -pe '' +ssc +hold -lsp 0 -letsp 0 -bc -uc -b 0 -w 0 -bl -override-redirect )
  7. unset HOME; urxvt -fn "$1" -geometry 1x1 "${urxvtopts[@]}" \
  8. -e sh -c "xdotool getwindowgeometry --shell \$WINDOWID > \"$tmpfile\""
  9. sed '/WIDTH\|HEIGHT/!d' "$tmpfile"