diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2025-11-29 19:05:45 -0500 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2025-11-29 19:05:45 -0500 |
| commit | d5bff3fb167634f9ed5c58b95a4cffd04266e56c (patch) | |
| tree | 44df519af02502401e78d2c55ff6130f97ea7e6c | |
| parent | Add openbsd login conf (diff) | |
| download | dotfiles-d5bff3fb167634f9ed5c58b95a4cffd04266e56c.zip | |
Update x dotfiles to support desktop/laptop
| -rw-r--r-- | x/.Xresources | 13 | ||||
| -rw-r--r-- | 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 @@ -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 |