Skip to content

Instantly share code, notes, and snippets.

@neogeographica
neogeographica / scalereset.py
Last active February 3, 2024 22:01
reset monitor scale factor to 1.0
#!/usr/bin/python3
# https://discussion.fedoraproject.org/t/change-scaling-resolution-of-primary-monitor-from-bash-terminal/76778/25
import dbus
bus = dbus.SessionBus()
display_config_well_known_name = "org.gnome.Mutter.DisplayConfig"
display_config_object_path = "/org/gnome/Mutter/DisplayConfig"
@neogeographica
neogeographica / pw-audio-device-switch.sh
Created March 9, 2023 16:14
switch audio output (PipeWire... and maybe PulseAudio too?)
#!/bin/bash
# For PipeWire. Based on my previous script for PulseAudio. This one might
# also work with PulseAudio since it only uses pactl... haven't tested that.
# Unlike on my older PulseAudio system, I didn't need to edit any config file
# to disable per-application persistence of sink assignments.
# The grepping/sed-ing patterns for various bits of command output may need
# to be tweaked to work with other systems or audio devices.
@neogeographica
neogeographica / windows.py
Created February 28, 2023 05:10
script for window group cycling on elementary OS
from subprocess import Popen, PIPE, call
import logging
import logging.handlers
import sys
import os
# NOTE: this script assumes a debian system and requires the wmctrl and xdotool packages
# sudo apt-get install wmctrl xdotool
# NOTE: To get [Alt + ` ]to register on Elementary OS requires removing the keybinding via dconf editor for switch-group/switch-group-backward
@neogeographica
neogeographica / linapple-loop
Last active February 10, 2023 16:01
WIP scripts for Apple II demo loop on Raspberry Pi
#!/usr/bin/env bash
# Script for running the LinApple emulator fullscreen and with autoboot.
# The intention is to keep it running unattended.
# System is set to autologin as a particular user without requiring password.
# This script can be run from a .desktop file in .config/autostart so that it
# runs on system boot.
# The demo loop I want to run seems to freeze sometimes. So, every 5 minutes
@neogeographica
neogeographica / audio-device-switch.sh
Last active March 9, 2023 16:12
switch audio output (PulseAudio)
#!/bin/bash
# For PulseAudio.
# FOR THIS TO WORK, I needed to edit /etc/pulse/default.pa so that this line:
# load-module module-stream-restore
# is instead like this:
# load-module module-stream-restore restore_device=false
#
# I believe this will also undermine the ability to set some app to use a
@neogeographica
neogeographica / usb-pause.c
Created January 26, 2023 16:26
mouse bouncer
// SPDX-License-Identifier: GPL-2.0-or-later
//
// looooosely based on usbip_unbind.c and sysfs_utils.c from the Linux source
// This C code is for replicating this kind of behavior from the shell:
// sudo sh -c 'echo 8-1 > /sys/bus/usb/drivers/usb/unbind'
// sleep 30
// sudo sh -c 'echo 8-1 > /sys/bus/usb/drivers/usb/bind'
// I use that to bounce my wireless mouse to the receiver on another computer.
@neogeographica
neogeographica / 1-readme-first.txt
Last active February 3, 2024 21:57
compiling Quake 3 maps with TrenchBroom
These are examples of Quake 3 compilation profiles for use with TrenchBroom.
I'm NOT saying that these examples have the best command-line arguments that are appropriate for your situation. In particular, you may want to fool around with different arguments for the lighting pass. This is just to help get the skeleton of a compile profile in place, which you can then modify.
----------
In any case, to get started the first thing you'll need is a set of compile tools for Quake 3 maps.
If you want to get the tools from netradiant-custom, FYI that project lives here: https://github.com/Garux/netradiant-custom

Keybase proof

I hereby claim:

  • I am neogeographica on github.
  • I am jbaxter (https://keybase.io/jbaxter) on keybase.
  • I have a public key ASB3wgfmOFieMB5i0hz9OjencX0GAkP5ADFVKXsEMOlr8wo

To claim this, I am signing this object: