Skip to content

Instantly share code, notes, and snippets.

@fikovnik
fikovnik / getxkblayout.c
Created February 7, 2018 09:43
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);
@JBlond
JBlond / bash-colors.md
Last active May 5, 2024 12:18 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@felipec
felipec / asus_fan.c
Created August 6, 2013 21:51
ASUS fan control
/*
*
* obj-m := fan.o
* KDIR := /lib/modules/$(shell uname -r)/build
* PWD := $(shell pwd)
*
* all:
* $(MAKE) -C $(KDIR) M=$(PWD) modules
*
* clean:
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname