From 3b531a31ca49d9d905b7fc69047a7b3136e0a9d6 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 3 Sep 2019 22:11:10 +0200 Subject: browser*: use dpi script --- browser | 26 +++++++++++--------------- browser-work | 16 +++++----------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/browser b/browser index 9768162..f55b474 100755 --- a/browser +++ b/browser @@ -1,21 +1,17 @@ #!/usr/bin/env zsh -if printf $1 | grep -q "youtube.com"; then - mpv "$1" -else - 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 +if [[ $1 != "" ]]; then + if printf $1 | grep -q "youtube.com"; then + mpv "$1" + exit fi +fi - if [[ $dpi == 96x96 ]]; then - GDK_DPI_SCALE=$SCALE /usr/bin/env firefox $@ - else - /usr/bin/env firefox $@ - fi +if [[ $(dpi) -gt 120 ]]; then + SCALE=1.25 +else + SCALE=1.0 fi +GDK_SCALE=$SCALE GDK_DPI_SCALE=$SCALE /usr/bin/env firefox $@ + diff --git a/browser-work b/browser-work index cdff00c..452b7bd 100755 --- a/browser-work +++ b/browser-work @@ -1,17 +1,11 @@ #!/usr/bin/env zsh -dpi=`xdpyinfo | grep -oP 'resolution:\s+\K\S+'` -host=$(hostname) - -if [[ $(xdpyinfo | grep 'dimensions:' | strips | cut -d" " -f 5) == "1200x1920" ]]; then - SCALE=1.0 +if [[ $(dpi) -gt 120 ]]; then + SCALE=1.25 else - SCALE=1.5 + SCALE=1.0 fi -if [[ $dpi == 96x96 ]]; then - GDK_DPI_SCALE=$SCALE /usr/bin/env $HOME/chrome-linux/chrome --disk-cache-dir=/tmp/cache --reset-variation-state $@ -else - $HOME/chrome-linux/chrome --disk-cache-dir=/tmp/cache --reset-variation-state $@ -fi +CHROME=/opt/google/chrome/google-chrome +GDK_DPI_SCALE=$SCALE $CHROME --disk-cache-dir=/tmp/cache --reset-variation-state --disable-sync-preferences --process-per-site --disable-reading-from-canvas --start-maximized $@ -- cgit v1.2.3