Skip to content

Instantly share code, notes, and snippets.

View pojntfx's full-sized avatar
💭
🌅

Felicitas Pojtinger pojntfx

💭
🌅
View GitHub Profile
@pojntfx
pojntfx / main.go
Last active June 4, 2024 23:21
Use `pprof` to profile a Go application
import _ "net/http/pprof"
// ...
go func() {
log.Println(http.ListenAndServe("localhost:6060", nil))
}()
@pojntfx
pojntfx / client.sh
Last active June 5, 2024 00:14
Stream Wayland desktop over network with Pipewire, GStreamer and H264
#!/bin/bash
gst-launch-1.0 udpsrc port=5000 ! application/x-rtp, payload=96 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! autovideosink sync=false
@pojntfx
pojntfx / main.sh
Created June 4, 2024 20:27
Stream webcam to browser with GStreamer
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! videoscale ! video/x-raw,width=720,height=320 ! theoraenc ! oggmux ! tcpserversink host=127.0.0.1 port=8080
@pojntfx
pojntfx / main.sh
Last active May 29, 2024 05:29
Build FreeRDP/xfreerdp with H264 enabled as a Flatpak and connect to a system with it
#!/bin/bash
flatpak-builder --repo=repo build packaging/flatpak/com.freerdp.FreeRDP.json
flatpak build-bundle repo com.freerdp.FreeRDP.flatpak com.freerdp.FreeRDP --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
flatpak install ./com.freerdp.FreeRDP.flatpak
flatpak run com.freerdp.FreeRDP /v:localhost:3389 /u:liveuser /gfx:avc420 /h:1200 /w:1920
# Or alternatively:
xfreerdp /v:localhost:3389 /u:pojntfx /p:LujOPipihBoc +multitouch +gestures -grab-keyboard -grab-mouse /gfx:AVC444,RFX,progressive:on /bpp:32 +dynamic-resolution
@pojntfx
pojntfx / main.sh
Last active May 29, 2024 19:30
Renderer a GTK4/libadwaita Flatpak application in the browser with Broadway
#!/bin/bash
gtk4-broadwayd :5
# Natively
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 workbench
# Flatpak
flatpak run --env=GDK_BACKEND=broadway --env=BROADWAY_DISPLAY=:5 --filesystem=/run/user/1000 re.sonny.Workbench
# Now open http://localhost:8085/
@pojntfx
pojntfx / main.js
Created May 26, 2024 21:41
Play a video in libadwaita from hTorrent with GJS and gtk4paintablesink
import Adw from "gi://Adw?version=1";
import Gtk from "gi://Gtk?version=4.0";
import Gst from "gi://Gst?version=1.0";
Gst.init(null);
const application = new Adw.Application({
application_id: "com.github.pojntfx.adwaitaGStreamerExample",
});
@pojntfx
pojntfx / Makefile
Created May 26, 2024 21:29
Use `panrpc` to connect a GJS application to a Go/NodeJS/Bun backend with bi-directional RPCs
dev:
npx esbuild playground.js --bundle --outfile=/tmp/playground.js '--external:gi://*' --platform=neutral && gjs -m /tmp/playground.js
@pojntfx
pojntfx / main_csd.js
Created May 26, 2024 03:59
Transparent WebView & GTK4/libadwaita Windows
import Adw from "gi://Adw?version=1";
import Gtk from "gi://Gtk?version=4.0";
import Gdk from "gi://Gdk?version=4.0";
import WebKit from "gi://WebKit";
const application = new Adw.Application({
application_id: "com.github.pojntfx.webviewTransparentDemo",
});
application.connect("activate", () => {
@pojntfx
pojntfx / main.blueprint
Created May 22, 2024 23:40
Play a video from hTorrent with GJS and gtk4paintablesink
using Gtk 4.0;
using Adw 1;
Adw.Clamp page {
maximum-size: 1920;
Box {
orientation: vertical;
Picture video {}
@pojntfx
pojntfx / main.blueprint
Created May 22, 2024 22:24
Play a video from hTorrent with GJS and GtkVideo
using Gtk 4.0;
using Adw 1;
Adw.StatusPage page {
title: _("Video");
description: _("Display video with media controls");
Box {
orientation: vertical;
halign: center;