Skip to content

Instantly share code, notes, and snippets.

@rfht
rfht / lid.sh
Last active September 1, 2022 02:58
check OpenBSD lid status and reconfigure display/WM accordingly, using autorandr and fvwm2
#!/bin/sh
# make sure the appropriate autorandr configurations exist
for a_status in docked docked_open; do
autorandr | egrep -q "^$a_status( .*)?$" || \
{ echo "Error: no autorandr for $a_status"; exit 1; }
done
lid_status=$(sysctl -n hw.sensors.acpibtn0.indicator0 | cut -f1 -d' ')
if [ $lid_status = "On" ]; then # "On" = lid open
@rfht
rfht / crosscode-openbsd.diff
Created March 18, 2022 11:17
Fix this, then run Crosscode on OpenBSD in Firefox or Chromium
--- assets/node-webkit.html.orig Sat Nov 28 20:42:00 2020
+++ assets/node-webkit.html Sat Nov 28 21:06:54 2020
@@ -51,12 +51,14 @@
<script type="text/javascript">
// make sure we don't let node-webkit show it's error page
// TODO for release mode, there should be an option to write to a file or something.
+ /*
window['process'].once('uncaughtException', function() {
var win = require('nw.gui').Window.get();
if(!(win.isDevToolsOpen && win.isDevToolsOpen())) {
@rfht
rfht / libgdx-run.sh
Created March 12, 2022 16:33
Legacy run script for libgdx games on OpenBSD, like Slay the Spire
#!/bin/sh
# get mainClass from config.json
mainclass=
mainclass="$(cat config.json | grep mainClass | cut -d\" -f 4)"
# TODO: get vmArgs from config.json
vmargs="-Xmx2G"
JAVA_HOME=${TRUEPREFIX}/jdk-11 PATH=$PATH:$JAVA_HOME/bin java $vmargs $mainclass
@rfht
rfht / libgdx-setup.sh
Created March 12, 2022 16:32
Legacy setup script for libgdx games on OpenBSD, like Slay the Spire
#!/bin/sh
GDXARCH=
if [ "$(uname -p)" = "amd64" ] ; then
GDXARCH=64
fi
JAVA_HOME=${TRUEPREFIX}/jdk-11
PATH=$PATH:$JAVA_HOME/bin
#!/bin/sh
ftp -MVo- https://ftp.openbsd.org/pub/OpenBSD/snapshots/$(uname -m)/BUILDINFO
@rfht
rfht / tolower.sh
Last active June 18, 2020 13:47
turn all filenames in $PWD to lowercase recursively
#!/bin/sh
if [ -z "$1" ] ; then
WD=.
else
WD="$1"
fi
lower=
lowercase()
{
@rfht
rfht / compton.conf
Created April 30, 2020 09:52
compton.conf
backend = "xrender"; # glx (faster) or xrender
#################################
# GLX backend
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
glx-copy-from-front = false;
@rfht
rfht / compton.conf
Created April 30, 2020 09:52
compton.conf
backend = "xrender"; # glx (faster) or xrender
#################################
# GLX backend
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
glx-copy-from-front = false;
@rfht
rfht / .fvwm2rc
Created April 30, 2020 09:50
.fvwm2rc
# be sure to customize these paths for your installation:
ModulePath /usr/local/libexec/fvwm/2.6.9
# PixmapPath and IconPath are deprecated. Use ImagePath instead
ImagePath /usr/local/share/pixmaps/fvwm
Colorset 23 Transparent, fg rgb:ff/ff/c4, bg darkgray # not working with base fvwm
Colorset 41 RootTransparent buffer, fg white, bg average, \
Tint yellow 15, bgTint yellow 15 # tint is optional
Colorset 42 RootTransparent buffer, fg white, bg average, \
Tint gray 15, bgTint gray 15 # tint is optional
@rfht
rfht / devilutionX-clang-CRLF-file.diff
Last active June 29, 2019 06:31 — forked from brynet/devilutionX-clang.diff
devilutionX clang fixes
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 56bf70f9..884ed0e7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,7 +35,7 @@ if(NIGHTLY_BUILD)
set(FASTER ON)
endif()
-if(${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD)
+if(${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD OR ${CMAKE_SYSTEM_NAME} STREQUAL OpenBSD)