Last active
February 22, 2020 01:54
-
-
Save luoxufeiyan/2c2a670889949f87fbfc350bb566fbd4 to your computer and use it in GitHub Desktop.
Rescale between laptop built-in monitor and external hi-dpi monitor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ref: https://plumz.me/archives/10034/ | |
xrandr --query | grep ' connected' | grep 2560 > /dev/null | |
result=$? | |
if [ $result -ne 0 ]; then | |
# HD | |
# gsettings set org.gnome.nautilus.icon-view default-zoom-level standard | |
# gsettings set org.gnome.desktop.interface cursor-size 24 | |
echo "Got" | |
eval dconf write /org/cinnamon/desktop/interface/scaling-factor "'uint32 1'" | |
eval dconf write /org/gnome/desktop/interface/scaling-factor "'uint32 1'" | |
eval dconf write /org/cinnamon/active-display-scale "1" | |
# Qt | |
export QT_SCREEN_SCALE_FACTORS=1 | |
export QT_AUTO_SCREEN_SCALE_FACTOR=1 | |
pidof fcitx | xargs kill | |
pidof nemo-desktop | xargs kill | |
nohup fcitx 1>/dev/null 2>/dev/null & | |
nohup nemo-desktop 1>/dev/null 2>/dev/null & | |
else | |
# WQHD | |
# For mint | |
eval dconf write /org/cinnamon/desktop/interface/scaling-factor "'uint32 2'" | |
eval dconf write /org/gnome/desktop/interface/scaling-factor "'uint32 2'" | |
eval dconf write /org/cinnamon/active-display-scale "1.5" | |
# Qt | |
export QT_SCREEN_SCALE_FACTORS=1.5 | |
export QT_AUTO_SCREEN_SCALE_FACTOR=0 | |
pidof fcitx | xargs kill | |
pidof nemo-desktop | xargs kill | |
nohup fcitx 1>/dev/null 2>/dev/null & | |
nohup nemo-desktop 1>/dev/null 2>/dev/null & | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment