HiDPI and fonts

This commit is contained in:
2021-05-16 12:43:18 +01:00
parent eaa1f41744
commit 63b0af4617
11 changed files with 32 additions and 18 deletions

View File

@@ -44,7 +44,7 @@ export ELECTRUMDIR="${XDG_DATA_HOME:-$HOME/.local/share}/electrum"
# Other program settings # Other program settings
export DICS="/usr/share/stardicts/dic/" export DICS="/usr/share/stardicts/dic/"
export SUDO_ASK_PASS="$HOME/.local/bin/dmenupass" export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%" export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export LESS=-R export LESS=-R
export LESS_TERMCAP_mb="$(printf '%b' '\e[1;31m')" export LESS_TERMCAP_mb="$(printf '%b' '\e[1;31m')"

View File

@@ -3,8 +3,16 @@
# This file runs when a DM logs you into a graphical session. # This file runs when a DM logs you into a graphical session.
# If you use startx/xinit, this file will also be sourced. # If you use startx/xinit, this file will also be sourced.
# xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & # Use Xresources colors/settings on startup xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources # Use Xresources colors/settings on startup
setbg & # set the background
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/.DPI" ]; then
DPI="$(cat "${XDG_CONFIG_HOME:-$HOME/.config}/x11/.DPI")"
echo "Xft.dpi: $DPI" | xrdb -merge
xrandr --dpi "$DPI"
fi
setbg ~/Scarif/Pictures/Wallpapers/Dual\ 4K & # set the background
enpass & # start password manager
xcompmgr & # xcompmgr for transparency xcompmgr & # xcompmgr for transparency
dunst & # dunst for notifications dunst & # dunst for notifications
xset r rate 300 50 & # Speed xrate up xset r rate 300 50 & # Speed xrate up

View File

@@ -1,8 +1,8 @@
!! Transparency (0-1): !! Transparency (0-1):
*.alpha: 0.8 *.alpha: 0.9
!! Set a default font and font size as below: !! Set a default font and font size as below:
*.font: FiraCode:size=15 *.font: FiraCode:size=13
/* name dark light */ /* name dark light */
/* black 0 8 */ /* black 0 8 */

View File

@@ -16,9 +16,11 @@ case "$(file --mime-type -b "$trueloc")" in
*) notify-send "Error" "Not a valid image." ; exit 1;; *) notify-send "Error" "Not a valid image." ; exit 1;;
esac esac
[ -z "$trueloc" ] && trueloc="$(readlink -f "$bgloc")"
# If pywal is installed, use it. # If pywal is installed, use it.
command -v wal >/dev/null 2>&1 && command -v wal >/dev/null 2>&1 &&
wal -i "$trueloc" -n -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 && wal -i "$trueloc" -n -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 &&
pidof dwm >/dev/null && xdotool key super+F12 dwmc xrdb
xwallpaper --zoom "$bgloc" xwallpaper --zoom "$bgloc"

View File

@@ -1,4 +0,0 @@
#! /bin/bash
# Scale up the GUI by 2 times for HiDPI screens
sed -i '/\[JavaOptions\]/a -Dsun.java2d.uiScale=2' /opt/maptool/lib/app/MapTool.cfg

8
.local/bin/setup/setupmaptool Executable file
View File

@@ -0,0 +1,8 @@
#! /bin/bash
# Scale up the GUI by 2 times for HiDPI screens
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/.DPI" ]; then
DPI="$(cat "${XDG_CONFIG_HOME:-$HOME/.config}/x11/.DPI")"
SCALE="$(((DPI+48)/96))"
sudo -A sed -i "/\[JavaOptions\]/a -Dsun.java2d.uiScale=$SCALE" /opt/maptool/lib/app/MapTool.cfg
fi

View File

@@ -8,14 +8,14 @@ case "$(readlink -f /sbin/init)" in
*openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p 0" ;; *openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p 0" ;;
esac esac
cmds="\ cmds="\
🔒 lock slock lock slock
🚪 leave dwm kill -TERM $(pgrep -u $USER "\bdwm$") leave dwm dwmc quit
renew dwm kill -HUP $(pgrep -u $USER "\bdwm$") renew dwm dwmc restart
🐻 hibernate slock ${hib:-systemctl suspend-then-hibernate -i} hibernate slock ${hib:-systemctl suspend-then-hibernate -i}
🔃 reboot ${reb:-sudo -A reboot} reboot ${reb:-sudo -A reboot}
🖥 shutdown ${shut:-sudo -A shutdown -h now} shutdown ${shut:-sudo -A shutdown -h now}"
📺 display off xset dpms force off"
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1 choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1