Skip to content

Instantly share code, notes, and snippets.

View ammgws's full-sized avatar
🐨

Jason Nader ammgws

🐨
View GitHub Profile
edid-decode (hex):
00 ff ff ff ff ff ff 00 04 72 69 04 7f 3b 20 55
34 19 01 03 80 3c 22 78 2a 2f a5 a5 54 50 9e 27
10 50 54 b3 0c 00 81 80 81 c0 81 00 95 00 b3 00
d1 c0 01 01 01 01 02 3a 80 18 71 38 2d 40 58 2c
45 00 56 50 21 00 00 1e 00 00 00 fd 00 37 4c 1e
53 11 00 0a 20 20 20 20 20 20 00 00 00 ff 00 54
33 51 53 4a 30 30 31 34 32 30 30 0a 00 00 00 fc
00 41 63 65 72 20 4b 41 32 37 30 48 0a 20 01 c6
edid-decode (hex):
00 ff ff ff ff ff ff 00 04 72 69 04 7f 3b 20 55
34 19 01 03 80 3c 22 78 2a 2f a5 a5 54 50 9e 27
10 50 54 b3 0c 00 81 80 81 c0 81 00 95 00 b3 00
d1 c0 01 01 01 01 02 3a 80 18 71 38 2d 40 58 2c
45 00 56 50 21 00 00 1e 00 00 00 fd 00 37 4c 1e
53 11 00 0a 20 20 20 20 20 20 00 00 00 ff 00 54
33 51 53 4a 30 30 31 34 32 30 30 0a 00 00 00 fc
00 41 63 65 72 20 4b 41 32 37 30 48 0a 20 01 c6
{
"\/dev\/dri\/card0": {
"driver": {
"name": "amdgpu",
"desc": "AMD GPU",
"version": {
"major": 3,
"minor": 36,
"patch": 0,
"date": "20150101"
{
"\/dev\/dri\/card0": {
"driver": {
"name": "amdgpu",
"desc": "AMD GPU",
"version": {
"major": 3,
"minor": 36,
"patch": 0,
"date": "20150101"
Node: /dev/dri/card0
β”œβ”€β”€β”€Driver: amdgpu (AMD GPU) version 3.36.0 (20150101)
β”‚ β”œβ”€β”€β”€DRM_CLIENT_CAP_STEREO_3D supported
β”‚ β”œβ”€β”€β”€DRM_CLIENT_CAP_UNIVERSAL_PLANES supported
β”‚ β”œβ”€β”€β”€DRM_CLIENT_CAP_ATOMIC supported
β”‚ β”œβ”€β”€β”€DRM_CLIENT_CAP_ASPECT_RATIO supported
β”‚ β”œβ”€β”€β”€DRM_CLIENT_CAP_WRITEBACK_CONNECTORS supported
β”‚ β”œβ”€β”€β”€DRM_CAP_DUMB_BUFFER = 1
β”‚ β”œβ”€β”€β”€DRM_CAP_VBLANK_HIGH_CRTC = 1
β”‚ β”œβ”€β”€β”€DRM_CAP_DUMB_PREFERRED_DEPTH = 24
Node: /dev/dri/card0
β”œβ”€β”€β”€Driver: amdgpu (AMD GPU) version 3.36.0 (20150101)
β”‚ β”œβ”€β”€β”€DRM_CLIENT_CAP_STEREO_3D supported
β”‚ β”œβ”€β”€β”€DRM_CLIENT_CAP_UNIVERSAL_PLANES supported
β”‚ β”œβ”€β”€β”€DRM_CLIENT_CAP_ATOMIC supported
β”‚ β”œβ”€β”€β”€DRM_CLIENT_CAP_ASPECT_RATIO supported
β”‚ β”œβ”€β”€β”€DRM_CLIENT_CAP_WRITEBACK_CONNECTORS supported
β”‚ β”œβ”€β”€β”€DRM_CAP_DUMB_BUFFER = 1
β”‚ β”œβ”€β”€β”€DRM_CAP_VBLANK_HIGH_CRTC = 1
β”‚ β”œβ”€β”€β”€DRM_CAP_DUMB_PREFERRED_DEPTH = 24
# output size of `swaymsg -t get_outputs`,
# run every 5 minutes
#
# time bytes diff
March 1 16:55 12994 0
March 1 16:56 12994 0
March 1 16:56 12994 0
March 1 16:56 12994 0
March 1 16:56 12994 0
March 1 17:22 12994 0

OK sudo strace -- swaymsg --socket $SWAYSOCK -t get_inputs 2> swaymsg_getinputs_withswaysock.log

 44 socket(AF_UNIX, SOCK_STREAM, 0)         = 3
 45 connect(3, {sa_family=AF_UNIX, sun_path="/run/user/1000/sway-ipc.1000.1324.sock"}, 110) = 0
 46 setsockopt(3, SOL_SOCKET, SO_RCVTIMEO_OLD, "\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0
 47 write(3, "i3-ipc\0\0\0\0d\0\0\0", 14)   = 14
 48 write(3, "", 0)                         = 0
 49 recvfrom(3, "i3-ipc\31\26\0\0d\0\0\0", 14, 0, NULL, NULL) = 14
 50 recvfrom(3, "[ { \"identifier\": \"0:0:Eee_PC_WM"..., 5657, 0, NULL, NULL) = 5657
import re
from pathlib import Path
from langdetect import detect
p = Path("/tmp/f/fish-shell/po/")
pattern = re.compile('^msgstr\s*"(.{10,})"')
for pofile in list(p.glob('*.po')):
language = []
with open(pofile) as f:
po_data = f.readlines()
@ammgws
ammgws / fish_dev_scan_PO_files.py
Last active October 16, 2021 04:49
Find unused functions etc used in fish shell's PO files
import re
from pathlib import Path
p = Path("/tmp/fish-shell/po/")
for pofile in list(p.glob('*.po')):
print(f"=============================\n{pofile}\n=============================")
with open(pofile) as f:
po_data = f.readlines()
del_these = set()