Skip to content

Instantly share code, notes, and snippets.

View schrmh's full-sized avatar
💭
Little time; many projects

schrmh

💭
Little time; many projects
View GitHub Profile
@schrmh
schrmh / Project structure.md
Last active December 28, 2023 17:34
beryllium Mobile NixOS example setup

Foreword:
My NixOS experience is actually limited to this device. So this might not be this optimal and there are some parts of this that look a bit cringe to me and they might not be necessary but I left them here for now...

By the way: If you got a Pocophone F1 with EBBG display you will likely have to figure out a bit of stuff and then contribute to the Mobile NixOS repo. Most beryllium owners have a Tianma display.

Start on a aarch64 machine (e.g. SBC RPi 4):
Then e.g. this for phosh (hello actually has a few words on that iirc):

nix-build examples/phosh --argstr device xiaomi-beryllium -A outputs.default
fastboot flash boot result/boot.img
@schrmh
schrmh / <break> numbers.png
Created April 22, 2023 16:40
Awesome number system
TODO
@schrmh
schrmh / index.html
Created March 24, 2023 03:27
electron X11 selection test application with JPEG. (Use xclip to check what targets it provides after clicking a button)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Clipboard Example</title>
</head>
<body>
Image stuff (CC0 licensed image):<br>
<img id="my-image" /><br>
<button id="copy-img-btn_clipboard">Copy JPEG (CLIPBOARD)</button>
@schrmh
schrmh / .vimrc
Created February 15, 2022 14:10 — forked from saitoha/.vimrc
Vimで画像を見る(DRCSのSIXEL拡張の話) ref: http://qiita.com/kefir_/items/78e64c545a70a0ebea8a
" Vimであいまいな幅の文字の論理幅を1にします
set ambiwidth=single
" RLoginであいまいな幅の文字の論理幅を1にします。
call writefile(["\e[?8428h"], '/dev/tty')
@schrmh
schrmh / packages-gist.hook
Created February 16, 2021 19:45 — forked from Joshix-1/packages-gist.hook
If you want to use it for your self change the url to the gist. More info about how to use this hook: https://wiki.archlinux.org/index.php/Pacman#Hooks
[Trigger]
Operation = Install
Operation = Remove
Operation = Upgrade
Type = Package
Target = *
[Action]
Description = Update gist with all installed pacman packages.
When = PostTransaction
Depends = gist
//https://www.x.org/releases/X11R7.5/doc/man/man3/XIWarpPointer.3.html
//https://www.x.org/releases/X11R7.5/doc/man/man3/XOpenDevice.3.html
//https://www.x.org/releases/X11R7.7/doc/libXi/inputlib.html
//http://osr507doc.sco.com/en/man/html.Xext/XTEST.Xext.html
//xinput: ⎜ ↳ mouse XTEST pointer id=16 [slave pointer (14)]
// -> 14 XIWarpPointer; 16 XOpenDevice
//gcc -lXi -lX11 -lXtst -o test BackgroundMouse.c
#include <X11/Xlib.h>
#include <X11/extensions/XInput2.h>
#include <X11/extensions/XTest.h>
// Compile with: gcc -o test XSendEvent3.c -lX11
//https://tronche.com/gui/x/xlib/events/structures.html
//https://tronche.com/gui/x/xlib/events/keyboard-pointer/keyboard-pointer.html#XButtonEvent
//https://www.x.org/releases/X11R7.5/doc/man/man3/XKeyEvent.3.html
#include <X11/Xlib.h>
// Simulate mouse click
void click (Display *display, int button)
{
// Create and setting up the event