Skip to content

Instantly share code, notes, and snippets.

View farhaven's full-sized avatar
🦄
I'm a unicorn.

Gregor Best farhaven

🦄
I'm a unicorn.
View GitHub Profile
client.add_signal("manage", function (c, startup)
if client_destination[c.pid] == nil then return end
local s = client_destination[c.pid][1]
local t = client_destination[c.pid][2]
c.screen = s
c:tags({ t })
end)
-- local have_strict, strict = pcall(require, 'strict') -- strict checking for unassigned variables, like perl's use strict
require('awful')
require('awful.autofocus')
require('beautiful')
require('naughty') -- Naughtyfications
require('wibox')
local have_obvious, obvious = pcall(require, 'obvious') -- Obvious widget library, get it from git://git.mercenariesguild.net/obvious.git
local have_tagger, tagger = pcall(require, 'tagger') -- Dynamic Tagging
-- {{{ Functions
-- Environment
local awful = require('awful')
local capi = {
tag = tag,
mouse = mouse,
screen = screen,
keygrabber = keygrabber,
client = client
}
local ipairs = ipairs
#define _POSIX_SOURCE
#define _BSD_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>
@farhaven
farhaven / gist:816407
Created February 8, 2011 13:01
This one fails
_NET_WM_STATE(ATOM) =
_PIDGIN_UNSEEN_COUNT(CARDINAL) = 0
_NET_WM_DESKTOP(CARDINAL) = 1
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x140b8a0
@farhaven
farhaven / gist:816408
Created February 8, 2011 13:02
this one doesn't work
_NET_WM_DESKTOP(CARDINAL) = 4
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x160009a
bitmap id # of mask for icon: 0x160009b
window id # of group leader: 0x1600001
@farhaven
farhaven / gist:816410
Created February 8, 2011 13:03
this one works :D
_NET_WM_STATE(ATOM) =
_PIDGIN_UNSEEN_COUNT(CARDINAL) = 0
_NET_WM_DESKTOP(CARDINAL) = 1
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x140c99d
print("new window: class=\"" .. (c.class and c.class or "none") .. "\", instance=\"" .. (c.instance and c.instance or "none") .. "\", name=\"" .. (c.name and c.name or "none") .. "\"")
if c.name and c.name:find("OpenOffice.org Impress") then
print("new ooimpress window managed")
-- press F5 to immediately start presentation mode
root.fake_input("key_press", "71")
root.fake_input("key_release", "71")
elseif c.class and c.class:find("OpenOffice") then
print("new oo window managed")
c.ontop = true
print("new window: class=\"" .. (c.class and c.class or "none") ..
"\", instance=\"" .. (c.instance and c.instance or "none") ..
"\", name=\"" .. (c.name and c.name or "none") .. "\"")
if c.class and c.class:find("OpenOffice") then
print("new oo window managed")
if c.instance and c.instance == "VCLSalFrame" then
c.ontop = true
else
print("new ooimpress window managed")
c.maximized_horizontal = true
c.maximized_vertical = true