Skip to content

Instantly share code, notes, and snippets.

View AriaMoradi's full-sized avatar
🏠
Working from home

Aria Moradi AriaMoradi

🏠
Working from home
View GitHub Profile
@AriaMoradi
AriaMoradi / i3-get-window-criteria
Created December 22, 2020 22:16 — forked from jottr/i3-get-window-criteria
Get window criteria to use with i3 window placement. Taken from: http://bit.ly/1e9pcfe
#!/bin/sh
# i3-get-window-criteria - Get criteria for use with i3 config commands
# To use, run this script, then click on a window.
# Output is in the format: [<name>=<value> <name>=<value> ...]
# Known problem: when WM_NAME is used as fallback for the 'title="<string>"' criterion,
# quotes in "<string>" are not escaped properly. This is a problem with the output of `xprop`,
# reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807
@AriaMoradi
AriaMoradi / getxkblayout.c
Created April 18, 2020 19:54 — forked from fikovnik/getxkblayout.c
Get keyboard layout using X11
// compile with `gcc -I/usr/include getxkblayout.c -lX11 -lxkbfile`
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/XKBlib.h>
#include <X11/extensions/XKBrules.h>
int main(int argc, char **argv) {
Display *dpy = XOpenDisplay(NULL);