Skip to content

Instantly share code, notes, and snippets.

@Darkhogg
Darkhogg / GetIconTheme.md
Created October 5, 2023 22:22
Get Icon Theme in every Desktop

Get Icon Theme in Every Desktop

If you've ever tried to manually look for the current icon theme, you've probably come to the (correct) conclusion that it's simply impossible to do it in a portable way: each desktop environment in existence stores that information in a different place, and it's none give out that info in a common way.

In order to find out the current icon theme then, we first need to find out the current desktop environment and only then we can get the current icon theme in a desktop-dependent way. To do that, we can use the following environemnt variables:

  • XDG_SESSION_DESKTOP: contains the name of the current session name.
  • XDG_CURRENT_DESKTOP: contains a :-separated list of current desktop names.
@Darkhogg
Darkhogg / G203SlowDimCycle.py
Created January 19, 2018 21:32
Set slow and dim color cycle for G203 Mouse
import usb.core
import usb.util
import binascii
VENDOR = 0x046d
PRODUCT = 0xc084
INDEX = 0x0001
REQUEST_TYPE = 0x21
REQUEST = 0x09
VALUE = 0x0210
@Darkhogg
Darkhogg / !RebootToOs.md
Last active April 22, 2024 09:20
"Reboot to {OS}" scripts for rEFInd Next Boot selection

Reboot to {OS}

This a collection of notes and files used in my quest to create "Reboot to Windows" and "Reboot to Linux" scripts (and desktop shortcuts) for Linux and Windows respectively that automatically reboot my system and instruct rEFInd to auto-select the appropriate OS entry.

General Information

The key for achieving this is to modify the EFI Variable PreviousBoot with GUID 36d08fa7-cf0b-42f5-8f14-68df73ed3740, which rEFInd uses to store the last entry selected in the menu and, if using the + default entry, will be used to select the default OS. By doing this, we trick rEFInd into booting the OS we choose without having to be physically there to press the keyboard.

@Darkhogg
Darkhogg / kakuro-sums.json
Last active June 12, 2017 10:48
List of Kakuro sums
{
"n1_s1": [
[1]
],
"n2_s1": [
[2]
],
"n3_s1": [
[3]
],

Keybase proof

I hereby claim:

  • I am darkhogg on github.
  • I am darkhogg (https://keybase.io/darkhogg) on keybase.
  • I have a public key whose fingerprint is 64E3 1E88 08F4 25B1 400A 33F2 9DC6 A8F0 4AAD D567

To claim this, I am signing this object:

@Darkhogg
Darkhogg / !FactorioDokku.md
Last active January 26, 2018 07:41
Factorio Headless Server on Dokku

Factorio Server on Dokku

This document and associated files describe a very simple procedure to push a Dokku application that will launch a Factorio Multiplayer Server. This are the actual files used to launch my Factorio server, so you should trust that it works.

Dokku Setup

@Darkhogg
Darkhogg / genmon-loadavg.py
Last active March 5, 2016 16:17
Generic Monitor script for Xfce that shows the normalized load average in color
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import multiprocessing as mp
import os
import sys
KEYPOINTS = (
@Darkhogg
Darkhogg / README.md
Last active August 29, 2015 14:22
HexChat script for Werebot

Werebot HexChat Helper

This simple Python script will make a few repetitive tasks easy when playing Werebot. What it does is:

  • Sends any Werebot commands directly to the bot, which prevents the disclosure of your role by accidentaly sending a command at the wrong time and makes it easier to use commands at night (i.e., when the channel is fully muted).
  • Automatically joins any of the official Werebot channels when the bot invites you, particularly useful for auto-joining the werewolf channel.

To install it, you will need both HexChat and Python 2.7 installed. Download and install them from https://hexchat.github.io/downloads.html. When installing HexChat, be sure to select and install the Python 2.7 plugin.

@Darkhogg
Darkhogg / factorio-update.sh
Created January 23, 2015 15:03
A small script to update the factorio-experimental AUR package automatically without any manual intervention
#!/bin/bash
function msg () {
local FMT="$1"
shift
printf "\x1B[1;35m==> \x1B[;1m${FMT}\x1B[m\n" "$@"
}
function msg2 () {
local FMT="$1"