From 63e26a56d24c105c040013bb42c58bc14a6d7803 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sun, 28 Jul 2019 16:50:59 +0200 Subject: browser*: better handling of high res screen --- browser | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'browser') diff --git a/browser b/browser index a8f8612..9768162 100755 --- a/browser +++ b/browser @@ -1,11 +1,21 @@ #!/usr/bin/env zsh -dpi=`xdpyinfo | grep -oP 'resolution:\s+\K\S+'` -host=$(hostname) - -if [[ $dpi == 96x96 ]]; then - GDK_DPI_SCALE=1.3 /usr/bin/env firefox $@ +if printf $1 | grep -q "youtube.com"; then + mpv "$1" else - /usr/bin/env firefox $@ + dpi=`xdpyinfo | grep -oP 'resolution:\s+\K\S+'` + host=$(hostname) + + if [[ $(xdpyinfo | grep 'dimensions:' | strips | cut -d" " -f 5) == "1200x1920" ]]; then + SCALE=1.0 + else + SCALE=1.5 + fi + + if [[ $dpi == 96x96 ]]; then + GDK_DPI_SCALE=$SCALE /usr/bin/env firefox $@ + else + /usr/bin/env firefox $@ + fi fi -- cgit v1.2.3