Skip to content

Instantly share code, notes, and snippets.

View setkeh's full-sized avatar

James (setkeh) Griffis setkeh

View GitHub Profile
@setkeh
setkeh / pacmanup.lua
Created July 14, 2012 18:37
Pacman Updates Naughty
-- {{{ init environment
local M = {}
local capi = {
mouse = mouse,
screen = screen
}
pacmanup = {}
local f = io.popen("$(pacman -Qqu)", "r")
local s = f:read('*a')
f:close()
@setkeh
setkeh / BGfunc
Created July 16, 2012 23:35
Converting Bash Widgets to Background Functions
background_timers = {}
function run_background(cmd,funtocall)
local r = io.popen("mktemp")
local logfile = r:read("*line")
r:close()
cmdstr = cmd .. " &> " .. logfile .. " & "
local cmdf = io.popen(cmdstr)
cmdf:close()
@setkeh
setkeh / rc.lua
Created July 22, 2012 05:06
Awesome WM Lua Debugger
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!",
text = awesome.startup_errors })
end
-- Handle runtime errors after startup
local chrome = require "chrome"
local cutycapt_bin = "/usr/bin/CutyCapt"
local cutycapt_opt = "--min-width=1024 --min-height=768"
local mogrify_bin = "/usr/bin/mogrify"
local mogrify_opt = "-extent 1024x768 -size 240x180 -resize 240x180"
local profile = profile
local html_template = [==[
<html>
<head>
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <[email protected]>
" Last change: 2011 Apr 15
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
" for OpenVMS: sys$login:.vimrc
http://www.linuxdistrocommunity.com/forums/index.php /home/setkeh/.local/share/luakit/thumb-httpwwwlinuxdistrocommunitycomforumsindexphp.png no Linux Distro Community
http://luakit.org /home/setkeh/.local/share/luakit/thumb-httpluakitorg.png no Luakit
https://github.com/mason-larobina/luakit /home/setkeh/.local/share/luakit/thumb-httpsgithubcommasonlarobinaluakit.png no Luakit Git
https://github.com/idk /home/setkeh/.local/share/luakit/thumb-httpsgithubcomidk.png no PDQ Git
https://gist.github.com/ /home/setkeh/.local/share/luakit/thumb-httpsgistgithubcom.png no GistHub
search_engines = {
luakit = "http://luakit.org/search/index/luakit?q=%s",
google = "http://google.com/search?q=%s",
duckduckgo = "http://duckduckgo.com/?q=%s",
archpak = "https://www.archlinux.org/packages/?q=%s",
archaur = "https://aur.archlinux.org/packages.php?O=0&K=%s&do_Search=Go",
archwiki = "https://wiki.archlinux.org/index.php?search=%s",
archforum = "https://bbs.archlinux.org/search.php?keyword=%s",
gentoowiki = "http://wiki.gentoo.org/index.php?search=%s",
github = "https://github.com/search?q=%s",
-- Global variables for luakit
globals = {
homepage = "luakit://favs/",
-- homepage = "http://luakit.org/",
-- homepage = "http://github.com/mason-larobina/luakit",
scroll_step = 40,
zoom_step = 0.1,
max_cmd_history = 100,
max_srch_history = 100,
-- http_proxy = "http://example.com:3128",
search_engines = {
luakit = "http://luakit.org/search/index/luakit?q=%s",
google = "http://google.com/search?q=%s",
duckduckgo = "http://duckduckgo.com/?q=%s",
archpak = "https://www.archlinux.org/packages/?q=%s",
archaur = "https://aur.archlinux.org/packages.php?O=0&K=%s&do_Search=Go",
archwiki = "https://wiki.archlinux.org/index.php?search=%s",
archforum = "https://bbs.archlinux.org/search.php?keyword=%s",
gentoowiki = "http://wiki.gentoo.org/index.php?search=%s",
github = "https://github.com/search?q=%s",
-- Standard awesome library
require("awful")
require("awful.autofocus")
require("awful.rules")
require("awful.wibox")
require("awful.widget")
require("awful.widget.graph")
-- Widget and layout library
require("wibox")
-- Theme handling library