Skip to content

Instantly share code, notes, and snippets.

@krkhan
krkhan / md5.go
Last active July 14, 2023 00:18 — forked from lucabrunox/md5.go
Incremental golang md5
package main
/*
#cgo pkg-config: openssl
#include <openssl/md5.h>
*/
import "C"
import (
"encoding/hex"
@krkhan
krkhan / xscreensaver.patch
Created May 21, 2021 14:26
switch matrix colors
diff '--color=auto' -Naur xscreensaver-6.00/hacks/glx/glmatrix.c xscreensaver-6.00.patched/hacks/glx/glmatrix.c
--- xscreensaver-6.00/hacks/glx/glmatrix.c 2021-02-07 12:15:42.000000000 -0800
+++ xscreensaver-6.00.patched/hacks/glx/glmatrix.c 2021-05-02 17:21:54.254157186 -0700
@@ -213,6 +213,11 @@
{&do_texture, "texture", "Texture", DEF_TEXTURE, t_Bool},
};
+static unsigned char rgb_red = 0xFF;
+static unsigned char rgb_green = 0x00;
+static unsigned char rgb_blue = 0x00;
@krkhan
krkhan / i3-toggle-workspace-layout.py
Created June 25, 2020 21:23
Toggle i3 workspace layouts on the fly
#!/usr/bin/env python3
import argparse
import os
from pathlib import Path
from i3ipc import Connection
from time import sleep
parser = argparse.ArgumentParser()
@krkhan
krkhan / polybar-i3-skip-ws.patch
Last active February 21, 2023 22:15
hidden workspaces
diff --git a/src/modules/i3.cpp b/src/modules/i3.cpp
index 383a39f..e16d2ab 100644
--- a/src/modules/i3.cpp
+++ b/src/modules/i3.cpp
@@ -160,6 +160,15 @@ namespace modules {
// Trim leading and trailing whitespace
ws_name = string_util::trim(move(ws_name), ' ');
+ if (ws_name.back() == '_' && !ws->visible) {
+ continue;