View analyze.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
import urllib.request | |
import time | |
import sys | |
patterns = { | |
'i3': ['i3'], | |
'bspwm': ['bspwm'], | |
'awesome': ['awesome'], |
View subscribe-workspace.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example | |
/path/to/wallpaper.pl | while read num; do echo "feh --bg-scale /path/to/wallpaper$num.png"; done | |
# produces | |
# feh --bg-scale /path/to/wallpaper3.png | |
# feh --bg-scale /path/to/wallpaper1.png | |
# ... |
View gist:357f2c2d0c8b1ede639c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/con.c b/src/con.c | |
index aefdcad..bcae637 100644 | |
--- a/src/con.c | |
+++ b/src/con.c | |
@@ -2048,7 +2048,7 @@ gaps_t calculate_effective_gaps(Con *con) { | |
.outer = workspace->gaps.outer + config.gaps.outer}; | |
/* Outer gaps are added on top of inner gaps. */ | |
- gaps.outer += 2 * gaps.inner; | |
+ // gaps.outer += 2 * gaps.inner; |
View interpolate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use https://rxviz.com to see it in action. | |
/** | |
* Interpolates a (numeric) source stream with predicted values based on how | |
* quickly the source stream's value increases. This was intended to smooth out | |
* a progress bar, but should one really use this piece of sheer terror in production? | |
*/ | |
const interpolate = (source$, relax = 50) => { | |
/* This just allows a shorter syntax, avoiding return statements in arrow functions. */ | |
const id = obj => obj; |
View detect-changes-on-change.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2018 Ingo Bürk | |
// Released under the MIT License (https://opensource.org/licenses/MIT) | |
// TODO: Is there a better way to get access to a ChangeDetectorRef from | |
// within the decorator? | |
/** | |
* Decorator for class methods which caches the returned value and, | |
* if the value has changed, triggers change detection. | |
* |
View i3bar-ws-spacing.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c | |
index 6878e29..ced03c6 100644 | |
--- a/i3bar/src/xcb.c | |
+++ b/i3bar/src/xcb.c | |
@@ -129,11 +129,11 @@ static const int ws_hoff_px = 4; | |
static const int ws_voff_px = 3; | |
/* Offset between two workspace buttons */ | |
-static const int ws_spacing_px = 1; | |
+static const int ws_spacing_px = 0; |
View py3lock.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
# -*- coding: utf-8 -*- | |
# vim:ts=2:sw=2:expandtab | |
import os | |
import xcb | |
from xcb.xproto import * | |
from PIL import Image | |
XCB_MAP_STATE_VIEWABLE = 2 |
View gist:567536c94f6d3fe839ac3e0b8497a5e7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am Airblader on github. | |
* I am ingorok (https://keybase.io/ingorok) on keybase. | |
* I have a public key whose fingerprint is 96A5 2700 8D21 5F55 C52D 56EE 1DCA 7EFC 3970 FA1B | |
To claim this, I am signing this object: |
View make_dock.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# call like this: | |
# /path/to/this/script.sh <window_id> <dock height> | |
win="${1:-}" | |
height="${2:-}" | |
width=$(xrandr -q | head -n1 | awk '{print $8}') | |
xdotool windowunmap --sync ${win} | |
xdotool windowsize --sync ${win} ${width} ${height} |