Skip to content

Instantly share code, notes, and snippets.

-- Near the top of rc.lua:
local guieditor = "/usr/bin/gedit" -- if you haven't already defined something
do
local useful_props = {
"type", "name", "role", "class", "instance", "machine", "icon_name", "screen";
"skip_taskbar", "pid";
"startup_id", "window", "group_window", "leader_window";
}

awesome-client

The Awesome window manager is a great scriptable tiling window manager. It uses Lua as its scripting language.

Sometimes you might want to control awesome from scripts or other external processes. Thankfully it provides a handy utility for this: awesome-client.

How it works

@mwild1
mwild1 / spawn-terminal-same-directory.lua
Created January 13, 2022 11:31
Config snippet for Awesome WM to spawn terminal in current directory
--[[
This snippet works with rxvt-unicode. If you hit Mod+Return while
you have a terminal window focused, the new terminal window will
begin in the same directory instead of the default (your home directory).
--]]
awful.key({ modkey, }, "Return", function ()
local extra_args = "";
local curr_client = client.focus;
if curr_client and curr_client.class == "URxvt" then
local shell_pid = io.popen("ps h --ppid "..curr_client.pid.." -o pid"):read("*l"):gsub("%s+", "");
@mwild1
mwild1 / snikket-update-20200513.md
Last active January 26, 2021 19:15
Snikket Server: Updating from the initial alpha release to 20200512+

This update requires changes to the configuration of the container. Assuming you followed the quickstart guide on our website, you need do the following:

cd /etc/snikket

Open docker-compose.yml and remove the 'ports' section, and add network_mode:host. You can view the changes you need to make, or just fetch the updated version of

-- Based on Simple SQL Authentication module for Prosody IM
-- Copyright (C) 2011 Tomasz Sterna <tomek@xiaoka.com>
-- Copyright (C) 2011 Waqas Hussain <waqas20@gmail.com>
--
-- 25/05/2014: Modified for Diaspora by Anahuac de Paula Gil - anahuac@anahuac.eu
-- 06/08/2014: Cleaned up and fixed SASL auth by Jonne Haß <me@jhass.eu>
-- 22/11/2014: Allow token authentication by Jonne Haß <me@jhass.eu>
local log = require "util.logger".init("auth_diaspora")
local new_sasl = require "util.sasl".new
@mwild1
mwild1 / keybase.md
Created February 4, 2015 16:07
keybase.md

Keybase proof

I hereby claim:

  • I am mwild1 on github.
  • I am mattj (https://keybase.io/mattj) on keybase.
  • I have a public key whose fingerprint is 32A9 EDDE 3609 931E B98C EAC3 1590 7E8E 7BDD 6BFE

To claim this, I am signing this object:

-- Original
if answer == "r" then
if NMH == true then
STR = math.random(3, 18) + 2
DEX = math.random(3, 18) + 2
SIZE = math.random(3, 18) + 2
CON = math.random(3, 18) + 2
INT = math.random(3, 18) + 2
WILL = math.random(3, 18) + 2
CHR = math.random(3, 18) + 2
local wrapclient = require "net.server".wrapclient;
local socket = require "socket";
local coroutine = coroutine;
local comap = {};
local function yield(conn)
comap[conn] = coroutine.running();
local r = coroutine.yield();
-- Recive a HTTP POST and relay it
-- By Kim Alvefur <zash@zash.se>
-- Some code borrowed from mod_webpresence
--
-- Example usage:
-- curl http://example.com:5280/presence/user -d "Hello there"
-- or
-- curl http://example.com:5280/presence/user@example.com -d "Hello there"
-- This would set presence of user@example.com with status 'Hello there'
-- another example: