diff --git a/rofi/.config/rofi/config.rasi b/rofi/.config/rofi/config.rasi index 8cc77f8f..87fd1fc7 100644 --- a/rofi/.config/rofi/config.rasi +++ b/rofi/.config/rofi/config.rasi @@ -1,6 +1,5 @@ configuration { modi: "window,run,drun"; - dpi: 192; font: "Hack 12"; show-icons: true; bw: 0; diff --git a/rofi/.config/rofi/launch.sh b/rofi/.config/rofi/launch.sh new file mode 100755 index 00000000..f4655a2f --- /dev/null +++ b/rofi/.config/rofi/launch.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# New Start: A modern Arch workflow built with an emphasis on functionality. +# Copyright (C) 2018 Donovan Glover + +# This script will find the X server DPI and apply the necessary +# settings to make Rofi, X, GNOME, and KDE applications have the +# proper scaling, with no intervention from the user necessary. + +# Note that XDG_CURRENT_DESKTOP is required for KDE/Qt applications to +# have the proper theming in non-Plasma environments. In contrast, GNOME +# respects its theming even when XDG_CURRENT_DESKTOP is not set to it +# (through settings.ini). + +ROFI_DPI=$(xrdb -query | grep Xft.dpi | cut -f 2) +ROFI_SCALE=$(expr $ROFI_DPI / 96) +ROFI_DPI_SCALE=$(awk "BEGIN { print "1/$ROFI_SCALE" }") + +env \ + XDG_CURRENT_DESKTOP="KDE" \ + QT_AUTO_SCREEN_SCALE_FACTOR="0" \ + QT_FONT_DPI="$ROFI_DPI" \ + QT_SCREEN_SCALE_FACTORS="VGA-1=$ROFI_SCALE;" \ + GDK_SCALE="$ROFI_SCALE" \ + GDK_DPI_SCALE="$ROFI_DPI_SCALE" \ + rofi \ + -show drun \ + -dpi "$ROFI_DPI"