Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
ftp -MVo- https://ftp.openbsd.org/pub/OpenBSD/snapshots/$(uname -m)/BUILDINFO
@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
@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 / 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 / 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 / fauxstream-vaapi.sh
Created September 27, 2024 01:28
updated fauxstream script, currently still undergoing testing, with performance improvements, VA-API use, and better avoidance of desyncs
#!/bin/sh
########
# Copyright (c) 2018-2019 Thomas Frohwein <[email protected]>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES