From d5bff3fb167634f9ed5c58b95a4cffd04266e56c Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 29 Nov 2025 19:05:45 -0500 Subject: Update x dotfiles to support desktop/laptop --- x/.Xresources | 13 ++++++++++++- x/.xinitrc | 41 ++++++++++++++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/x/.Xresources b/x/.Xresources index 9bf3522..1812cf5 100644 --- a/x/.Xresources +++ b/x/.Xresources @@ -6,7 +6,18 @@ xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48 xterm*eightBitInput: false xterm*allowBoldFonts: false -Xft.dpi: 120 +! Desktop settings +#ifdef SRVR_openbsd_desktop_local +*.dpi: 196 +Xft.dpi: 196 +#endif + +! Laptop settings +#ifdef SRVR_openbsd_laptop_local +*.dpi: 96 +Xft.dpi: 96 +#endif + Xft.antialias: true Xft.rgba: rgb Xft.hinting: true diff --git a/x/.xinitrc b/x/.xinitrc index 9afc800..0f8407d 100644 --- a/x/.xinitrc +++ b/x/.xinitrc @@ -1,15 +1,38 @@ #!/bin/sh set -e -export MOZ_ACCELERATED=1 -export MOZ_WEBRENDER=1 +main() { + export MOZ_ACCELERATED=1 + export MOZ_WEBRENDER=1 -xrdb -merge ~/.Xresources -setxkbmap -option caps:ctrl_modifier -setxkbmap -option altwin:swap_alt_win + xrdb -merge ~/.Xresources + setxkbmap -option caps:ctrl_modifier + setxkbmap -option altwin:swap_lalt_lwin + xinput set-prop /dev/wsmouse "Device Accel Constant Deceleration" 1.0 -~/.fehbg & -~/.config/lemonbar-xft/bar.sh | lemonbar-xft -f "Hack:size=12" -g x24 -B "#1c1c1c" -F "#d0d0d0" & -~/.local/bin/sct-daemon & + ~/.fehbg & + start_lemonbar + ~/.local/bin/sct-daemon & -exec cwm + exec cwm +} + +start_lemonbar() { + _lemonbar_fontsize="10" + _lemonbar_width="48" + if is_laptop; then + _lemonbar_fontsize="12" + _lemonbar_width="24" + fi + ~/.config/lemonbar-xft/bar.sh | + lemonbar-xft \ + -f "Hack:size=${_lemonbar_fontsize}" \ + -g x${_lemonbar_width} \ + -B "#1c1c1c" -F "#d0d0d0" & +} + +is_laptop() { + [ "$(hostname -s)" = "openbsd-laptop" ] +} + +main -- cgit v1.2.3