Skip to content

Instantly share code, notes, and snippets.

View usrshare's full-sized avatar

/usr/share usrshare

View GitHub Profile
@usrshare
usrshare / multiple_fonts-st-0.8.2.patch
Created March 14, 2019 07:50
Implements the ability to switch between fonts and keep columns/rows count upon zooming or changing fonts
diff -u st-0.8.2.orig/config.def.h st-0.8.2/config.def.h
--- st-0.8.2.orig/config.def.h 2019-02-09 14:50:41.000000000 +0300
+++ st-0.8.2/config.def.h 2019-03-14 10:05:43.062325273 +0300
@@ -5,7 +5,7 @@
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
-static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
+static char *font[] = {"Liberation Mono:pixelsize=12:antialias=true:autohint=true","Anonymous Pro:pizelsize=10","xos4 Terminus:pixelsize=16"};
static int borderpx = 2;
@usrshare
usrshare / alsabeep-st-0.8.2.patch
Created March 14, 2019 07:49
the alsabeep patch, updated for st 0.8.2
diff -Nu st-0.8.2.orig/alsabeep.c st-0.8.2/alsabeep.c
--- st-0.8.2.orig/alsabeep.c 1970-01-01 03:00:00.000000000 +0300
+++ st-0.8.2/alsabeep.c 2019-03-14 10:18:47.915677588 +0300
@@ -0,0 +1,77 @@
+#include <alsa/asoundlib.h>
+#include <alsa/pcm.h>
+#include <math.h>
+#include "alsabeep.h"
+
+#define BUFFER_LEN 48000
@usrshare
usrshare / ncdu-1.12-uniblocks.patch
Created October 24, 2017 09:49
This patch file adds an extra compile-time option into ncdu, which allows to use Unicode block characters instead of hash signs to draw graphs.
diff -ru ncdu-1.12.orig/aclocal.m4 ncdu-1.12/aclocal.m4
--- ncdu-1.12.orig/aclocal.m4 2016-08-24 21:57:21.000000000 +0300
+++ ncdu-1.12/aclocal.m4 2017-10-24 12:39:20.558374267 +0300
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
@usrshare
usrshare / ncal_russian_feb_1918.txt
Created July 23, 2017 13:30
When set to Russian, "ncal" accurately represents the switch from Julian to Gregorian by omitting 1st through 13th of February, 1918.
usrshare@ny1:~/software$ LANG=ru_RU.UTF-8 ncal 2 1918
Февраль 1918
Пн 18 25
Вт 19 26
Ср 20 27
Чт 14 21 28
Пт 15 22
Сб 16 23
Вс 17 24

Keybase proof

I hereby claim:

To claim this, I am signing this object:

#!/bin/bash
function rxvt_set_bg { #arg: filename
FILE="$(realpath "$1")"
BGDATA="$(convert "$FILE" -crop '1x1+0+0' txt:-)" #get color of top-left pixel for background
RGB="$(echo "$BGDATA" | grep -P -o '(?<=\().*(?=\))')"
R="$(echo "$RGB" | awk -F ',' '{print $1}')" #get value of each
G="$(echo "$RGB" | awk -F ',' '{print $2}')" #color to determine
B="$(echo "$RGB" | awk -F ',' '{print $3}')" #if background is dark or bright
diff -rap _gpicview-0.2.5/src/image-view.c gpicview-0.2.5/src/image-view.c
*** _gpicview-0.2.5/src/image-view.c 2016-02-21 01:38:31.000000000 +0300
--- gpicview-0.2.5/src/image-view.c 2017-01-19 09:44:25.144181631 +0300
*************** void image_view_set_scale( ImageView* iv
*** 360,365 ****
--- 360,366 ----
return;
// gdouble factor = new_scale / iv->scale;
iv->scale = new_scale;
+ iv->interp_type = type;
@usrshare
usrshare / st-alsabeep-0.7.diff
Created January 12, 2017 08:00
Patch for st (st.suckless.org) that changes the Xkb bell to an ALSA-based beep.
diff -Nup st-0.7.orig/alsabeep.c st-0.7/alsabeep.c
--- st-0.7.orig/alsabeep.c 1970-01-01 03:00:00.000000000 +0300
+++ st-0.7/alsabeep.c 2017-01-12 10:47:27.900526735 +0300
@@ -0,0 +1,76 @@
+#include <alsa/asoundlib.h>
+#include <alsa/pcm.h>
+#include <math.h>
+#include "alsabeep.h"
+
+#define BUFFER_LEN 48000
--- st-0.6/config.def.h
+++ st-0.6bold/config.def.h
@@ -32,6 +32,9 @@
/* alt screens */
static bool allowaltscreen = true;
+/* use bold font */
+static bool allowboldtext = true;
+
/* frames per second st should at maximum draw to the screen */
#!/bin/sh
# This shell script creates a pipemenu for an sshfs called "hbdrive".
echo "<openbox_pipe_menu>"
if (mount | grep hbdrive > /dev/null) then
echo "<separator label=\"Status: ON\"/>"; else
echo "<separator label=\"Status: OFF\"/>"; fi
cat << HD_END
<item label="unmount">
<action name="Execute">
<execute>fusermount -u ~/hbdrive</execute>