Skip to content

Instantly share code, notes, and snippets.

View kode54's full-sized avatar

Christopher Snowhill kode54

View GitHub Profile
@kode54
kode54 / bing_wallpaper.sh
Created February 16, 2024 22:02
Bing wallpaper grabber for SwayBG or for Wayfire shell
#!/bin/sh
# systemd example: https://stackoverflow.com/a/50321912
# cron example:
# 0 * * * * ~/.config/sway/scripts/bing_wallpaper.sh
# exit on error
set -e
if [ -z "$WAYLAND_DISPLAY" ]; then
@kode54
kode54 / mesa-vulkan-debuginfo.patch
Created October 7, 2023 00:12
Mesa Vulkan always emit debug info patch (May be vaguely useful sometimes)
diff --git a/src/vulkan/runtime/vk_log.c b/src/vulkan/runtime/vk_log.c
index dfd4a2e5172..0335c1446e2 100644
--- a/src/vulkan/runtime/vk_log.c
+++ b/src/vulkan/runtime/vk_log.c
@@ -111,7 +111,7 @@ __vk_log_impl(VkDebugUtilsMessageSeverityFlagBitsEXT severity,
}
}
-#ifndef DEBUG
+#if 0
@kode54
kode54 / error.txt
Created July 10, 2023 07:26
Tenacity Git build error
/home/chris/.cache/paru/clone/tenacity-git/src/tenacity/libraries/lib-audio-devices/AudioIOBase.cpp:709:6: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostringstream' (aka 'basic_ostringstream<char>') and 'const char[33]')
s << "EXPERIMENTAL_MIDI_OUT is enabled" << std::endl;
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chris/.cache/paru/clone/tenacity-git/src/tenacity/libraries/lib-strings/TranslatableString.h:320:14: note: candidate function [with Sink = std::basic_ostringstream<char>]
inline Sink &operator <<( Sink &sink, const TranslatableString &str )
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/ostream:662:5: note: candidate function [with _Traits = std::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/ostream:645:5: note: candidate function [with _CharT = char, _Traits = std::char_traits<cha
@kode54
kode54 / 0000-README.md
Last active May 30, 2023 15:56
Xe KMD uAPI adjustments

These are minimal adjustments to the current uAPI, as inspired by Maarten Lankhorst and his process of running the headers through pahole. But instead, I adjusted them manually, making minimal changes so that the 64-bit uarch would result in the same alignment, so existing userspace software with the previous header will still work. The only difference is that 32-bit userspace software needs the new header, to continue working with the kernel.

I've split it into two patches, like was suggested to @mlankhorst, one with the uAPI header, and one with the validation code.

Edited 2023-05-12 20:42 PDT: Updated against latest rebase.

@kode54
kode54 / limit.cpp
Created May 13, 2023 08:53
Audio Soft Limiter
#include <math.h>
#include <float.h>
static inline float f_max(float v1,float v2)
{
return v1>v2 ? v1 : v2;
}
static const float limiter_max = (float)0.9999;
@kode54
kode54 / 43.4.patch
Created April 19, 2023 16:03
Mutter VRR patch, rebased against mutter 43.4
From 596f396f62ab834845fe1253ebb677866f9a6b23 Mon Sep 17 00:00:00 2001
From: Dor Askayo <dor.askayo@gmail.com>
Date: Sun, 16 Aug 2020 17:14:03 +0300
Subject: [PATCH 02/25] surface-actor: Add "frozen" signal
This signal is emitted when the surface actor is frozen and will not
update until it is thawed.
---
src/compositor/meta-surface-actor.c | 11 +++++++++++
1 file changed, 11 insertions(+)
@kode54
kode54 / vmbind.patch
Created April 19, 2023 09:38
PATCH v10 of the Intel Graphics VM_BIND set, rebased against drm-tip from 2023-04-19
From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path: <dri-devel-bounces@lists.freedesktop.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
aws-us-west-2-korg-lkml-1.web.codeaurora.org
Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.lore.kernel.org (Postfix) with ESMTPS id 1175EC32793
for <dri-devel@archiver.kernel.org>; Wed, 18 Jan 2023 07:16:20 +0000 (UTC)
Received: from gabe.freedesktop.org (localhost [127.0.0.1])
@kode54
kode54 / obs-recording-toggle.py
Created March 18, 2023 00:19
OBS Recording Toggle, based on obs-wayland-shortcuts, but using obs-cli and not obs-cli-leafac.
#!/usr/bin/env python3
# Original Author: Andrew Shark
# Homepage: https://gitlab.com/AndrewShark/obs-wayland-shortcuts
# License: GPLv3
# Modified By: Christopher Snowhill
# This script is made for convenience. It is invoked by a logid gesture for MX Master mouse.
ii samba 2:4.10.9+karoshi-1~linuxschools1+bionic1 amd64 SMB/CIFS file, print and login server for Unix
ii samba-common 2:4.10.9+karoshi-1~linuxschools1+bionic1 all common files used by both the Samba server and client
ii samba-common-bin 2:4.10.9+karoshi-1~linuxschools1+bionic1 amd64 Samba common files used by both the server and the client
ii samba-dbg 2:4.10.9+karoshi-1~linuxschools1+bionic1 amd64 Samba debugging symbols
ii samba-dsdb-modules 2:4.10.9+karoshi-1~linuxschools1+bionic1 amd64 Samba Directory Services Database
ii samba-libs:amd64 2:4.10.9+karoshi-1~linuxschools1+bionic1 amd64 Samba core libraries
ii samba-vfs-modules 2:4.10.9+karoshi-1~linuxschools1+bionic1 amd64 Samba Virtual FileSystem plugins
@kode54
kode54 / SFList JSON README.txt
Last active November 3, 2022 18:54 — forked from kddlb/README.txt
SoundFont List, as JSON
If fileName specifies another sflist json file, no other arguments will be processed for that block,
and the contents of that file will be parsed and included.
SoundFont load priority is the same as the original SFList, in that files listed first will be overridden by files listed later. Nested .sflist.json loading has the same rules. Basically, first come, first loaded. Except that BASS treats first items in the list as higher priority, so I guess reverse the order when preparing the list for BASS?
Adding an integer priority value may be useful to some people, but I'm not sure if ipt's such a good idea.
patchMappings:
As many items as is necessary. SFZ ignores and therefore does not require the "source" argument.
Depending on how the loading operation is intended, "bank" or "program" may be optional. For source,