Skip to content

Instantly share code, notes, and snippets.

@rondhi
rondhi / README.md
Last active May 7, 2024 06:55
How to stream games from OBS directly from Steam Deck's Gaming Mode

How to stream games from OBS directly from Steam Deck's Gaming Mode (as of 2023-02-26)

DISCLAIMER: As with any guide, please make sure to read through and understand everything before following the steps in this guide. I'm not responsible for you breaking anything on your own device. This guide assumes you have a little background with the linux command line as well as the text editor nano. If not, please educate yourself


Description: It's possible to stream Vulkan and OpenGL games from Gaming Mode on your Steam Deck. This guide is heavily based on robertkirkman's guide, which is linked multiple times throughout this guide. Much thanks to them


@paulocoutinhox
paulocoutinhox / main.js
Created March 30, 2016 22:35
New Game Template With Phaser - by Paulo Coutinho - PRS
var GameApp = GameApp || {};
GameApp.USE_DEVICE_PIXEL_RATIO = false; // here you can change to use or not the device pixel ratio - it is not supported by all browsers
if (GameApp.USE_DEVICE_PIXEL_RATIO) {
GameApp.DEVICE_PIXEL_RATIO = window.devicePixelRatio;
GameApp.CANVAS_WIDTH = window.innerWidth * GameApp.DEVICE_PIXEL_RATIO;
GameApp.CANVAS_HEIGHT = window.innerHeight * GameApp.DEVICE_PIXEL_RATIO;
} else {
GameApp.DEVICE_PIXEL_RATIO = 1.0;
GameApp.CANVAS_WIDTH = window.innerWidth * GameApp.DEVICE_PIXEL_RATIO;

These are only examples, for a few very common actions. You are expected to write your own rules for the rest. The syntax is regular JavaScript, but see the polkit(8) manpage for the object structure and available API. These examples are for polkit versions 106 and later, with the JS interpreter. They won't work with Debian's polkit v105.

  • If you don't know the action name, run pkaction:

    pkaction | grep cups
    
  • The possible results are YES, AUTH_SELF(_KEEP), AUTH_ADMIN(_KEEP), NO. Returning a result is final. Returning null will continue checking other rules.

  • Put your rules in /etc/polkit-1/rules.d/*.rules. (You can check everything in one giant addRule, or you can have a separate file and separate addRule for each program; it doesn't matter.)

@perky
perky / ProFi.lua
Created May 30, 2012 20:32
ProFi, a simple lua profiler that works with LuaJIT and prints a pretty report file in columns.
--[[
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php.
Example:
ProFi = require 'ProFi'
ProFi:start()
some_function()
another_function()
coroutine.resume( some_coroutine )
ProFi:stop()