Skip to content

Instantly share code, notes, and snippets.

View kode54's full-sized avatar

Christopher Snowhill kode54

View GitHub Profile
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,UseMultiPlaneFormatForHardwareVideo,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE
--use-angle=vulkan
--ozone-platform-hint=auto
@kode54
kode54 / wayfire-display-recovery.patch
Created August 29, 2024 05:09
Wayfire display recovery attempt; for track-wlroots 0.18 branch
diff --git a/src/core/core-impl.hpp b/src/core/core-impl.hpp
index 8c31dfe6..1b4a6212 100644
--- a/src/core/core-impl.hpp
+++ b/src/core/core-impl.hpp
@@ -38,6 +38,8 @@ class compositor_core_impl_t : public compositor_core_t
void disconnect_signals();
void fini();
+ void reconfigure_outputs();
+
@kode54
kode54 / wf-panel.service
Created May 18, 2024 10:13
Wayfire wf-shell service for wf-panel
[Unit]
Description=Wayfire Panel service
Documentation=https://github.com/WayfireWM/wf-shell/wiki
# order startup after WM
After=graphical-session.target
[Service]
ExecStart=/usr/bin/wf-panel
ExecReload=kill -SIGUSR2 $MAINPID
Restart=on-failure
@kode54
kode54 / zsync2.patch
Created May 17, 2024 00:38
Patch to get zsync2 building with GCC14, likely no less functional than it was before, considering it doesn't try to use off64_t instead of off_t
diff --git a/lib/libzsync/zsync.c b/lib/libzsync/zsync.c
index b425db9..02c47ad 100644
--- a/lib/libzsync/zsync.c
+++ b/lib/libzsync/zsync.c
@@ -40,6 +40,8 @@
#include <unistd.h>
#include <string.h>
#include <ctype.h>
+
+#define __USE_XOPEN 1
From patchwork Mon Apr 1 18:58:06 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Luiz Augusto von Dentz <[email protected]>
X-Patchwork-Id: 13612954
Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com
[209.85.128.179])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
@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 / 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 / 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.