Skip to content

Instantly share code, notes, and snippets.

@Tucos
Tucos / conkyrc
Created February 5, 2015 18:51
Non-latin detection in conky variables
out_to_x no
out_to_console yes
TEXT
${if_match "${eval $${exec ./script.sh '${time %A}'}}" == "latin"}boring${else}exciting!${endif}
own_window yes
own_window_type panel
alignment tl
minimum_size 500 500
lua_load dock.lua
lua_draw_hook_pre draw_pre
TEXT
@Tucos
Tucos / 0001-Perform-proper-reordering-and-shaping-of-glyphs.patch
Created December 28, 2014 13:19
0001-Perform-proper-reordering-and-shaping-of-glyphs.patch
From 9fdb5a85b250cc0bb80deb9f2783a16c9dcc7777 Mon Sep 17 00:00:00 2001
From: Bas Pape <baspape@gmail.com>
Date: Sun, 28 Dec 2014 13:30:43 +0100
Subject: [PATCH] Perform proper reordering and shaping of glyphs
All RTL languages require reordering of the characters before drawing
them, and various scripts require positional shaping (e.g. Arabic and
Mongolian) as well. FriBidi [1] implements the Unicode Bidirectional
Algorithm (UAX#9, [2]) and has a simple API (a single function call) to
do both reordering and reshaping.
@Tucos
Tucos / buttonpress.c
Created August 4, 2014 19:17
Clickable conky thingies
/* Compile with `make CFLAGS='-std=c99' LOADLIBES='-lX11' buttonpress` */
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
Window GetWindowFromID(Display *display, Window start, int targetid, int level) {
Window root, parent, *children;
unsigned int nchildren;