Skip to content

Instantly share code, notes, and snippets.

View ananace's full-sized avatar

Alexander "Ananace" Olofsson ananace

  • Linköping University
  • Sweden
View GitHub Profile
@ananace
ananace / LAYER_fakefullscreen.cpp
Last active March 28, 2024 20:49
Stub for VK_EXT_full_screen_exclusive
#include <vkroots.h>
#include <cstdint>
#include <algorithm>
#include <ranges>
#include <string_view>
#define VK_EXT_FULL_SCREEN_EXTENSION_NAME "VK_EXT_full_screen_exclusive"
#define VK_EXT_FULL_SCREEN_SPEC_VERSION 4
@ananace
ananace / run-in-slice.sh
Last active October 12, 2023 14:13
Small script to launch a process in a slice/cgroup
#!/bin/bash
set -euo pipefail
# Drop in /usr/local/bin/run-in-slice
#
# Requires system to be running systemd and cgroupsv2
SLICE="$1"
shift
@ananace
ananace / keyboard.patch
Created March 28, 2023 18:26
Wine keyboard layout mapping patch
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index b1c47d5258e..a7a393b5102 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1402,6 +1402,35 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev )
return TRUE;
}
+/* From the point of view of this function there are two types of
+ * keys: those for which the mapping to vkey and scancode depends on
@ananace
ananace / fake_aio.pp
Created March 1, 2023 10:00
Faking an AIO install for modern Puppet on Raspberry Pi
class profiles::raspberry_pi::fake_aio {
file {
default:
ensure => file;
'/etc/facter/facts.d/aio_agent_version.txt':
content => "aio_agent_version=${fact('puppetversion')}";
'/etc/facter/facts.d/aio_fake_agent.txt':
content => "aio_fake_agent=true";
}
@ananace
ananace / lib-facter-pi.rb
Created September 29, 2022 18:03
Puppet profile manifests for improved handling of Raspberry Pi nodes
# frozen_string_literal: true
# Fact to check Raspberry Pi information;
Facter.add(:pi) do
pi_dtb = '/sys/firmware/devicetree/base'
confine { File.exist? pi_dtb }
setcode do
{
@ananace
ananace / disable-eac.sh
Last active May 23, 2022 19:03
Star Citizen EAC disable one-liner
#!/bin/bash
ls -1 */EasyAntiCheat/Settings.json | xargs -rn 1 sed -e 's/id":\s*"[^L]/id": "LUG/g' -i
@ananace
ananace / kernel32-SetThreadInformation-stub.mypatch
Last active May 4, 2022 08:13
Quick and ugly Kernel32.SetThreadInformation stub
Add a stub for missing Kernel32.SetThreadInformation, needed for Star Citizen 3.17.1
https://bugs.winehq.org/show_bug.cgi?id=52956
https://bugs.winehq.org/attachment.cgi?id=72326
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 818e7d87a2f..706c518dbe1 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -1470,6 +1470,7 @@
@ stdcall -import SetThreadGroupAffinity(long ptr ptr)
@ananace
ananace / 6.20-joyaxis-lite.patch
Created October 23, 2021 12:24
Simpler joyaxis patch for Wine 6.20
diff --git a/dlls/winejoystick.drv/joystick_linux.c b/dlls/winejoystick.drv/joystick_linux.c
index 8d1a7b1a25a..4057ec52a1e 100644
--- a/dlls/winejoystick.drv/joystick_linux.c
+++ b/dlls/winejoystick.drv/joystick_linux.c
@@ -260,9 +260,9 @@ LRESULT driver_joyGetDevCaps(DWORD_PTR dwDevID, LPJOYCAPSW lpCaps, DWORD dwSize)
lpCaps->wUmax = 0xFFFF;
lpCaps->wVmin = 0;
lpCaps->wVmax = 0xFFFF;
- lpCaps->wMaxAxes = 6; /* same as MS Joystick Driver */
+ lpCaps->wMaxAxes = 16; /* same as MS Joystick Driver */
@ananace
ananace / joyaxis-6.18.patch
Last active September 25, 2021 07:39
Quick hack to get the expanded joyaxises patch to apply on Wine 6.18
diff --git a/dlls/joy.cpl/joy.h b/dlls/joy.cpl/joy.h
index 64df21963b9..c05880d88ba 100644
--- a/dlls/joy.cpl/joy.h
+++ b/dlls/joy.cpl/joy.h
@@ -49,8 +49,8 @@ struct Joystick {
struct Effect *effects;
};
-#define TEST_MAX_BUTTONS 32
-#define TEST_MAX_AXES 4
@ananace
ananace / user_settings.py
Created August 22, 2018 15:56
Example configuration for Steam Proton user settings
#!/usr/bin/env python3
import os
user_settings = {
#logs are saved to $HOME/steam-$STEAM_APP_ID.log, overwriting any previous log with that name
# "WINEDEBUG": "+timestamp,+pid,+tid,+seh,+debugstr,+module",
# "DXVK_LOG_LEVEL": "info",