Skip to content

Instantly share code, notes, and snippets.

@mca-gif
Last active May 3, 2017 13:11
Show Gist options
  • Save mca-gif/8546cac6073f20e268977719e3691629 to your computer and use it in GitHub Desktop.
Save mca-gif/8546cac6073f20e268977719e3691629 to your computer and use it in GitHub Desktop.
HiDPI Hacks for Linux
Add the following before the last line in the `runenpass.sh` of the Enpass installation directory
export QT_AUTO_SCREEN_SCALE_FACTOR=$(gsettings get org.gnome.desktop.interface scaling-factor | cut -d " " -f 2)
#!/usr/bin/env bash
# Enable / Disable 2x Scaling for GNOME easily and quickly.
main() {
if [ -z "$1" ]; then
usage
exit 1
fi
if [[ "$1" == "on" ]]; then
echo "Turning on scaling"
SCALE_FACTOR=2
ICON_SIZE=48
else
echo "Turning off scaling"
SCALE_FACTOR=1
ICON_SIZE=32
fi
gsettings set org.gnome.desktop.interface scaling-factor ${SCALE_FACTOR}
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "[{'Gdk/WindowScalingFactor', <${SCALE_FACTOR}>}]"
gsettings --schemadir ~/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size ${ICON_SIZE}
}
usage() {
echo "Usage: $(basename $0) on|off"
}
main ${1}
#!/bin/bash
SCALING_FACTOR=$(gsettings get org.gnome.desktop.interface scaling-factor | cut -d " " -f 2)
/usr/bin/spotify --force-device-scale-factor=${SCALING_FACTOR} $@
@mca-gif
Copy link
Author

mca-gif commented Nov 5, 2016

Instructions

  • Copy the files to your /usr/local/bin folder.

  • Run hidpi.sh on to set interface to 2x scaling.

  • Run hidpi.sh off to force no scaling.

  • Logout and log back in for the best result.

  • If you have installed Spotify the default .desktop file should launch the first instance it finds of spotify in your path, which will now be the script that controls scaling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment