Skip to content

Instantly share code, notes, and snippets.

View tych0's full-sized avatar

Tycho Andersen tych0

View GitHub Profile
~ xtrace xprop -root _NET_DESKTOP_NAMES
No display name to create specified, trying :9
Got connection from unknown(local)
000:<: am lsb-first want 11:0 authorising with 'MIT-MAGIC-COOKIE-1' of length 16
000:>: Success, version is 11:0 vendor='The X.Org Foundation' release=12101004 resource-id=0x07800000 resource-mask=0x001fffff motion-buffer-size=256 max-request-len=65535 image-byte-order=LSBFirst(0x00) bitmap-bit-order=LeastSignificant(0x00) scanline-unit=32 scanline-pad=32 min-keycode=0x08 max-keycode=0x00 pixmap-formats={depth=1 bits/pixel=1 scanline-pad=32},{depth=4 bits/pixel=8 scanline-pad=32},{depth=8 bits/pixel=8 scanline-pad=32},{depth=15 bits/pixel=16 scanline-pad=32},{depth=16 bits/pixel=16 scanline-pad=32},{depth=24 bits/pixel=32 scanline-pad=32},{depth=32 bits/pixel=32 scanline-pad=32}; roots={root=0x0000052b default-colormap=0x00000022 white-pixel=0x00ffffff black-pixel=0x00000000 input-mask=KeyPress,KeyRelease,ButtonPress,EnterWindow,LeaveWindow,StructureNotify,SubstructureNotify,SubstructureRe
2024-04-23T13:37:36.5583925Z Current runner version: '2.315.0'
2024-04-23T13:37:36.5613985Z ##[group]Operating System
2024-04-23T13:37:36.5614807Z Ubuntu
2024-04-23T13:37:36.5615113Z 22.04.4
2024-04-23T13:37:36.5615429Z LTS
2024-04-23T13:37:36.5616402Z ##[endgroup]
2024-04-23T13:37:36.5616799Z ##[group]Runner Image
2024-04-23T13:37:36.5617469Z Image: ubuntu-22.04
2024-04-23T13:37:36.5618304Z Version: 20240414.1.0
2024-04-23T13:37:36.5619306Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240414.1/images/ubuntu/Ubuntu2204-Readme.md
/tmp export PATH=/tmp/pypy3.10-v7.3.13-linux64/bin:$PATH
/tmp pypy3 --version
Python 3.10.13 (f1607341da97ff5a1e93430b6e8c4af0ad1aa019, Sep 28 2023, 05:41:26)
[PyPy 7.3.13 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]
/tmp pypy3 -m venv cairo-segfault
/tmp source cairo-segfault/bin/activate
/tmp CFLAGS=-g pip install pycairo
/tmp/cairo-segfault/lib/pypy3.10/site-packages/pip/_vendor/certifi/cacert.pem None
Collecting pycairo
Using cached pycairo-1.25.0.tar.gz (347 kB)
@tych0
tych0 / README.md
Last active February 27, 2024 20:15
a script to set up monitors

Here's a script to do xrandr style manipulation via xcffib. It does:

  1. runs everything in its preferred mode
  2. automatic DPI scaling to match the highest DPI monitor if the monitors do not have the same DPI
  3. EDID resolution so that people can reason about devices with stable names

It's not really intended to be consumable by anyone besides someone who might want to design a real abstraction on top and needs to know what the API calls for scaling/disabling monitors/rotating things would look like in python.

@tych0
tych0 / gist:4b25de5d0a8c3eaba14b
Created August 13, 2014 04:14
normal xtrace of qtile
This file has been truncated, but you can view the full file.
Xsession: X session started for tycho at Tue Aug 12 23:08:14 CDT 2014
localuser:tycho being added to access control list
Script for none started at run_im.
Script for auto started at run_im.
Script for default started at run_im.
Script for none started at run_im.
Script for auto started at run_im.
Script for default started at run_im.
Warning: Key <OUTP> not found in evdev+aliases(qwerty) keycodes
Symbols ignored
@tych0
tych0 / bt
Last active August 29, 2015 14:04 — forked from flacjacket/bt
Program received signal SIGSEGV, Segmentation fault.
tupledealloc (op=0x7fffeabfc9f0) at /var/tmp/portage/dev-lang/python-2.7.7/work/Python-2.7.7/Objects/tupleobject.c:222
222 /var/tmp/portage/dev-lang/python-2.7.7/work/Python-2.7.7/Objects/tupleobject.c: No such file or directory.
#0 tupledealloc (op=0x7fffeabfc9f0) at /var/tmp/portage/dev-lang/python-2.7.7/work/Python-2.7.7/Objects/tupleobject.c:222
#1 0x00007ffff7af7629 in call_function (oparg=<optimized out>, pp_stack=0x7fffffffb970) at /var/tmp/portage/dev-lang/python-2.7.7/work/Python-2.7.7/Python/ceval.c:4022
#2 PyEval_EvalFrameEx (
f=f@entry=Frame 0x9cfa40, for file /usr/lib64/python2.7/site-packages/xcffib-v0.1.1-py2.7-linux-x86_64.egg/xcffib/__init__.py, line 494, in send_request (self=<Connection(_conn=<_cffi_backend.CData at remote 0x7ffff3492300>, core=<xprotoExtension(ext_name=None, conn=<...>) at remote 0x7ffff34a5fd0>, setup=<Setup(protocol_minor_version=0, vendor=<List(bufsize=20, list=['T', 'h', 'e', ' ', 'X', '.', 'O', 'r', 'g', ' ',
data HaggisConfig = HaggisConfig {
-- | Path to where the files are hosted, e.g: /foo, /, /foo/bar/, defaults
-- to /
sitePath :: String,
-- | Default author, so you don't have to put an author in every post's
-- metadata.
defaultAuthor :: Maybe String,
-- | Hostname where the blog is hosted, used for generating RSS feed links.
smitten:~/playground$ python
Python 2.7.4 (default, Apr 19 2013, 18:28:01)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> def gotcha(foo=[]): return foo
...
>>> gotcha().append(1)
>>> gotcha()
[1]
>>>
diff --git a/libqtile/widget/volume.py b/libqtile/widget/volume.py
index da0a97a..5cbb494 100644
--- a/libqtile/widget/volume.py
+++ b/libqtile/widget/volume.py
@@ -57,7 +57,7 @@ class Volume(base._TextBox):
vol = self.get_volume()
if vol != self.volume:
self.volume = vol
- self.draw()
+ self.bar.draw()
@tych0
tych0 / gist:5267461
Last active December 15, 2015 13:29
# put a Prompt widget in your bar
def my_func(prompt_result):
pass
def start_prompt(qtile):
p = qtile.widgetMap["prompt"]
p.startInput("hax> ", my_func)
Key(["mod4"], "r", lazy.function(start_prompt))