From a5bf93e09b8d7122e3db9e52e2d56ee8c08a7425 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Fri, 21 Aug 2020 22:12:29 +0200 Subject: [PATCH] Add HiDPI support to .zprofile and bspwmrc --- .config/bspwm/bspwmrc | 9 +++++++-- .config/zsh/.zprofile | 14 +++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 7f5e548..794b7cc 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -3,8 +3,13 @@ #--- General ---# # Basic definitions -bspc config border_width 4 -bspc config window_gap 20 +if [ "$HIDPI" = true ]; then + bspc config border_width 4 + bspc config window_gap 20 +else + bspc config border_width 2 + bspc config window_gap 10 +fi bspc config split_ratio 0.502 bspc config top_padding "$PANEL_HEIGHT" diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index ea858ec..beabbf1 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -26,8 +26,10 @@ export HIDPI=true export GNUPGHOME="$XDG_CONFIG_HOME/gnupg" # GTK -export GDK_SCALE=2 -export GDK_DPI_SCALE=0.5 +if [ "$HIDPI" = true ]; then + export GDK_SCALE=2 + export GDK_DPI_SCALE=0.5 +fi # Gradle export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle" @@ -50,12 +52,14 @@ export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc" export RANDFILE="$XDG_CACHE_HOME/rnd" # Panel -export PANEL_HEIGHT=38 +[ "$HIDPI" = true ] && export PANEL_HEIGHT=38 || export PANEL_HEIGHT=22 export PANEL_NAME="polybar_panel" # Qt5 -export QT_AUTO_SCREEN_SCALE_FACTOR=0 -export QT_SCREEN_SCALE_FACTORS=2 +if [ "$HIDPI" = true ]; then + export QT_AUTO_SCREEN_SCALE_FACTOR=0 + export QT_SCREEN_SCALE_FACTORS=2 +fi export QT_QPA_PLATFORMTHEME="qt5ct" # Terminal