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/.xinitrc | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'x/.xinitrc') 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