dotfiles

Configuration for the software I use.
git clone https://git.sr.ht/~jbauer/dotfiles
Log | Files | Refs | README | LICENSE

commit f4570c29e8d7605a0aa924ec53ce1d1d7173a78e
parent 6e21d35c34ac58bdcc359601a5311bd15eea06c7
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Wed, 24 Aug 2022 16:45:59 -0400

Update dotfiles from new OpenBSD install

Diffstat:
M.Xresources | 14+++++++++++---
A.config/picom/picom.conf | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M.config/shrc | 2+-
M.config/spectrwm/spectrwm.conf | 22+++++++++-------------
A.local/bin/bar-action | 10++++++++++
M.xsession | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++------
Msetup.sh | 12++++++++++--
7 files changed, 151 insertions(+), 25 deletions(-)

diff --git a/.Xresources b/.Xresources @@ -1,11 +1,19 @@ -Xcursor.theme: Paper -Xcursor.size: 48 -*.font: xft:IBM Plex Mono:size=14 +#ifdef HIDPI +Xcursor.size: 48 +*.font: xft:IBM Plex Mono:size=18,xft:noto emoji:size=18 +xft.dpi: 164 +*.internalBorder: 28 +#else +*.font: xft:IBM Plex Mono:size=10,xft:noto emoji:size=10 +*.internalBorder: 12 +#endif +Xcursor.theme: Paper *.selectToClipboard: true *.termName: xterm-256color *.loginShell: true *.scrollBar: false +*.saveLines: 20000 ! special *.foreground: #DDDDDD diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf @@ -0,0 +1,57 @@ +#+----------------------------------------+ +#| Backend | +#+----------------------------------------+ +backend="glx"; # (xrender|glx|xr_glx_hybrid) + +glx-no-stencil=true; +glx-no-rebind-pixmap=true; +use-damage=true; + +#+----------------------------------------+ +#| Shadows | +#+----------------------------------------+ +shadow=true; +shadow-radius=12; +shadow-offset-x=-15; +shadow-offset-y=-8; +shadow-opacity=0.85; + +shadow-red=0.1 +shadow-green=0.1 +shadow-blue=0.1 + +shadow-ignore-shaped=true; + +#+----------------------------------------+ +#| Opacity, Blur, and Fading | +#+----------------------------------------+ +inactive-dim=0.2 +opacity-rule = [ + "85:class_g = 'XTerm'" +]; + +#+----------------------------------------+ +#| Other Options | +#+----------------------------------------+ +detect-rounded-corners=true; +detect-client-opacity=true; +detect-transient=true; +detect-client-leader=true; +vsync=true; +# Unredirect all windows if a full-screen opaque window is detected, to +# maximize performance for full-screen windows, like games. +unredir-if-possible=true; + +#+----------------------------------------+ +#| Window Type Settings | +#+----------------------------------------+ +wintypes: +{ + tooltip = + { + fade=false; + shadow=false; + opacity=1; + focus=true; + }; +}; diff --git a/.config/shrc b/.config/shrc @@ -17,7 +17,7 @@ watch() { } # Aliases -alias ls='ls -laF' +alias ls='ls -lF' alias rm='rm -iv' alias cp='cp -iv' alias mv='mv -iv' diff --git a/.config/spectrwm/spectrwm.conf b/.config/spectrwm/spectrwm.conf @@ -1,17 +1,13 @@ -# Names -name = ws[1]:Console -name = ws[2]:Browser -name = ws[10]:KeepassXC - # Bar -bar_font = -*-terminus-medium-*-*-*-14-*-*-*-*-*-*-*,IBMPlexMono:size=14 -bar_border = black -bar_format = +@fn=1; +I:+D +S +C +|R+@fn=1;%A, %d-%b-%Y, %H:%M -bar_color_selected = rgb:ee/ee/ee +bar_enabled = 0 +bar_border_width = 0 +bar_font = IBMPlexMono:size=10 +bar_format = +@fn=1; +I:+D +S +C +|R+@fn=1;%A, %d-%b-%Y, %H:%M -# Look -border_width = 2 -color_focus = rgb:ee/ee/ee +# Look & Feel +border_width = 0 +tile_gap = 10 +region_padding = 10 # Programs program[scrot] = flameshot gui @@ -31,7 +27,7 @@ bind[swap_main] = MOD+Shift+Return bind[ws_prior] = Mod1+Tab bind[scrot] = MOD+p bind[scrot_full] = MOD+Shift+p -bind[calc] = XF86Calculator +bind[calc] = MOD+c # Quirks quirk[Mate-calc] = FLOAT + FOCUSPREV diff --git a/.local/bin/bar-action b/.local/bin/bar-action @@ -0,0 +1,10 @@ +#!/bin/sh + +while :; do + vmstats=$(vmstat -c2 | tail -1) + cpu=$(echo $vmstats | awk {'print 100-$18'}) + mem=$(echo $vmstats | awk {'print $3'}) + bat=$(apm -l) + echo "cpu: $cpu% | mem: $mem | bat: $bat " + sleep 1 +done diff --git a/.xsession b/.xsession @@ -1,12 +1,59 @@ -export PATH=$HOME/.local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games -export QT_QPA_PLATFORMTHEME="qt5ct" +#!/bin/sh -x + +cleanup() { + echo "Cleaning up..." + pkill dbus-daemon picom xbanish + rm -f ~/.Xauthority + rm -f ~/*.core + rm -rf ~/.local/share/Trash +} +trap cleanup INT TERM QUIT + export LANG=en_US.UTF-8 +export PATH=$HOME/.local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games export ENV="$HOME/.config/shrc" -export XCURSOR_SIZE=48 -export GDK_SCALE=2 -export EDITOR=nvim +export QT_QPA_PLATFORMTHEME="qt5ct" + +# DPI-dependent options +SCREEN_WIDTH=$(xrandr | grep "Screen 0: minimum" | sed -e 's/.*, current //' -e 's/ x.*//') +if [ "$SCREEN_WIDTH" -gt 1920 ]; then + echo "Screen width is $SCREEN_WIDTH, using HIDPI" + export HIDPI=1 + export QT_SCALE_FACTOR=2 + export XCURSOR_SIZE=48 + export GDK_SCALE=2 +fi + +# Load Xresources +if [ "$HIDPI" -eq 1 ]; then + xrdb -DHIDPI=1 < ~/.Xresources +else + xrdb < ~/.Xresources +fi +# No bell xset -b + +# No mouse acceleration +xset m 0 0 + +# CapsLock is compose key setxkbmap -option "compose:caps" -xrdb -merge ~/.Xresources + +# Launch DBUS for programs which need it +eval `dbus-launch --sh-syntax` + +# Compositor +picom -b + +# Hide cursor when typing +xbanish -i all & + +# Set background +xsetroot -solid grey + +# Launch WM and block spectrwm + +# Run cleanup function on exit +cleanup diff --git a/setup.sh b/setup.sh @@ -2,13 +2,19 @@ set -e -chmod 750 ~ +chmod 700 ~ # Remove stuff OpenBSD adds by default that I don't need rm -f ~/.cshrc ~/.cvsrc ~/.login ~/.mailrc ~/.Xdefaults ~/.profile # Create directory structure -mkdir -p ~/Documents/projects ~/Documents/notes ~/Downloads ~/NAS ~/.ssh +mkdir -p \ + ~/Documents/projects \ + ~/Music \ + ~/Pictures \ + ~/Downloads \ + ~/NAS \ + ~/.ssh # Clone dotfiles and apply them to the system git clone https://git.sr.ht/~jbauer/dotfiles ~/Documents/projects/dotfiles @@ -16,3 +22,5 @@ cd ~/Documents/projects/dotfiles for file in .????*; do cp -r "$file" ~ done + +echo "Don't forget to run 'rcctl enable apmd; rcctl set apmd flags -A -Z 10; rcctl start apmd' if on a laptop."