- I’m not responsible for any system breakage due to my code.
- If you’re unsure, refer to THE LICENSE to see how seriously I take this.
- Use with caution.
- While there *is* a setup script in this project,
it's not meant to be plug-and-play
. It’s a bare-bones setup that is fairly non-portable and will require some tinkering to work perfectly. I don’t see this as a problem because I’m comfortable customizing it to my needs.
- My script doesn’t perform any performance tweaking. Users should refer to the FAQ, manpages, or the unofficial OpenBSD Handbook for that.
- For more of a newb-friendly (albeit detailed) explanation video of some optimization tricks, Watch The OpenBSD Guy’s Video
- for laptops, I highly recommend solene%’s power management daemon obsdfreqd
- When the script installs dependencies, always choose the latest version when given a version choice from
pkg_add
.
- DISCLAIMER
- Shameless Unixporn for internet points.
- Crucial Information
- Note:
- How To Use
- Rexfile
- Misc Stuffs
please read the DISCLAIMER, I am not your mom.
- Install OpenBSD on a machine with these specs
>=42GB Install Disklabel Size (minimum reccomended) >=4GB in / (you need this cos /tmp resides here by default, and my icons and gtk themes will clone here during setup) >=4GB in /usr (you can get by with 1 single root partiton too, but its probably more ideal to break things up for ramdisk purposes) >=24GB in /usr/local (same here as /usr, but even more important) 4gb or more RAM 4 logical cores or more OpenGL >=2.0 Capable GFX Card
- Switch to -CURRENT
# sysupgrade -sn
- Add
:doas
group
# groupadd doas # usermod -G wheel,operator,doas [your username]
- Add user to staff login class
# usermod -L staff [your username]
- grab my doas and sysctl configs
# ftp -o /etc/doas.conf https://github.com/izder456/dotfiles/raw/main/doas.conf # ftp -o /etc/sysctl.conf https://github.com/izder456/dotfiles/raw/main/sysctl.conf
- reboot, let sysupgrade finish, and merge changes:
# reboot
# sysmerge -d
- We Need Perl’s Rex Library
# pkg_add p5-Rex
- Download and run
setup.pl
as your regular user
$ cd $HOME $ ftp https://github.com/izder456/dotfiles/raw/main/setup.pl $ perl setup.pl
- enable dbus (my StumpWM config needs it)
# rcctl enable messagebus
- Reboot again
# reboot
This is an automation thingy I use. It’s definitely overkill, but I like perl.
The initial setup for Perl.
use 5.36.0;
use warnings;
use experimental qw( switch );
use 5.36.0;
use Rex -feature => ['1.4'];
# Constants
my $USERHOME = $ENV{HOME};
my $GITHUB = "https://github.com";
my $SLEEPTIME = 2;
my $LOG_FILE = "/tmp/setup.log";
# Set PATH explicitly
$ENV{'PATH'} = '/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:$HOME/bin';
# No Magic
my $USERHOME = "$ENV{HOME}";
my $GITHUB = "https://github.com";
# Set PATH explicitly
$ENV{'PATH'} =
'/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:$HOME/bin';
# Log setup messages with timestamp
sub setup_log {
my ($message) = @_;
my $timestamp = gmtime();
open my $fh, '>>', $LOG_FILE or die "Could not open $LOG_FILE: $!";
print "[${timestamp}] $message\n";
print $fh "[${timestamp}] $message\n";
close $fh;
}
# Clean unnecessary files
sub clean {
setup_log("Removing Cruft...");
system('rex remove_default_cruft') == 0 or die "Failed to remove cruft\n";
}
# Ensure Lisp environment is set up
sub ensure_lisp {
setup_log("Quicklisp Setup");
system("doas pkg_add -m sbcl rlwrap") == 0 or die "Failed to install sbcl and rlwrap\n";
system("ftp -o /tmp/quicklisp.lisp https://beta.quicklisp.org/quicklisp.lisp") == 0 or die "Failed to download quicklisp.lisp\n";
system("ftp -o /tmp/quicklisp-setup.lisp $GITHUB/izder456/dotfiles/raw/main/quicklisp-setup.lisp") == 0 or die "Failed to download quicklisp-setup.lisp\n";
system("sbcl --load /tmp/quicklisp.lisp --script /tmp/quicklisp-setup.lisp") == 0 or die "Failed to run quicklisp setup\n";
}
# Install port dependencies
sub ports_deps {
setup_log("Installing port dependencies...");
system("doas pkg_add -m -l ~/.pkglist") == 0 or die "Failed to install port dependencies\n";
}
# Install cargo dependencies
sub cargo_deps {
setup_log("Installing cargo dependencies...");
system("doas pkg_add rust") == 0 or die "Failed to install Rust\n";
system("xargs cargo install < ~/.cargolist") == 0 or die "Failed to install cargo dependencies\n";
}
# Clone or update dotfiles repository and run setup scripts
sub config_install {
setup_log("Cloning/Installing Dotfiles...");
if (-d "$USERHOME/.dotfiles") {
chdir("$USERHOME/.dotfiles") or die "Failed to change directory to .dotfiles\n";
system("git pull --recurse-submodules --depth 1") == 0 or die "Failed to pull dotfiles\n";
} else {
system("git clone --depth 1 --recurse-submodules $GITHUB/Izder456/dotfiles.git $USERHOME/.dotfiles") == 0 or die "Failed to clone dotfiles\n";
}
system('rex configure_gtk');
system('rex configure_icons');
system("$USERHOME/.dotfiles/dfm/dfm install");
system('doas cp ~/.dotfiles/doas.conf /etc/doas.conf');
}
# Setup FiZSH shell
sub setup_shell {
setup_log("Setting up FiZSH...");
system('rex configure_default_shell');
system('rex compile_afetch');
}
# Setup background images
sub setup_backgrounds {
setup_log("Installing Backgrounds...");
system('rex install_backgrounds');
}
# Setup Emacs
sub setup_emacs {
setup_log("Setting up Emacs...");
system('rex configure_emacs');
}
# Setup Enhanced Motif WM
sub setup_emwm {
setup_log("Setting up Enhanced Motif WM...");
system('rex configure_emwm');
}
# Setup StumpWM
sub setup_stumpwm {
ensure_lisp();
setup_log("Setting up StumpWM...");
system('rex configure_stumpwm');
}
# Miscellaneous setup tasks
sub setup_misc {
setup_shell();
setup_log("Miscellaneous setup...");
system('rex compile_shuf');
system('rex compile_slock');
system('rex compile_st');
system('rex compile_surf');
system('rex compile_nxbelld');
system('rex configure_apmd');
system('rex install_backgrounds');
system('rex update_xdg_user_dirs');
}
# Setup XenoDM
sub setup_xenodm {
setup_log("Setting up XenoDM...");
rex configure_xenodm
}
# Check for internet connection
sub is_internet_up {
setup_log("Checking internet connection...");
system("nc -zw1 OpenBSD.org 443") == 0 or return 1;
setup_log("Internet connection is up!");
return 0;
}
# Ensure necessary tools are installed
sub ensure_needed {
setup_log("Installing necessary tools: git and p5-Rex...");
system("doas pkg_add -m p5-Rex git") == 0 or die "Failed to install git and p5-Rex\n";
system("ftp -o \"$USERHOME/Rexfile\" $GITHUB/Izder456/dotfiles/raw/main/Rexfile") == 0 or die "Failed to download Rexfile\n";
}
# Ensure all prerequisites
sub do_ensure {
is_internet_up() == 0 or die "No internet connection\n";
ensure_needed();
}
do_ensure();
# Menu header text
my $HEADER_TEXT = <<'EOF';
Srcerizder Dotfiles Setup
Options:
--------------------------
1) Ports 4) StumpWM
2) Cargo 5) Emacs
3) Emwm 6) Xenodm
7) Config 8) Misc
9) Clean:
Other Options:
----------------
a) All (Recommended)
r) Reload Menu
q) Quit
EOF
# Display menu and handle user input
sub menu {
while (1) {
system("clear");
print $HEADER_TEXT;
print "Enter your selection: "; # Move the input prompt to the same line
my $selection = <STDIN>;
chomp $selection;
$selection ||= "r";
{
no warnings;
given($selection) {
when("1") { print("Selected Ports Deps...\n"); sleep($SLEEPTIME); ports_deps(); }
when("2") { print("Selected Cargo Deps...\n"); sleep($SLEEPTIME); cargo_deps(); }
when("3") { print("Selected Emwm Config...\n"); sleep($SLEEPTIME); setup_emwm(); }
when("4") { print("Selected StumpWM Config...\n"); sleep($SLEEPTIME); setup_stumpwm(); }
when("5") { print("Selected Emacs Config...\n"); sleep($SLEEPTIME); setup_emacs(); }
when("6") { print("Selected XenoDM Config...\n"); sleep($SLEEPTIME); setup_xenodm(); }
when("7") { print("Selected Install Configs...\n"); sleep($SLEEPTIME); config_install(); }
when("8") { print("Selected Misc Setup...\n"); sleep($SLEEPTIME); setup_misc(); }
when("9") { print("Selected Clean...\n"); sleep($SLEEPTIME); clean(); }
when("a") { print("Running All...\n"); sleep($SLEEPTIME); clean(); config_install(); ports_deps(); cargo_deps(); setup_emwm(); setup_stumpwm(); setup_emacs(); setup_xenodm(); setup_misc(); }
when("r") { next; }
when("q") { print("\n"); exit; }
default { print("\nInvalid selection\n"); sleep(1); }
}
}
}
}
menu();
I don’t need some of these defaults
# task to clean home dir
task 'remove_default_cruft', sub {
unlink(
"$USERHOME/.cshrc", "$USERHOME/.login", "$USERHOME/.mailrc",
"$USERHOME/.profile", "$USERHOME/.Xdefaults", "$USERHOME/.cvsrc"
);
system( 'doas', 'chmod', '0700', "$USERHOME" );
};
This is a zsh frontend, that emulates the functionality of fish
# Configures and sets up the default shell
task 'configure_default_shell', sub {
my %plugins = (
"zsh-openbsd" => "$GITHUB/sizeofvoid/openbsd-zsh-completions.git",
"zsh-completions" => "$GITHUB/zsh-users/zsh-completions.git",
"zsh-fzf" => "$GITHUB/Aloxaf/fzf-tab.git",
"zsh-suggest" => "$GITHUB/zsh-users/zsh-autosuggestions.git",
"zsh-256" => "$GITHUB/chrissicool/zsh-256color.git",
"zsh-fsh" => "$GITHUB/zdharma-continuum/fast-syntax-highlighting.git"
);
keys %plugins;
while (my($k, $v) = each %plugins) {
my $clonedir = "$USERHOME/.$k";
my $cloneuri = "$v";
if ( -d $clonedir ) {
chdir "$clonedir";
system( 'git', 'pull' );
} else {
system( 'git', 'clone', "$cloneuri", "$clonedir" );
}
}
# Grab fizsh src setup
if ( -d "$USERHOME/.fizsh" ) {
chdir "$USERHOME/.fizsh";
} else {
system( 'git', 'clone', "$GITHUB/zsh-users/fizsh.git", "$USERHOME/.fizsh" );
chdir "$USERHOME/.fizsh";
}
system( './configure' );
system( 'make' );
system( 'doas', 'make', 'install' );
system( 'cp', "$USERHOME/.dotfiles/.fizshrc", "$USERHOME/.fizsh/.fizshrc" );
system( 'chsh', '-s', '/usr/local/bin/fizsh' );
};
task 'configure_gtk', sub {
my %gtk = (
"gruvbox-square-gtk" => "$GITHUB/jmattheis/gruvbox-dark-gtk.git",
"gruvbox-round-gtk" => "$GITHUB/Fausto-Korpsvart/Gruvbox-GTK-Theme.git",
"gruvbox-plus-gtk" => "$GITHUB/SylEleuth/gruvbox-plus-gtk.git",
);
keys %gtk;
while (my($k, $v) = each %gtk) {
my $clonedir = "/tmp/$k";
my $cloneuri = "$v";
if ( -d "$clonedir" ) {
chdir "$clonedir";
system( 'git', 'pull' );
} else {
system( 'git', 'clone', "$cloneuri", "$clonedir" );
}
if ( -d "$clonedir/themes" ) {
system( 'cp', '-R', glob("$clonedir/themes/*"), "$USERHOME/.dotfiles/.themes/" );
} elsif ( -d "$clonedir/Gruvbox-Plus-Dark" ) {
system( 'cp', '-R', "$clonedir/Gruvbox-Plus-Dark", "$USERHOME/.dotfiles/.themes/" );
} else {
system( 'cp', '-R', "$clonedir", "$USERHOME/.dotfiles/.themes/" );
}
unlink("$clonedir");
}
};
task 'configure_icons', sub {
my %icons = (
"gruvbox-round-icons" => "$GITHUB/Fausto-Korpsvart/Gruvbox-GTK-Theme.git",
"gruvbox-square-icons" => "$GITHUB/jmattheis/gruvbox-dark-icons-gtk.git",
"gruvbox-plus-icons" => "$GITHUB/SylEleuth/gruvbox-plus-icon-pack.git",
);
keys %icons;
while (my($k, $v) = each %icons) {
my $clonedir = "/tmp/$k";
my $cloneuri = "$v";
if ( -d "$clonedir" ) {
chdir "$clonedir";
system( 'git', 'pull' );
} else {
system( 'git', 'clone', "$cloneuri", "$clonedir" );
}
if ( -d "$clonedir/icons" ) {
system( 'cp', '-R', glob("$clonedir/icons/*"), "$USERHOME/.dotfiles/.icons/" );
} elsif ( -d "$clonedir/Gruvbox-Plus-Dark" ) {
system( 'cp', '-R', "$clonedir/Gruvbox-Plus-Dark", "$USERHOME/.dotfiles/.icons/" );
} else {
system( 'cp', '-R', "$clonedir", "$USERHOME/.dotfiles/.icons/" );
}
unlink("$clonedir");
}
};
I use Emacs, btw
# Configures and installs emacs
task 'configure_emacs', sub {
if ( -d "$USERHOME/.emacs.d" ) {
chdir "$USERHOME/.emacs.d";
} else {
system( 'ln', '-sf', "$USERHOME/.dotfiles/Emacs-Config", "$USERHOME/.emacs.d" );
}
};
Yeah, this weird WM…
task 'configure_stumpwm', sub {
if ( -d "$USERHOME/.stumpwm.d" ) {
chdir "$USERHOME/.stumpwm.d";
} else {
system( 'ln', '-sf', "$USERHOME/.dotfiles/StumpWM-Config", "$USERHOME/.stumpwm.d" );
}
};
Yeah, I sometime float things
task 'configure_emwm', sub {
system( 'ln', '-sf', "$USERHOME/.dotfiles/Emwm-Config/.emwmrc", "$USERHOME/.emwmrc" );
system( 'ln', '-sf', "$USERHOME/.dotfiles/Emwm-Config/.toolboxrc", "$USERHOME/.toolboxrc" );
system( 'mkdir', '-p', "$USERHOME/.xresources.d" );
system( 'ln', '-sf', "$USERHOME/.dotfiles/Emwm-Config/.xresources", "$USERHOME/.xresources.d/emwm" );
};
Because XDM wasn’t cutting it…
# Installs backgrounds to /usr/local/share/backgrounds
task 'install_backgrounds', sub {
system( 'doas', 'mkdir', '-p', '/usr/local/share/backgrounds' );
system( 'doas', 'cp', '-R', glob("$USERHOME/.dotfiles/backgrounds/*"), '/usr/local/share/backgrounds' );
};
# Sets up Xenodm configuration
task 'configure_xenodm', sub {
system( 'doas', 'cp', '-R', glob("$USERHOME/.dotfiles/XenoDM-Config/*"), '/etc/X11/xenodm/' );
};
Setup Laptop Slock shell-close autohook
task 'configure_apmd', sub {
system( 'doas', 'mkdir', '/etc/apm' );
system( 'doas', 'cp', '-R', glob("$USERHOME/.dotfiles/APM-Config/*"), '/etc/apm/' );
};
Extra stuff thats not in ports, cargo or base
# Compiles shuf re-implementation
task 'compile_shuf', sub {
system( 'git', 'clone', "$GITHUB/ibara/shuf.git", "$USERHOME/.shuf" );
chdir "$USERHOME/.shuf";
system( './configure' );
system( 'make' );
system( 'doas', 'make', 'install' );
};
# Compiles in my Slock Setup
task 'compile_slock', sub {
system( 'git', 'clone', "$GITHUB/Izder456/slock.git", "$USERHOME/.slock" );
chdir "$USERHOME/.slock";
system( 'make' );
system( 'doas', 'make', 'install' );
};
# Compiles in my SURF Setup
task 'compile_surf', sub {
system( 'git', 'clone', "$GITHUB/Izder456/surf.git", "$USERHOME/.surf-src" );
chdir "$USERHOME/.surf-src";
system( 'make' );
system( 'doas', 'make', 'install' );
};
# Compiles in my ST Setup
task 'compile_st', sub {
system( 'git', 'clone', "$GITHUB/Izder456/st.git", "$USERHOME/.st" );
chdir "$USERHOME/.st";
system( 'make' );
system( 'doas', 'make', 'install' );
};
# Compiles afetch
task 'compile_afetch', sub {
system( 'git', 'clone', "$GITHUB/13-CF/afetch.git", "$USERHOME/.afetch" );
chdir "$USERHOME/.afetch";
system( 'make' );
system( 'doas', 'make', 'install' );
};
task 'compile_nxbelld', sub {
$ENV{'AUTOCONF_VERSION'} = "2.69";
$ENV{'AUTOMAKE_VERSION'} = "1.16";
system( 'git', 'clone', "$GITHUB/dusxmt/nxbelld.git", "$USERHOME/.nxbelld" );
chdir "$USERHOME/.nxbelld";
system('autoreconf -i');
system( './configure', '--prefix', "$USERHOME/.local");
system( 'gmake' );
system( 'gmake', 'install' );
};
Setup Homedir Paths
# Updates XDG user directories
task 'update_xdg_user_dirs', sub {
system( 'xdg-user-dirs-update' );
system( 'mkdir', "$USERHOME/Projects" );
system( 'doas', 'gdk-pixbuf-query-loaders', '--update-cache' );
};
random scripts and configs that are maybe relevant possibly.
You probably want this if you want to write with StumpWM and modules…
(quicklisp-quickstart:install :path "~/.quicklisp")
(ql:add-to-init-file)
(ql-dist:install-dist "http://dist.ultralisp.org/"
:prompt nil)
(ql:quickload '("clx"
"cl-ppcre"
"alexandria"
"cl-fad"
"xembed"
"anaphora"
"drakma"
"slynk"))
USE:
$ ftp -o /tmp/quicklisp.lisp https://beta.quicklisp.org/quicklisp.lisp
$ ftp -o /tmp/quicklisp-setup.lisp https://github.com/Izder456/raw/main/quicklisp-setup.lisp
$ sbcl --load /tmp/quicklisp.lisp --script /tmp/quicklisp-setup.lisp
The settings for X session, resources, and profile.
!!
! Includes
!!
#include ".xresources.d/colors"
#include ".xresources.d/apps"
!!
! XWindow Stuffs
!!
*imLocale: en_US.UTF-8
!!
! Font Rendering Stuffs
!!
Xft.dpi: 96
Xft.rgba: rgb
Xft.antialias: true
Xft.autohint: false
Xft.hintstyle: hintfull
Xft.lcdfilter: lcddefault
*faceName: Spleen
*faceSize: 12
!!
! Pointer Stuffs
!!
Xcursor.size: 16
Xcursor.theme: Capitaine Cursors (Gruvbox) - White
!!
! Background Colors
!!
! Normal
*background: #282828
*foreground: #ebdbb2
! Hard-Dark
*.activeBackground: #1d2021
*.activeForeground: #32302f
! Highlight
*highlightColor: #fcf1c7
!!
! Gruvbox Colors
!!
! Black + DarkGrey
*color0: #282828
*color8: #928374
! DarkRed + Red
*color1: #cc241d
*color9: #fb4934
! DarkGreen + Green
*color2: #98971a
*color10: #b8bb26
! DarkYellow + Yellow
*color3: #d79921
*color11: #fabd2f
! DarkBlue + Blue
*color4: #458588
*color12: #83a598
! DarkMagenta + Magenta
*color5: #b16286
*color13: #d3869b
! DarkCyan + Cyan
*color6: #689d6a
*color14: #8ec07c
! LightGrey + White
*color7: #a89984
*color15: #ebdbb2
!!
! Gruvbox 256color
!!
! BrightBlue
*color24: #076678
! BrightAqua
*color66: #427b58
! BrightRed
*color88: #9d0006
! BrightMagenta
*color96: #8f3f71
! BrightGreen
*color100: #79740e
! DimBlue
*color109: #83a598
! DimAqua
*color108: #8ec07c
! DimRed
*color130: #af3a03
! DimYellow
*color136: #b57614
! DimGreen
*color142: #b8bb26
! DimRed
*color167: #fb4934
! DimMagenta
*color175: #d3869b
! Orange
*color208: #fe8019
! BrightYellow
*color214: #fabd2f
!! fg0-fg3
*color223: #ebdbb2
*color228: #f2e5bc
*color229: #fbf1c7
*color230: #f9f5d7
!! bg0-bg3
*color234: #1d2021
*color235: #282828
*color236: #32302f
*color237: #3c3836
!! Gray0-Gray7
*color239: #504945
*color241: #665c54
*color243: #7c6f64
*color244: #928374
*color245: #928374
*color246: #a89984
*color248: #bdae93
*color250: #d5c4a1
!!
! XMessage
!!
xmessage*background: #1d2021
xmessage*foreground: #fbf1c7
xmessage.borderWidth: 1
xmessage*borderColor: #ebdbb2
xmessage*message.scrollHorizontal: Never
xmessage*message.scrollVertical: Never
xmessage*timeout: 0
xmessage*printValue: false
xmessage*font: -misc-spleen-medium-r-normal--16-160-72-72-c-80-iso10646-1
!!
! XTerm
!!
*intensityStyles: true
*allowSendEvents: true
xterm*scrollBar: false
xterm*faceName: Spleen
xterm*faceSize: 12
xterm*renderFont: true
xterm*internalBorder: 12
xterm*letterSpace: 1
xterm*loginShell: true
xterm*savelines: 16384
!!
! XClock Stuffs
!!
XClock*Background: #32302f
XClock*Foreground: #ebdbb2
#!/bin/ksh
# Define variables at the top for easy access
XMESG_WIDTH=512
XMESG_HEIGHT=128
# Set environment up, .xprofile isn't respected
# Set Default LOCALE
export LC_CTYPE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
# Enable HWACCEL for Firefox
export MOZ_ACCELERATED=1
export MOZ_WEBRENDER=1
# set qt apps to use kvantum widgets if avail
export QT_STYLE_OVERRIDE=kvantum
# make sdl mouse cursor lag go away
export SDL_VIDEO_X11_DGAMOUSE=0
# set XDG stuff
function xdg_runtime {
export XDG_RUNTIME_DIR=/tmp/run/$(id -u)
export XDG_CONFIG_HOME=$HOME/.config
export XDG_CACHE_HOME=$HOME/.cache
export XDG_DATA_DIR=$HOME/.local/share
export XDG_STATE_HOME=$HOME/.local/state
export XDG_CURRENT_DESKTOP=StumpWM
export DESKTOP_SESSION=stumpwm
if [ ! -d $XDG_RUNTIME_DIR ]; then
mkdir -m 700 -p $XDG_RUNTIME_DIR
fi
}
# Function to get screen dimensions
function get_screen_dimension {
typeset dimension=$(xdpyinfo | awk '/dimensions/ {print $2}')
case $1 in
0) echo "${dimension%x*}" ;;
1) echo "${dimension#*x}" ;;
*) echo "Invalid argument. Use 0 for width or 1 for height." ;;
esac
}
# Function to load environment
function load_environment {
set -A files "$@"
for file in "${file[@]}"; do
if [ -f "$file" ]; then
. "$file"
fi
done
}
# Function to load resources
function load_resources {
set -A resources "$@"
for resource in "${resources[@]}"; do
if [ -f "$resource" ]; then
xrdb -merge "$resource"
fi
done
}
# Function to manage autostarts
function manage_autostarts {
for process in "$@"; do
process_name="${process% *}"
if pgrep "$process_name" > /dev/null; then
pkill "$process_name"
fi
eval "$process"
done
}
# Function to select a window manager
function select_wm {
# WM Session Prompt
typeset xwidth=$(get_screen_dimension 0)
typeset xheight=$(get_screen_dimension 1)
typeset xmesg_xpos=$((($xwidth - $XMESG_WIDTH) / 2))
typeset xmesg_yoffset=$((($xheight - $XMESG_HEIGHT) / 2))
xmessage "Please Choose a Session to load" \
-buttons "StumpWM[]":1,"EMWM[]":2 \
-geometry ${XMESG_WIDTH}x${XMESG_HEIGHT}+${xmesg_xpos}-${xmesg_yoffset}
typeset choice=$?
case ${choice} in
1) wm=$(command -v stumpwm)
wm_args="--disable-ldb --lose-on-corruption"
;;
2) wm=$(command -v xmsm)
wm_args=""
;;
esac
dbus-launch --exit-with-session "${wm}" "${wm_args}"
}
# Load in environment & resources
load_environment /etc/xprofile ~/.xprofile
load_resources ~/.xresources ~/.xresources.d/emwm
# Autostarts
manage_autostarts "picom -b" \
"~/.local/bin/nxbelld -t 150 -v100 -d200 -f ~/.local/sfx/Funk.wav -b " \
"feh --bg-fill --randomize /usr/local/share/backgrounds &" \
"sleep 5 && dunst &" \
"ulimit -Sc 0" \
"xidle -delay 5 -nw -program /usr/local/bin/slock -timeout 1800 &"
# Set XDG Stuffs
xdg_runtime
# Select Window Manager
select_wm
exit 0
##
# Opacity
##
opacity-rule = [
"100:class_g = 'emacs' && focused",
"85:class_g = 'emacs' && !focused",
"100:class_g = 'st' && focused",
"85:class_g = 'st' && !focused",
"100:class_g = 'xterm' && focused",
"85:class_g = 'xterm' && !focused",
];
##
# Wintypes
##
wintypes: {
normal = { blur-background = true; };
splash = { blur-background = false; };
};
##
# Fading
##
fading = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
fade-exclude = [ ];
##
# Misc
##
mark-wwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
vsync = true;
dbe = false;
sw-opti = true;
refresh-rate = 0;
unredir-if-possible = true;
detect-transient = true;
detect-client-leader = true;
invert-color-include = [ ];
##
# QT-Apps Fixes For Blurs
##
shadow-exclude = [
"argb && (_NET_WM_WINDOW_TYPE@:a *= 'MENU' || _NET_WM_WINDOW_TYPE@:a *= 'COMBO')"
];
blur-background-exclude = [
"(_NET_WM_WINDOW_TYPE@:a *= 'MENU' || _NET_WM_WINDOW_TYPE@:a *= 'COMBO')"
];
##
# Backend
##
backend = "xrender";
use-damage = true;
[global]
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = none
### Geometry ###
# dynamic width from 0 to 300
# width = (0, 300)
# constant width of 300
width = (0, 256)
# The maximum height of a single notification, excluding the frame.
height = (0, 256)
# Position the notification in the top right corner
origin = bottom-right
# Offset from the origin
offset = 0x0
# Scale factor. It is auto-detected if value is 0.
scale = 0
# Maximum number of notification (0 means no limit)
notification_limit = 3
### Progress bar ###
# Turn on the progess bar. It appears when a progress hint is passed with
# for example dunstify -h int:value:12
progress_bar = true
# Set the progress bar height. This includes the frame, so make sure
# it's at least twice as big as the frame width.
progress_bar_height = 10
# Set the frame width of the progress bar
progress_bar_frame_width = 1
# Set the minimum width for the progress bar
progress_bar_min_width = 150
# Set the maximum width for the progress bar
progress_bar_max_width = 300
# Corner radius for the progress bar. 0 disables rounded corners.
progress_bar_corner_radius = 0
# Corner radius for the icon image.
icon_corner_radius = 0
# Show how many messages are currently hidden (because of
# notification_limit).
indicate_hidden = yes
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.). (X11 only)
transparency = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
# If gap_size is greater than 0, this setting will be ignored.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 10
# Padding between text and icon.
text_icon_padding = 0
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 1
# Defines color of the frame around the notification window.
frame_color = "#d5c4a1"
# Size of gap to display between notifications - requires a compositor.
# If value is greater than 0, separator_height will be ignored and a border
# of size frame_width will be drawn around each notification instead.
# Click events on gaps do not currently propagate to applications below.
gap_size = 2
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = foreground
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
idle_threshold = 120
### Text ###
font = Spleen 6x12 11
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <https://docs.gtk.org/Pango/pango_markup.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%a</b>\n%s\n<i>%b</i> "
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Vertical alignment of message text and icon.
# Possible values are "top", "center" and "bottom".
vertical_alignment = center
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Recursive icon lookup. You can set a single theme, instead of having to
# define all lookup paths.
enable_recursive_icon_lookup = false
# Set icon theme (only used for recursive icon lookup)
icon_theme = Gruvbox_Dark
# You can also set multiple icon themes, with the leftmost one being used first.
# icon_theme = "Adwaita, breeze"
# Align icons left/right/top/off
icon_position = left
# Scale small icons up to this size, set to 0 to disable. Helpful
# for e.g. small files or high-dpi screens. In case of conflict,
# max_icon_size takes precedence over this.
min_icon_size = 32
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 64
# Paths to default icons (only neccesary when not using recursive icon lookup)
#icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# Browser for opening urls in context menu.
browser = /usr/bin/xdg-open
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 0
# Ignore the dbus closeNotification message.
# Useful to enforce the timeout set by dunst configuration. Without this
# parameter, an application may close the notification sent before the
# user defined timeout.
ignore_dbusclose = false
### Wayland ###
# These settings are Wayland-specific. They have no effect when using X11
# Uncomment this if you want to let notications appear under fullscreen
# applications (default: overlay)
# layer = top
# Set this to true to use X11 output on Wayland.
force_xwayland = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
### mouse
# Defines list of actions for each mouse event
# Possible values are:
# * none: Don't do anything.
# * do_action: Invoke the action determined by the action_name rule. If there is no
# such action, open the context menu.
# * open_url: If the notification has exactly one url, open it. If there are multiple
# ones, open the context menu.
# * close_current: Close current notification.
# * close_all: Close all notifications.
# * context: Open context menu for the notification.
# * context_all: Open context menu for all notifications.
# These values can be strung together for each mouse event, and
# will be executed in sequence.
mouse_left_click = close_current
mouse_middle_click = do_action, close_current
mouse_right_click = close_all
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#282828"
foreground = "#928374"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#default_icon = /path/to/icon
[urgency_normal]
background = "#282828"
foreground = "#ebdbb2"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#default_icon = /path/to/icon
[urgency_critical]
background = "#282828"
foreground = "#fb4934"
frame_color = "#fabd2f"
timeout = 25
# Icon for notifications with critical urgency, uncomment to enable
#default_icon = /path/to/icon
this configures my ports/src build environment, it goes in /etc/mk.conf
#SUDO="/usr/bin/doas"
PORTSDIR_PATH=${PORTSDIR}:${PORTSDIR}/openbsd-wip:${PORTSDIR}/mystuff
WRKOBJDIR=/usr/obj
DISTDIR=/usr/distfiles
PACKAGE_REPOSITORY=/usr/packages
for BSD Vi
" display current mode
set showmode
" show matching parens, brackets, etc
set showmatch
" display row/column info
set ruler
" autoindent tab = 2 space
set shiftwidth=2
" tab = 2 space
set tabstop=2
" display errors
set verbose
" enable horiz scroll
set leftright
" use extend regex
set extend
" case-less searching, unless uppercase
set iclower
" incremental searching
set searchincr
" print helpful messages (eg, 4 lines yanked)
set report=1
The kernel parameters settings.
Very hardware specific see NOTE
# Open Kernel Limits
kern.maxthread=16385
kern.maxproc=32768
kern.maxfiles=65535
kern.maxvnodes=262144
kern.somaxconn=2048
kern.bufcachepercent=90
# Shared Memory (for browsers)
kern.shminfo.shmmax=2147483647
kern.shminfo.shmall=536870912
kern.shminfo.shmmni=4096
# Semaphores (not as relevant, but still worth having in case)
kern.shminfo.shmseg=2048
kern.seminfo.semmns=4096
kern.seminfo.semmni=1024
# Allow Kernel Memory Access
kern.allowkmem=1
# Enable Multithreading
## Danger! has implications
hw.smt=1
# Fix Screen Tearing
machdep.allowaperture=2
# Network
## Enable IP Forwarding
net.inet.ip.forwarding=1
net.inet6.ip6.forwarding=1
## Faster Networking
net.inet.udp.recvspace=262144
net.inet.udp.sendspace=262144
net.inet.icmp.errppslimit=1000
# Video/Audio enable/disable
# change these to =1 if you want microphone or webcam access
kern.audio.record=0
kern.video.record=0
This goes in /etc/pf.conf
, use with caution
# Macros
icmp_types = "{ echoreq }"
wifi_if = "{ iwm0 urtwn0 urtwn1 }"
eth_if = "{ em0 }"
tcp_services = "{ http 1000 https ssh 6697 587 993 domain telnet }"
udp_services = "{ domain 50000:65535 }"
# Options
set skip on lo
set block-policy drop
set state-policy if-bound
set fingerprints "/etc/pf.os"
set ruleset-optimization none
set optimization normal
set timeout { tcp.closing 60, tcp.established 7200 }
# Tables
table <bruteforce> persist
table <rfc6890> { 0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 127.0.0.0/8 \
169.254.0.0/11 172.16.0.0/12 192.0.0.0/24 192.0.0.0/29 \
192.0.2.0/24 192.88.99.0/24 192.168.0.0/16 198.18.0.0/15 \
195.51.100.0/24 240.0.0.0/4 203.0.113.0/24 255.255.255.255/32 }
# prevent IP spoofing
antispoof quick for $wifi_if
antispoof quick for $eth_if
# for logging
block in log on egress from <rfc6890>
block return out log on egress to <rfc6890>
# block all else
block all
# only allow special services
pass out on egress proto tcp to port $tcp_services
pass in on $eth_if proto tcp to port ssh \
keep state (max-src-conn 15 max-src-conn-rate 3/1 \
overload <bruteforce> flush global)
pass proto udp to port $udp_services
# ICMP
pass out inet proto icmp icmp-type $icmp_types
dfm install script config
.fonts recurse
.git recurse
.icons recurse
.themes recurse
.moc recurse
.config recurse
.local recurse
.claws-mail recurse
LICENSE.txt skip
COPYING skip
README.org skip
quicklisp-setup.lisp skip
doas.conf skip
sysctl.conf skip
mk.conf skip
pf.conf skip
setup.pl skip
dfm skip
assets skip
backgrounds skip
Emacs-Config skip
Emwm-Config skip
StumpWM-Config skip
XenoDM-Config skip
APM-Config skip
this is totally overkill
fine now
permit persist :doas
permit nopass root
The list of packages to be installed via Cargo.
cargo-upgrade-command dipc du-dust hyperfine onefetch sd tere tokei zoxide