Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
4c6543322c |
392 changed files with 4213 additions and 11884 deletions
79
.Xdefaults
Normal file
79
.Xdefaults
Normal file
|
@ -0,0 +1,79 @@
|
|||
|
||||
urxvt.internalBorder: 0
|
||||
|
||||
urxvt.loginShell: true
|
||||
urxvt.scrollBar: false
|
||||
urxvt.secondaryScroll: true
|
||||
urxvt.saveLines: 65535
|
||||
urxvt.cursorBlink: false
|
||||
urxvt.cursorUnderline: true
|
||||
urxvt.urgentOnBell: true
|
||||
urxvt.termName: rxvt-256color
|
||||
urxvt.visualBell: false
|
||||
|
||||
urxvt.perl-lib: /usr/lib/urxvt/perl/
|
||||
urxvt.perl-ext-common: default,url-select,keyboard-select
|
||||
urxvt.urlLauncher: conkeror
|
||||
urxvt.url-select.launcher: conkeror
|
||||
urxvt.matcher.button: 1
|
||||
urxvt.keysym.M-Escape: perl:keyboard-select:activate
|
||||
urxvt.keysym.M-s: perl:keyboard-select:search
|
||||
|
||||
urxvt.keysym.M-u: perl:url-select:select_next
|
||||
|
||||
urxvt.font: xft:Monaco:weight=medium:pixelsize=18
|
||||
urxvt.boldFont: xft:Monaco:weight=black:pixelsize=18
|
||||
! urxvt.italicFont: xft:Monaco:slant=italic:pixelsize=18
|
||||
|
||||
urxvt.background: #111113
|
||||
urxvt.foreground: #eeeeec
|
||||
|
||||
urxvt.color0: #171719
|
||||
urxvt.color8: #999999
|
||||
|
||||
urxvt.color1: #973732
|
||||
urxvt.color9: #ff756e
|
||||
|
||||
urxvt.color2: #405c2e
|
||||
urxvt.color10: #9ad870
|
||||
|
||||
urxvt.color3: #835c0e
|
||||
urxvt.color11: #ffbb56
|
||||
|
||||
urxvt.color4: #2729b6
|
||||
urxvt.color12: #78a2c1
|
||||
|
||||
urxvt.color5: #5c325d
|
||||
urxvt.color13: #c39cc3
|
||||
|
||||
urxvt.color6: #208181
|
||||
urxvt.color14: #93d8d8
|
||||
|
||||
urxvt.color7: #222224
|
||||
urxvt.color15: #a9a9a9
|
||||
|
||||
Xft.antialias: true
|
||||
Xft.rgba: rgb
|
||||
Xft.hinting: true
|
||||
Xft.hintstyle: hintslight
|
||||
|
||||
! Emacs.font: DejaVu Sans Mono:weight=medium:pixelsize=18
|
||||
Emacs.menuBar: off
|
||||
Emacs.toolbar: off
|
||||
Emacs.useXIM: off
|
||||
! Emacs.background: #252a2b
|
||||
|
||||
xfontsel.sampleText: \
|
||||
static void print_sample_message(XWindow *win) {\n\
|
||||
win.label->text = "Sample text 0123456789"\n\
|
||||
}
|
||||
|
||||
xfontsel.sampleText16: \
|
||||
static void print_sample_message(XWindow *win) {\n\
|
||||
win.label->text = "Sample text 0123456789"\n\
|
||||
}
|
||||
|
||||
xfontsel.sampleTextUCS: \
|
||||
static void print_sample_message(XWindow *win) {\n\
|
||||
win.label->text = "Sample text 0123456789"\n\
|
||||
}
|
14
.beetsconfig
Normal file
14
.beetsconfig
Normal file
|
@ -0,0 +1,14 @@
|
|||
|
||||
[beets]
|
||||
library: ~/.local/share/beets/library.blb
|
||||
directory: /mnt/music/lib/
|
||||
plugins: mpdupdate embedart
|
||||
|
||||
[paths]
|
||||
default: $albumartist/$year - $album/$track - $title
|
||||
singleton: Non-Album/$artist - $title
|
||||
comp: Compilations/$year - $album/$track - $artist - $title
|
||||
|
||||
[mpdupdate]
|
||||
host: localhost
|
||||
port: 6600
|
5
.config/Makefile
Normal file
5
.config/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
DESTDIR:=$(DESTDIR)/.config
|
||||
modules=awesome clfswm cower dunst fehlstart fish herbstluftwm \
|
||||
newsbeuter zathura
|
||||
|
||||
include ../dotfiles.mk
|
5
.config/awesome/Makefile
Normal file
5
.config/awesome/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
DESTDIR:=$(DESTDIR)/awesome
|
||||
modules=themes
|
||||
objects=bowl.lua ext.lua infoline.lua keychain.lua oni.lua rc.lua
|
||||
|
||||
include ../../dotfiles.mk
|
205
.config/awesome/bowl.lua
Normal file
205
.config/awesome/bowl.lua
Normal file
|
@ -0,0 +1,205 @@
|
|||
-- -*- coding: utf-8 -*-
|
||||
--------------------------------------------------------------------------------
|
||||
-- @author Nicolas Berthier <nberthier@gmail.com>
|
||||
-- @copyright 2010 Nicolas Berthier
|
||||
--------------------------------------------------------------------------------
|
||||
--
|
||||
-- Bowls are kind of helpers that can be drawn (at the bottom --- for now) of an
|
||||
-- area, and displaying the current key prefix. It is inspired by emacs'
|
||||
-- behavior, that prints prefix keys in the minibuffer after a certain time.
|
||||
--
|
||||
-- I call it `bowl' as a reference to the bowl that one might have at home,
|
||||
-- where one puts its actual keys... A more serious name would be `hint' or
|
||||
-- `tooltip' (but they do not fit well for this usage).
|
||||
--
|
||||
-- Example usage: see `rc.lua' file.
|
||||
--
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--{{{ Grab environment (mostly aliases)
|
||||
local setmetatable = setmetatable
|
||||
local ipairs = ipairs
|
||||
local type = type
|
||||
local pairs = pairs
|
||||
local string = string
|
||||
local print = print
|
||||
local error = error
|
||||
|
||||
local capi = capi
|
||||
local client = client
|
||||
local awesome = awesome
|
||||
local root = root
|
||||
local timer = timer
|
||||
|
||||
local infoline = require ("infoline")
|
||||
--}}}
|
||||
|
||||
module ("bowl")
|
||||
|
||||
-- Privata data: we use weak keys in order to allow collection of private data
|
||||
-- if keys (clients) are collected (i.e., no longer used, after having been
|
||||
-- killed for instance)
|
||||
local data = setmetatable ({}, { __mode = 'k' })
|
||||
|
||||
--{{{ Default values
|
||||
|
||||
--- Default modifier filter
|
||||
local modfilter = {
|
||||
["Mod1"] = "M",
|
||||
["Mod4"] = "S",
|
||||
["Control"] = "C",
|
||||
["Shift"] = string.upper,
|
||||
}
|
||||
|
||||
-- Timers configuration
|
||||
local use_timers = true
|
||||
local timeout = 2.0
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Keychain pretty-printing
|
||||
|
||||
function mod_to_string (mods, k)
|
||||
local ret, k = "", k
|
||||
for _, mod in ipairs (mods) do
|
||||
if modfilter[mod] then
|
||||
local t = type (modfilter[mod])
|
||||
if t == "function" then
|
||||
k = modfilter[mod](k)
|
||||
elseif t == "string" then
|
||||
ret = ret .. modfilter[mod] .. "-"
|
||||
else
|
||||
error ("Invalid modifier key filter: got a " .. t)
|
||||
end
|
||||
else
|
||||
ret = ret .. mod .. "-"
|
||||
end
|
||||
end
|
||||
return ret, k
|
||||
end
|
||||
|
||||
function ks_to_string (m, k)
|
||||
local m, k = mod_to_string (m, k)
|
||||
return m .. k
|
||||
end
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Timer management
|
||||
|
||||
local function delete_timer_maybe (d)
|
||||
if d.timer then -- stop and remove the timer
|
||||
d.timer:remove_signal ("timeout", d.timer_function)
|
||||
d.timer:stop ()
|
||||
d.timer = nil
|
||||
d.timer_expired = true
|
||||
end
|
||||
end
|
||||
|
||||
local function delayed_call_maybe (d, f)
|
||||
if use_timers then
|
||||
if not d.timer_expired and not d.timer then
|
||||
-- create and start the timer
|
||||
d.timer = timer ({ timeout = timeout })
|
||||
d.timer_function = function () f (); delete_timer_maybe (d) end
|
||||
d.timer:add_signal ("timeout", d.timer_function)
|
||||
d.timer:start ()
|
||||
d.timer_expired = false
|
||||
elseif not d.timer_expired then
|
||||
-- restart the timer...
|
||||
|
||||
-- XXX: What is the actual semantics of the call to `start' (ie,
|
||||
-- does it restart the timer with the initial timeout)?
|
||||
d.timer:stop ()
|
||||
d.timer.timeout = timeout -- reset timeout
|
||||
d.timer:start ()
|
||||
end
|
||||
else -- timers disabled
|
||||
f () -- call the given function directly
|
||||
end
|
||||
end
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Infoline management
|
||||
|
||||
function dispose (w)
|
||||
local d = data[w]
|
||||
if d.bowl then -- if bowl was enabled... (should always be true...)
|
||||
infoline.dispose (d.bowl)
|
||||
d.bowl = nil
|
||||
end
|
||||
delete_timer_maybe (d)
|
||||
data[w] = nil
|
||||
end
|
||||
|
||||
function append (w, m, k)
|
||||
local d = data[w]
|
||||
local pretty_ks = ks_to_string (m, k) .. " "
|
||||
infoline.set_text (d.bowl, infoline.get_text (d.bowl) .. pretty_ks)
|
||||
|
||||
local function enable_bowl ()
|
||||
-- XXX: is there a possible bad interleaving that could make
|
||||
-- this function execute while the bowl has already been
|
||||
-- disposed of? in which case the condition should be checked
|
||||
-- first...
|
||||
|
||||
-- if d.bowl then
|
||||
infoline.attach (d.bowl, w)
|
||||
-- end
|
||||
end
|
||||
|
||||
delayed_call_maybe (d, enable_bowl)
|
||||
end
|
||||
|
||||
function create (w)
|
||||
-- XXX: Note the prefix text could be customizable...
|
||||
data[w] = { bowl = infoline.new (" ") }
|
||||
end
|
||||
|
||||
--}}}
|
||||
|
||||
|
||||
--- Initializes the bowl module, with given properties; should be called before
|
||||
--- ANY other function of this module.
|
||||
-- Configurations fields include:
|
||||
--
|
||||
-- `use_timers', `timeout': A boolean defining whether bowls drawing should be
|
||||
-- delayed, along with a number being this time shift, in seconds (Default
|
||||
-- values are `true' and `2').
|
||||
--
|
||||
-- `modfilter': A table associating modifiers (Mod1, Mod4, Control, Shift, etc.)
|
||||
-- with either a string (in this case it will replace the modifier when printed
|
||||
-- in heplers) or functions (in this case the key string will be repaced by a
|
||||
-- call to this function with the key string as parameter). Default value is:
|
||||
-- { ["Mod1"] = "M", ["Mod4"] = "S", ["Control"] = "C", ["Shift"] =
|
||||
-- string.upper }
|
||||
--
|
||||
-- @param c The table of properties.
|
||||
function init (c)
|
||||
local c = c or { }
|
||||
modfilter = c.modfilter and c.modfilter or modfilter
|
||||
if c.use_timers ~= nil then use_timers = c.use_timers end
|
||||
if use_timers then
|
||||
timeout = c.timeout ~= nil and c.timeout or timeout
|
||||
end
|
||||
end
|
||||
|
||||
--- Setup signal listeners, that trigger appropriate functions for a default
|
||||
--- behavior.
|
||||
function default_setup ()
|
||||
local function to_root (f) return function (...) f (root, ...) end end
|
||||
client.add_signal ("keychain::enter", create)
|
||||
client.add_signal ("keychain::append", append)
|
||||
client.add_signal ("keychain::leave", dispose)
|
||||
awesome.add_signal ("keychain::enter", to_root (create))
|
||||
awesome.add_signal ("keychain::append", to_root (append))
|
||||
awesome.add_signal ("keychain::leave", to_root (dispose))
|
||||
end
|
||||
|
||||
-- Local variables:
|
||||
-- indent-tabs-mode: nil
|
||||
-- fill-column: 80
|
||||
-- lua-indent-level: 4
|
||||
-- End:
|
||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
81
.config/awesome/ext.lua
Normal file
81
.config/awesome/ext.lua
Normal file
|
@ -0,0 +1,81 @@
|
|||
local client=client
|
||||
local awful=awful
|
||||
local pairs=pairs
|
||||
local table=table
|
||||
|
||||
module("ext")
|
||||
|
||||
-- Returns true if all pairs in table1 are present in table2
|
||||
function match(table1, table2)
|
||||
for k, v in pairs(table1) do
|
||||
if table[k] ~= v and not table2[k]:find(v) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
--- Spawns cmd if no client can be found matching properties
|
||||
-- If such a client can be found, pop to first tag where it is
|
||||
-- visible, and give it focus
|
||||
function run_or_raise(cmd, properties)
|
||||
local clients = client.get()
|
||||
local focused = awful.client.next(0)
|
||||
local findex = 0
|
||||
local matched_clients = { }
|
||||
local n = 0
|
||||
|
||||
for i, c in pairs(clients) do
|
||||
-- make an array of matched clients
|
||||
if match(properties, c) then
|
||||
n = n + 1
|
||||
matched_clients[n] = c
|
||||
|
||||
if n == focused then
|
||||
findex = n
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if n > 0 then
|
||||
local c = matched_clients[1]
|
||||
|
||||
-- if the focused window matched switch focus to next in list
|
||||
if 0 < findex and findex < n then
|
||||
c = matched_clients[findex + 1]
|
||||
end
|
||||
|
||||
local ctags = c:tags()
|
||||
|
||||
if table.getn(ctags) == 0 then
|
||||
-- ctags is empty, show client on current tag
|
||||
local curtag = awful.tag.selected()
|
||||
awful.client.movetotag(curtag, c)
|
||||
else
|
||||
-- Otherwise, pop to first tag client is visible on
|
||||
awful.tag.viewonly(ctags[1])
|
||||
end
|
||||
|
||||
-- And then focus the client
|
||||
client.focus = c
|
||||
c:raise()
|
||||
awful.screen.focus(c.screen)
|
||||
return
|
||||
end
|
||||
awful.util.spawn(cmd)
|
||||
end
|
||||
|
||||
function prev_client()
|
||||
awful.client.focus.history.previous()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end
|
||||
|
||||
function next_client()
|
||||
awful.client.focus.byidx(1)
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end
|
183
.config/awesome/infoline.lua
Normal file
183
.config/awesome/infoline.lua
Normal file
|
@ -0,0 +1,183 @@
|
|||
-- -*- coding: utf-8 -*-
|
||||
--------------------------------------------------------------------------------
|
||||
-- @author Nicolas Berthier <nberthier@gmail.com>
|
||||
-- @copyright 2010 Nicolas Berthier
|
||||
--------------------------------------------------------------------------------
|
||||
--
|
||||
-- This is a module for defining infolines in awesome. An infoline is a wibox
|
||||
-- attached to a region (typically, a client or the root window).
|
||||
--
|
||||
-- Remarks:
|
||||
--
|
||||
-- - It has not been tested with multiple screens yet.
|
||||
--
|
||||
-- Example usage: (TODO --- read the comments for now, there are not many
|
||||
-- functions)
|
||||
--
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--{{{ Grab environment (mostly aliases)
|
||||
local setmetatable = setmetatable
|
||||
local ipairs = ipairs
|
||||
local type = type
|
||||
local pairs = pairs
|
||||
local string = string
|
||||
local print = print
|
||||
local error = error
|
||||
local io = io
|
||||
|
||||
local client = client
|
||||
local awesome = awesome
|
||||
local wibox = wibox
|
||||
local widget = widget
|
||||
local root = root
|
||||
local screen = screen
|
||||
local mouse = mouse
|
||||
--}}}
|
||||
|
||||
module ("infoline")
|
||||
|
||||
-- Privata data: we use weak keys in order to allow collection of private data
|
||||
-- if keys (clients) are collected (i.e., no longer used, after having been
|
||||
-- killed for instance).
|
||||
--
|
||||
-- XXX: For now, we have at most one infoline per client, but it could be
|
||||
-- interesting to create several types of infolines (identified by indexes to be
|
||||
-- allocated by this module), and associated to, e.g., different configuration
|
||||
-- flags and positioning routine...
|
||||
local data = setmetatable ({}, { __mode = 'k' })
|
||||
|
||||
--{{{ Infoline positioning
|
||||
|
||||
-- XXX: this is a hack that positions an infoline at the bottom of a given area.
|
||||
local function setup_position (wb, geom)
|
||||
local b = wb:geometry ()
|
||||
b.x = geom.x
|
||||
b.width = geom.width
|
||||
b.y = geom.y + geom.height - awesome.font_height
|
||||
b.height = awesome.font_height
|
||||
wb:geometry (b)
|
||||
end
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Configurations:
|
||||
|
||||
-- When true, this flag indicates that an infoline is hidden if its attached
|
||||
-- client loses its focus. Otherwise, it remains always visible.
|
||||
follow_focus = true
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Infoline updates
|
||||
|
||||
function get_text (il) return il.wb.widgets[1].text end
|
||||
function set_text (il, text) il.wb.widgets[1].text = text end
|
||||
|
||||
-- Forces a refresh of the given infoline.
|
||||
function update (il)
|
||||
local wb = il.wb
|
||||
local c = il.cli
|
||||
|
||||
if il.enabled then
|
||||
-- XXX: Note this could be much better if we had some sort of root and
|
||||
-- client interface unification: the following involves a priori useless
|
||||
-- code duplication...
|
||||
if c == root then
|
||||
wb.screen = mouse.screen -- XXX: is this the behavior we need?
|
||||
wb.visible = true
|
||||
setup_position (wb, screen[mouse.screen].workarea)
|
||||
else
|
||||
if c:isvisible () and (not follow_focus or client.focus == c) then
|
||||
wb.screen = c.screen
|
||||
wb.visible = true
|
||||
setup_position (wb, c:geometry ())
|
||||
else -- do we have to hide it?
|
||||
wb.visible = false
|
||||
end
|
||||
end
|
||||
elseif wb.visible then --otherwise we need to hide it.
|
||||
wb.visible = false
|
||||
end
|
||||
end
|
||||
|
||||
local function update_from_client (c)
|
||||
-- Note that we may not have an infoline for this client, hence the
|
||||
-- conditional...
|
||||
if data[c] then update (data[c]) end
|
||||
end
|
||||
|
||||
-- Force execution of the above function on client state modification.
|
||||
client.add_signal ("focus", update_from_client)
|
||||
client.add_signal ("unfocus", update_from_client)
|
||||
client.add_signal ("unmanage", update_from_client)
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Infoline management
|
||||
|
||||
--- Creates a new infoline, with the given initial text. Note it is not visible
|
||||
--- by default, and not attached to any client.
|
||||
function new (text)
|
||||
local il = {
|
||||
wb = wibox ({
|
||||
ontop = true, -- XXX: setting a depth when attaching to
|
||||
--a client would be much better
|
||||
widgets = {
|
||||
widget ({ type = "textbox", align="left" })
|
||||
},
|
||||
})
|
||||
}
|
||||
-- these will remain false until the infoline is attached to a client.
|
||||
il.wb.visible = false
|
||||
il.enabled = false
|
||||
set_text (il, text or "")
|
||||
return il
|
||||
end
|
||||
|
||||
-- Attached infolines will react to the following client-related signals, and
|
||||
-- automatically setup their position according to the client's geometry.
|
||||
local csignals = { "property::geometry", "property::minimized",
|
||||
"property::visible", "property::focus", "property::screen", }
|
||||
|
||||
-- Attaches an infoline to a client. Note the infoline becomes visible at that
|
||||
-- time, if the client is currently visible (and if it has focus, when
|
||||
-- `follow_focus' holds).
|
||||
function attach (il, c)
|
||||
data[c] = il
|
||||
il.cli = c
|
||||
il.enabled = true
|
||||
update (il)
|
||||
if c ~= root then
|
||||
-- subscribe to client-related signals
|
||||
for _, s in ipairs (csignals) do
|
||||
c:add_signal (s, update_from_client)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Detach the given infoline from its client, if any.
|
||||
function dispose (il)
|
||||
local c = il.cli
|
||||
if c then -- note c can be nil here, if the given infoline has not been
|
||||
--attached to any client...
|
||||
il.enabled = false
|
||||
update (il) -- a shortcut here would be: `il.wb.visible = false'
|
||||
data[c] = nil
|
||||
if c ~= root then
|
||||
-- unsubscribe from client-related signals
|
||||
for _, s in ipairs (csignals) do
|
||||
c:remove_signal (s, update_from_client)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--}}}
|
||||
|
||||
-- Local variables:
|
||||
-- indent-tabs-mode: nil
|
||||
-- fill-column: 80
|
||||
-- lua-indent-level: 4
|
||||
-- End:
|
||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
334
.config/awesome/keychain.lua
Normal file
334
.config/awesome/keychain.lua
Normal file
|
@ -0,0 +1,334 @@
|
|||
-- -*- coding: utf-8 -*-
|
||||
--------------------------------------------------------------------------------
|
||||
-- @author Nicolas Berthier <nberthier@gmail.com>
|
||||
-- @copyright 2010 Nicolas Berthier
|
||||
--------------------------------------------------------------------------------
|
||||
--
|
||||
-- This is a module for defining keychains à la emacs in awesome. I was also
|
||||
-- inspired by ion3 behavior when designing it.
|
||||
--
|
||||
-- Remarks:
|
||||
--
|
||||
-- - This module does not handle `release' key bindings, but is it useful for
|
||||
-- keychains?
|
||||
--
|
||||
-- - It has not been tested with multiple screens yet.
|
||||
--
|
||||
-- - There might (... must) be incompatibilities with the shifty module. Also,
|
||||
-- defining global and per-client keychains with the same prefix is not
|
||||
-- allowed (or leads to unspecified behaviors... --- in practice: the
|
||||
-- per-client ones are ignored). However, I do think separation of per-client
|
||||
-- and global keys is a bad idea if client keys do not have a higher priority
|
||||
-- than the global ones...
|
||||
--
|
||||
-- Example usage: see `rc.lua' file.
|
||||
--
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--{{{ Grab environment (mostly aliases)
|
||||
local setmetatable = setmetatable
|
||||
local ipairs = ipairs
|
||||
local type = type
|
||||
local pairs = pairs
|
||||
local string = string
|
||||
local print = print
|
||||
local error = error
|
||||
local io = io
|
||||
|
||||
local capi = capi
|
||||
local client = client
|
||||
local awesome = awesome
|
||||
local root = root
|
||||
|
||||
local akey = require ("awful.key")
|
||||
local join = awful.util.table.join
|
||||
local clone = awful.util.table.clone
|
||||
--}}}
|
||||
|
||||
module ("keychain")
|
||||
|
||||
-- Privata data: we use weak keys in order to allow collection of private data
|
||||
-- if keys (clients) are collected (i.e., no longer used, after having been
|
||||
-- killed for instance)
|
||||
local data = setmetatable ({}, { __mode = 'k' })
|
||||
|
||||
--{{{ Functional Tuples
|
||||
-- see http://lua-users.org/wiki/FunctionalTuples for details
|
||||
|
||||
--- Creates a keystroke representation to fill the `escape' table configuration
|
||||
--- property.
|
||||
-- @param m Modifiers table.
|
||||
-- @param k The key itself.
|
||||
-- @return A keystroke representation (only for the escape sequence, for now?).
|
||||
function keystroke (m, k)
|
||||
if type (m) ~= "table" then
|
||||
error ("Keystroke modifiers must be given a table (got a "..
|
||||
type (m)..")")
|
||||
end
|
||||
if type (k) ~= "string" then
|
||||
error ("Keystroke key must be given a string (got a "..
|
||||
type (m)..")")
|
||||
end
|
||||
return function (fn) return fn (m, k) end
|
||||
end
|
||||
|
||||
-- keystroke accessors
|
||||
local function ks_mod (_m, _k) return _m end
|
||||
local function ks_key (_m, _k) return _k end
|
||||
|
||||
-- ---
|
||||
|
||||
--- Creates a final keychain binding to fill the keychain binding tables,
|
||||
--- meaning that the given function will be executed at the end of the keychain.
|
||||
-- @param m Modifiers table.
|
||||
-- @param k The key.
|
||||
-- @param cont The function to be bound to the given keys.
|
||||
-- @return A "final" key binding.
|
||||
function key (m, k, cont)
|
||||
if type (cont) ~= "function" then
|
||||
error ("Final binding must be given a function (got a "..
|
||||
type (cont)..")")
|
||||
end
|
||||
return function (fn) return fn (keystroke (m, k), cont, true) end
|
||||
end
|
||||
|
||||
--- Creates an intermediate (prefix) keychain binding.
|
||||
-- @param m Modifiers table.
|
||||
-- @param k The key.
|
||||
-- @param sub The subchain description table to be bound to the given keys.
|
||||
-- @return An "intermediate" key binding.
|
||||
function subchain (m, k, sub)
|
||||
if type (sub) ~= "table" then
|
||||
error ("Subchain binding must be given a table (got a "..
|
||||
type (sub)..")")
|
||||
end
|
||||
return function (fn) return fn (keystroke (m, k), sub, false) end
|
||||
end
|
||||
|
||||
-- key/subchain binding accessors
|
||||
local function binding_ks (ks, cont, leaf) return ks end
|
||||
local function binding_cont (ks, cont, leaf) return cont end
|
||||
local function binding_leaf (ks, cont, leaf) return leaf end
|
||||
|
||||
--- Creates an intermediate keychain if sub is a table, or a final key binding
|
||||
--- otherwise (and then sub must be a function).
|
||||
-- @param m Modifiers table.
|
||||
-- @param k The key.
|
||||
-- @param sub Either the subchain description table, or the function, to be
|
||||
-- bound to the given keys.
|
||||
function sub (m, k, sub)
|
||||
if type (sub) == "table" then
|
||||
return subchain (m, k, sub)
|
||||
else
|
||||
return key (m, k, sub)
|
||||
end
|
||||
end
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Default values
|
||||
|
||||
--- Default escape sequences (S-g is inspired by emacs...)
|
||||
local escape_keystrokes = {
|
||||
keystroke ( { }, "Escape" ),
|
||||
keystroke ( { "Mod4" }, "g" ),
|
||||
}
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Key table management facilities
|
||||
|
||||
local function set_keys (c, k)
|
||||
if c == root then root.keys (k) else c:keys (k) end
|
||||
end
|
||||
|
||||
local function keys_of (c)
|
||||
if c == root then return root.keys () else return c:keys () end
|
||||
end
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Signal emission helper
|
||||
|
||||
local function notif (sig, w, ...)
|
||||
if w ~= root then
|
||||
client.emit_signal (sig, w, ...)
|
||||
else -- we use global signals otherwise
|
||||
awesome.emit_signal (sig, ...)
|
||||
end
|
||||
end
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Client/Root-related state management
|
||||
|
||||
local function init_client_state_maybe (w)
|
||||
if data[w] == nil then
|
||||
local d = { }
|
||||
d.keys = keys_of (w) -- save client keys
|
||||
data[w] = d -- register client
|
||||
notif ("keychain::enter", w)
|
||||
end
|
||||
end
|
||||
|
||||
local function restore_client_state (c)
|
||||
local w = c or root
|
||||
local d = data[w]
|
||||
-- XXX: Turns out that `d' can be nil already here, in case the keyboard has
|
||||
-- been grabbed since the previous call to this funtion... (that also seems
|
||||
-- to be called again upon release…)
|
||||
if d then
|
||||
set_keys (w, d.keys) -- restore client keys
|
||||
data[w] = nil -- unregister client
|
||||
end
|
||||
end
|
||||
|
||||
local function leave (c)
|
||||
local w = c or root
|
||||
|
||||
-- Destroy notifier structures if needed
|
||||
if data[w] then -- XXX: necessary test?
|
||||
notif ("keychain::leave", w)
|
||||
end
|
||||
end
|
||||
|
||||
-- force disposal of resources when clients are killed
|
||||
client.add_signal ("unmanage", leave)
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Key binding tree access helpers
|
||||
|
||||
local function make_on_entering (m, k, subchain) return
|
||||
function (c)
|
||||
local w = c or root
|
||||
|
||||
-- Register and initialize client state, if not already in a keychain
|
||||
init_client_state_maybe (w)
|
||||
|
||||
-- Update notifier text, and trigger its drawing if necessary
|
||||
notif ("keychain::append", w, m, k)
|
||||
|
||||
-- Setup subchain
|
||||
set_keys (w, subchain)
|
||||
end
|
||||
end
|
||||
|
||||
local function on_leaving (c)
|
||||
-- Trigger disposal routine
|
||||
leave (c)
|
||||
|
||||
-- Restore initial key mapping of client
|
||||
restore_client_state (c)
|
||||
end
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Configuration
|
||||
|
||||
-- Flag to detect late initialization error
|
||||
local already_used = false
|
||||
|
||||
-- Escape binding table built once upon initialization
|
||||
local escape_bindings = { }
|
||||
|
||||
--- Fills the escape bindings table with actual `awful.key' elements triggering
|
||||
--- execution of `on_leaving'.
|
||||
local function init_escape_bindings ()
|
||||
escape_bindings = { }
|
||||
for _, e in ipairs (escape_keystrokes) do
|
||||
escape_bindings = join (escape_bindings,
|
||||
akey (e (ks_mod), e (ks_key), on_leaving))
|
||||
end
|
||||
end
|
||||
|
||||
-- Call it once upon module loading to initialize escape_bindings (in case
|
||||
-- `init' is not called).
|
||||
init_escape_bindings ()
|
||||
|
||||
|
||||
--- Initializes the keychain module, with given properties; to be called before
|
||||
--- ANY other function of this module.
|
||||
-- Configurations fields include:
|
||||
--
|
||||
-- `escapes': A table of keystrokes (@see keychain.keystroke) escaping keychains
|
||||
-- (defaults are `Mod4-g' and `Escape').
|
||||
--
|
||||
-- @param c The table of properties.
|
||||
function init (c)
|
||||
local c = c or { }
|
||||
|
||||
if already_used then
|
||||
-- heum... just signal the error: "print" or "error"?
|
||||
return print ("E: keychain: Call to `init' AFTER having bound keys!")
|
||||
end
|
||||
|
||||
escape_keystrokes = c.escapes and c.escapes or escape_keystrokes
|
||||
|
||||
-- Now, fill the escape bindings table again with actual `awful.key'
|
||||
-- elements triggering `on_leaving' executions, in case escape keys has
|
||||
-- changed.
|
||||
init_escape_bindings ()
|
||||
end
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ Keychain creation
|
||||
|
||||
--- Creates a new keychain binding.
|
||||
-- @param m Modifiers table.
|
||||
-- @param k The key.
|
||||
-- @param chains A table of keychains, describing either final bindings (see
|
||||
-- key constructor) or subchains (see subchain constructor). If arg is not a
|
||||
-- table, then `awful.key' is called directly with the arguments.
|
||||
-- @return A key binding for the `awful.key' module.
|
||||
-- @see awful.key
|
||||
function new (m, k, chains)
|
||||
|
||||
-- If the argument is a function, then we need to return an actual awful.key
|
||||
-- directly.
|
||||
if type (chains) ~= "table" then
|
||||
return akey (m, k, chains)
|
||||
end
|
||||
|
||||
-- This table will contain the keys to be mapped upon <m, k> keystroke. It
|
||||
-- initially contains the escape bindings, so that one can still rebind them
|
||||
-- differently in `chains'.
|
||||
local subchain = clone (escape_bindings)
|
||||
|
||||
already_used = true -- subsequent init avoidance flag...
|
||||
|
||||
-- For each entry of the given chains, add a corresponding `awful.key'
|
||||
-- element in the subchain
|
||||
for _, e in ipairs (chains) do
|
||||
local ks = e (binding_ks)
|
||||
if e (binding_leaf) then
|
||||
-- We encountered a leaf in the chains.
|
||||
local function on_leaf (c) on_leaving (c); e (binding_cont) (c) end
|
||||
subchain = join (subchain, akey (ks (ks_mod), ks (ks_key), on_leaf))
|
||||
else
|
||||
-- Recursively call subchain creation. "Funny" detail: I think there
|
||||
-- is no way of creating ill-structured keychain descriptors that
|
||||
-- would produce infinite recursive calls here, since we control
|
||||
-- their creation with functional tuples, that cannot lead to cyclic
|
||||
-- structures...
|
||||
local subch = new (ks (ks_mod), ks (ks_key), e (binding_cont))
|
||||
subchain = join (subchain, subch)
|
||||
end
|
||||
end
|
||||
|
||||
-- Then return an actual `awful.key', triggering the `on_entering' routine
|
||||
return akey (m, k, make_on_entering (m, k, subchain))
|
||||
end
|
||||
--}}}
|
||||
|
||||
-- Setup `__call' entry in module's metatable so that we can create new prefix
|
||||
-- binding using `keychain (m, k, ...)' directly.
|
||||
setmetatable (_M, { __call = function (_, ...) return new (...) end })
|
||||
|
||||
-- Local variables:
|
||||
-- indent-tabs-mode: nil
|
||||
-- fill-column: 80
|
||||
-- lua-indent-level: 4
|
||||
-- End:
|
||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
73
.config/awesome/oni.lua
Normal file
73
.config/awesome/oni.lua
Normal file
|
@ -0,0 +1,73 @@
|
|||
local awful = awful
|
||||
local beautiful = beautiful
|
||||
local client = client
|
||||
local ext = require("ext")
|
||||
local lfs = require("lfs")
|
||||
local pairs = pairs
|
||||
local string = string
|
||||
local table = table
|
||||
local widget = widget
|
||||
|
||||
module("oni")
|
||||
|
||||
local maildirfmt = "/home/slash/documents/mail/%s/inbox/new/"
|
||||
|
||||
function mailcount(account)
|
||||
local i = 0
|
||||
local dir = string.format(maildirfmt, account)
|
||||
|
||||
for file in lfs.dir(dir) do
|
||||
if file ~= "." and file ~= ".." then
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
|
||||
return i
|
||||
end
|
||||
|
||||
local function showmail(name)
|
||||
awful.util.spawn("emacsclient -e '(oni:view-mail \"" .. name .. "\")'")
|
||||
end
|
||||
|
||||
function mailcount_widgets(label, account, name)
|
||||
widgets = {}
|
||||
widgets.label = widget({ type = "textbox" })
|
||||
widgets.label.text = string.format(" %s: ", label)
|
||||
widgets.count = widget({ type = "textbox" })
|
||||
widgets.count.text = string.format(" %d ", mailcount(account))
|
||||
widgets.count.bg = beautiful.bg_focus
|
||||
widgets.count:buttons(
|
||||
awful.util.table.join(
|
||||
awful.button({ }, 1, function (c) showmail(name) end)))
|
||||
|
||||
return widgets
|
||||
end
|
||||
|
||||
function focus_raise(direction)
|
||||
awful.client.focus.bydirection(direction)
|
||||
if client.focus then client.focus:raise() end
|
||||
end
|
||||
|
||||
function ror_browser()
|
||||
ext.run_or_raise("conkeror", { class = "Conkeror" })
|
||||
end
|
||||
|
||||
function ror_editor()
|
||||
ext.run_or_raise("emacsclient -c -a emacs", { class = "Emacs" })
|
||||
end
|
||||
|
||||
function ror_term()
|
||||
ext.run_or_raise("urxvt", { class = "URxvt" })
|
||||
end
|
||||
|
||||
function run_browser()
|
||||
awful.util.spawn("conkeror")
|
||||
end
|
||||
|
||||
function run_editor()
|
||||
awful.util.spawn("emacsclient -c -a emacs")
|
||||
end
|
||||
|
||||
function run_term()
|
||||
awful.util.spawn("urxvt")
|
||||
end
|
414
.config/awesome/rc.lua
Normal file
414
.config/awesome/rc.lua
Normal file
|
@ -0,0 +1,414 @@
|
|||
require("awful")
|
||||
require("awful.autofocus")
|
||||
require("awful.rules")
|
||||
require("beautiful")
|
||||
require("bowl")
|
||||
require("keychain")
|
||||
require("naughty")
|
||||
require("ext")
|
||||
require("oni")
|
||||
|
||||
--- 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
|
||||
do
|
||||
local in_error = false
|
||||
awesome.add_signal("debug::error", function (err)
|
||||
-- Make sure we don't go into an endless error loop
|
||||
if in_error then return end
|
||||
in_error = true
|
||||
|
||||
naughty.notify({ preset = naughty.config.presets.critical,
|
||||
title = "Oops, an error happened!",
|
||||
text = err })
|
||||
in_error = false
|
||||
end)
|
||||
end
|
||||
|
||||
-- {{{ Variable definitions
|
||||
-- Themes define colours, icons, and wallpapers
|
||||
beautiful.init("/home/slash/.config/awesome/themes/custom/theme.lua")
|
||||
|
||||
bowl.init({ use_timers = true, timeout = 1 })
|
||||
bowl.default_setup()
|
||||
|
||||
keychain.init({ escapes = {
|
||||
keychain.keystroke ({ }, "Escape"),
|
||||
keychain.keystroke ({ "Control", }, "g")
|
||||
} })
|
||||
|
||||
-- This is used later as the default terminal and editor to run.
|
||||
terminal = "urxvt"
|
||||
editor = os.getenv("EDITOR") or "nano"
|
||||
editor_cmd = terminal .. " -e " .. editor
|
||||
|
||||
-- Default modkey.
|
||||
-- Usually, Mod4 is the key with a logo between Control and Alt.
|
||||
-- If you do not like this or do not have such a key,
|
||||
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
|
||||
-- However, you can use another modifier like Mod1, but it may interact with others.
|
||||
modkey = "Mod4"
|
||||
|
||||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||
layouts =
|
||||
{
|
||||
awful.layout.suit.tile,
|
||||
awful.layout.suit.tile.left,
|
||||
awful.layout.suit.tile.bottom,
|
||||
awful.layout.suit.tile.top,
|
||||
awful.layout.suit.fair,
|
||||
awful.layout.suit.fair.horizontal,
|
||||
awful.layout.suit.max,
|
||||
awful.layout.suit.max.fullscreen,
|
||||
awful.layout.suit.magnifier,
|
||||
awful.layout.suit.floating
|
||||
}
|
||||
-- }}}
|
||||
|
||||
-- {{{ Tags
|
||||
-- Define a tag table which hold all screen tags.
|
||||
tags = {}
|
||||
for s = 1, screen.count() do
|
||||
-- Each screen has its own tag table.
|
||||
tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1])
|
||||
end
|
||||
-- }}}
|
||||
|
||||
-- {{{ Menu
|
||||
-- Create a laucher widget and a main menu
|
||||
myawesomemenu = {
|
||||
{ "manual", terminal .. " -e man awesome" },
|
||||
{ "edit config", editor_cmd .. " " .. awesome.conffile },
|
||||
{ "restart", awesome.restart },
|
||||
{ "quit", awesome.quit }
|
||||
}
|
||||
|
||||
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
|
||||
{ "open terminal", terminal }
|
||||
}
|
||||
})
|
||||
|
||||
mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
|
||||
menu = mymainmenu })
|
||||
-- }}}
|
||||
|
||||
-- {{{ Wibox
|
||||
-- Create a textclock widget
|
||||
mytextclock = awful.widget.textclock({ align = "right" })
|
||||
|
||||
-- Create a systray
|
||||
mysystray = widget({ type = "systray" })
|
||||
|
||||
-- Create a mailbox widget
|
||||
myryumailbox = oni.mailcount_widgets("ryu", "ryuslash.org", "ryuslash")
|
||||
myaethonmailbox = oni.mailcount_widgets("aet", "aethon", "aethon")
|
||||
mygmailmailbox = oni.mailcount_widgets("gmail", "gmail", "gmail")
|
||||
my9fmailbox = oni.mailcount_widgets("9f", "ninthfloor", "ninthfloor")
|
||||
|
||||
mymailboxtimer = timer({ timeout = 60 })
|
||||
mymailboxtimer:add_signal(
|
||||
"timeout",
|
||||
function ()
|
||||
myryumailbox.count.text = string.format(" %d ", oni.mailcount("ryuslash.org"))
|
||||
myaethonmailbox.count.text = string.format(" %d ", oni.mailcount("aethon"))
|
||||
mygmailmailbox.count.text = string.format(" %d ", oni.mailcount("gmail"))
|
||||
my9fmailbox.count.text = string.format(" %d ", oni.mailcount("ninthfloor"))
|
||||
end)
|
||||
mymailboxtimer:start()
|
||||
|
||||
-- Create a wibox for each screen and add it
|
||||
mywibox = {}
|
||||
mypromptbox = {}
|
||||
mylayoutbox = {}
|
||||
mytaglist = {}
|
||||
mytaglist.buttons = awful.util.table.join(
|
||||
awful.button({ }, 1, awful.tag.viewonly),
|
||||
awful.button({ modkey }, 1, awful.client.movetotag),
|
||||
awful.button({ }, 3, awful.tag.viewtoggle),
|
||||
awful.button({ modkey }, 3, awful.client.toggletag),
|
||||
awful.button({ }, 4, awful.tag.viewnext),
|
||||
awful.button({ }, 5, awful.tag.viewprev)
|
||||
)
|
||||
mytasklist = {}
|
||||
mytasklist.buttons = awful.util.table.join(
|
||||
awful.button({ }, 1, function (c)
|
||||
if c == client.focus then
|
||||
c.minimized = true
|
||||
else
|
||||
if not c:isvisible() then
|
||||
awful.tag.viewonly(c:tags()[1])
|
||||
end
|
||||
-- This will also un-minimize
|
||||
-- the client, if needed
|
||||
client.focus = c
|
||||
c:raise()
|
||||
end
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
if instance then
|
||||
instance:hide()
|
||||
instance = nil
|
||||
else
|
||||
instance = awful.menu.clients({ width=250 })
|
||||
end
|
||||
end),
|
||||
awful.button({ }, 4, function ()
|
||||
awful.client.focus.byidx(1)
|
||||
if client.focus then client.focus:raise() end
|
||||
end),
|
||||
awful.button({ }, 5, function ()
|
||||
awful.client.focus.byidx(-1)
|
||||
if client.focus then client.focus:raise() end
|
||||
end))
|
||||
|
||||
for s = 1, screen.count() do
|
||||
-- Create a promptbox for each screen
|
||||
mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
|
||||
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
|
||||
-- We need one layoutbox per screen.
|
||||
mylayoutbox[s] = awful.widget.layoutbox(s)
|
||||
mylayoutbox[s]:buttons(awful.util.table.join(
|
||||
awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
|
||||
awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
|
||||
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
|
||||
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
|
||||
-- Create a taglist widget
|
||||
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons)
|
||||
|
||||
-- Create a tasklist widget
|
||||
mytasklist[s] = awful.widget.tasklist(function(c)
|
||||
return awful.widget.tasklist.label.currenttags(c, s)
|
||||
end, mytasklist.buttons)
|
||||
|
||||
-- Create the wibox
|
||||
mywibox[s] = awful.wibox({ position = "top", screen = s })
|
||||
-- Add widgets to the wibox - order matters
|
||||
mywibox[s].widgets = {
|
||||
{
|
||||
mylauncher,
|
||||
mytaglist[s],
|
||||
mypromptbox[s],
|
||||
layout = awful.widget.layout.horizontal.leftright
|
||||
},
|
||||
mylayoutbox[s],
|
||||
mytextclock,
|
||||
s == 1 and mysystray or nil,
|
||||
s == 1 and my9fmailbox.count or nil,
|
||||
s == 1 and my9fmailbox.label or nil,
|
||||
s == 1 and mygmailmailbox.count or nil,
|
||||
s == 1 and mygmailmailbox.label or nil,
|
||||
s == 1 and myaethonmailbox.count or nil,
|
||||
s == 1 and myaethonmailbox.label or nil,
|
||||
s == 1 and myryumailbox.count or nil,
|
||||
s == 1 and myryumailbox.label or nil,
|
||||
mytasklist[s],
|
||||
layout = awful.widget.layout.horizontal.rightleft
|
||||
}
|
||||
end
|
||||
-- }}}
|
||||
|
||||
-- {{{ Mouse bindings
|
||||
root.buttons(awful.util.table.join(
|
||||
awful.button({ }, 3, function () mymainmenu:toggle() end),
|
||||
awful.button({ }, 4, awful.tag.viewnext),
|
||||
awful.button({ }, 5, awful.tag.viewprev)
|
||||
))
|
||||
-- }}}
|
||||
|
||||
-- {{{ Key bindings
|
||||
local bind = keychain
|
||||
local sub = keychain.sub
|
||||
globalkeys = awful.util.table.join(
|
||||
bind({ "Control", }, "i",
|
||||
{ sub({ }, "space", ext.next_client),
|
||||
sub({ }, ",",
|
||||
function () awful.screen.focus_relative(1) end),
|
||||
sub({ }, ".",
|
||||
function () awful.screen.focus_relative(-1) end),
|
||||
sub({ "Shift", }, "1",
|
||||
function () mypromptbox[mouse.screen]:run() end),
|
||||
sub({ }, "f", function () oni.focus_raise("right") end),
|
||||
sub({ }, "b", function () oni.focus_raise("left") end),
|
||||
sub({ }, "n", function () oni.focus_raise("down") end),
|
||||
sub({ }, "p", function () oni.focus_raise("up") end),
|
||||
sub({ }, "c", oni.ror_term),
|
||||
sub({ "Shift", }, "c", oni.run_term),
|
||||
sub({ }, "e", oni.ror_editor),
|
||||
sub({ "Shift", }, "e", oni.run_editor),
|
||||
sub({ }, "w", oni.ror_browser),
|
||||
sub({ "Shift", }, "w", oni.run_browser),
|
||||
sub({ "Control", }, "i", ext.prev_client) }),
|
||||
awful.key({ "Control", "Mod1" }, "l",
|
||||
function () awful.util.spawn("i3lock -c 000000") end),
|
||||
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
|
||||
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
|
||||
awful.key({ modkey, }, "Escape", awful.tag.history.restore),
|
||||
|
||||
-- awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) end),
|
||||
|
||||
-- Layout manipulation
|
||||
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
|
||||
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
|
||||
awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
|
||||
|
||||
-- Standard program
|
||||
awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
|
||||
awful.key({ modkey, "Control" }, "r", awesome.restart),
|
||||
awful.key({ modkey, "Shift" }, "q", awesome.quit),
|
||||
|
||||
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
|
||||
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
|
||||
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
|
||||
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
|
||||
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
|
||||
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
|
||||
awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
|
||||
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),
|
||||
|
||||
awful.key({ modkey, "Control" }, "n", awful.client.restore),
|
||||
|
||||
-- Prompt
|
||||
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
|
||||
|
||||
awful.key({ modkey }, "x",
|
||||
function ()
|
||||
awful.prompt.run({ prompt = "Run Lua code: " },
|
||||
mypromptbox[mouse.screen].widget,
|
||||
awful.util.eval, nil,
|
||||
awful.util.getdir("cache") .. "/history_eval")
|
||||
end)
|
||||
)
|
||||
|
||||
clientkeys = awful.util.table.join(
|
||||
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
|
||||
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
|
||||
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
|
||||
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
|
||||
awful.key({ modkey, }, "o", awful.client.movetoscreen ),
|
||||
awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end),
|
||||
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
|
||||
awful.key({ modkey, }, "n",
|
||||
function (c)
|
||||
-- The client currently has the input focus, so it cannot be
|
||||
-- minimized, since minimized clients can't have the focus.
|
||||
c.minimized = true
|
||||
end),
|
||||
awful.key({ modkey, }, "m",
|
||||
function (c)
|
||||
c.maximized_horizontal = not c.maximized_horizontal
|
||||
c.maximized_vertical = not c.maximized_vertical
|
||||
end)
|
||||
)
|
||||
|
||||
-- Compute the maximum number of digit we need, limited to 9
|
||||
keynumber = 0
|
||||
for s = 1, screen.count() do
|
||||
keynumber = math.min(9, math.max(#tags[s], keynumber));
|
||||
end
|
||||
|
||||
-- Bind all key numbers to tags.
|
||||
-- Be careful: we use keycodes to make it works on any keyboard layout.
|
||||
-- This should map on the top row of your keyboard, usually 1 to 9.
|
||||
for i = 1, keynumber do
|
||||
globalkeys = awful.util.table.join(globalkeys,
|
||||
awful.key({ modkey }, "#" .. i + 9,
|
||||
function ()
|
||||
local screen = mouse.screen
|
||||
if tags[screen][i] then
|
||||
awful.tag.viewonly(tags[screen][i])
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, "Control" }, "#" .. i + 9,
|
||||
function ()
|
||||
local screen = mouse.screen
|
||||
if tags[screen][i] then
|
||||
awful.tag.viewtoggle(tags[screen][i])
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, "Shift" }, "#" .. i + 9,
|
||||
function ()
|
||||
if client.focus and tags[client.focus.screen][i] then
|
||||
awful.client.movetotag(tags[client.focus.screen][i])
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
|
||||
function ()
|
||||
if client.focus and tags[client.focus.screen][i] then
|
||||
awful.client.toggletag(tags[client.focus.screen][i])
|
||||
end
|
||||
end))
|
||||
end
|
||||
|
||||
clientbuttons = awful.util.table.join(
|
||||
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
|
||||
awful.button({ modkey }, 1, awful.mouse.client.move),
|
||||
awful.button({ modkey }, 3, awful.mouse.client.resize))
|
||||
|
||||
-- Set keys
|
||||
root.keys(globalkeys)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Rules
|
||||
awful.rules.rules = {
|
||||
-- All clients will match this rule.
|
||||
{ rule = { },
|
||||
properties = { border_width = beautiful.border_width,
|
||||
border_color = beautiful.border_normal,
|
||||
focus = true,
|
||||
keys = clientkeys,
|
||||
buttons = clientbuttons } },
|
||||
{ rule = { class = "MPlayer" },
|
||||
properties = { floating = true } },
|
||||
{ rule = { class = "pinentry" },
|
||||
properties = { floating = true } },
|
||||
{ rule = { class = "gimp" },
|
||||
properties = { floating = true } },
|
||||
{ rule = { class = "Emacs" },
|
||||
properties = { tag = tags[1][1] } },
|
||||
-- Set Firefox to always map on tags number 2 of screen 1.
|
||||
{ rule = { class = "Firefox" },
|
||||
properties = { tag = tags[2][1] } },
|
||||
{ rule = { class = "Conkeror" },
|
||||
properties = { tag = tags[2][1] } },
|
||||
{ rule = { class = "URxvt" },
|
||||
properties = { tag = tags[2][1] } },
|
||||
}
|
||||
-- }}}
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
client.add_signal("manage", function (c, startup)
|
||||
-- Add a titlebar
|
||||
-- awful.titlebar.add(c, { modkey = modkey })
|
||||
|
||||
-- Enable sloppy focus
|
||||
c:add_signal("mouse::enter", function(c)
|
||||
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
|
||||
and awful.client.focus.filter(c) then
|
||||
client.focus = c
|
||||
end
|
||||
end)
|
||||
|
||||
if not startup then
|
||||
-- Set the windows at the slave,
|
||||
-- i.e. put it at the end of others instead of setting it master.
|
||||
-- awful.client.setslave(c)
|
||||
|
||||
-- Put windows in a smart way, only if they does not set an initial position.
|
||||
if not c.size_hints.user_position and not c.size_hints.program_position then
|
||||
awful.placement.no_overlap(c)
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||
client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- }}}
|
4
.config/awesome/themes/Makefile
Normal file
4
.config/awesome/themes/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/themes
|
||||
modules=custom
|
||||
|
||||
include ../../../dotfiles.mk
|
4
.config/awesome/themes/custom/Makefile
Normal file
4
.config/awesome/themes/custom/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/custom
|
||||
objects=theme.lua
|
||||
|
||||
include ../../../../dotfiles.mk
|
96
.config/awesome/themes/custom/theme.lua
Normal file
96
.config/awesome/themes/custom/theme.lua
Normal file
|
@ -0,0 +1,96 @@
|
|||
---------------------------
|
||||
-- Default awesome theme --
|
||||
---------------------------
|
||||
|
||||
theme = {}
|
||||
|
||||
theme.font = "osaka_unicode 10"
|
||||
|
||||
theme.bg_normal = "#222222"
|
||||
theme.bg_focus = "#535d6c"
|
||||
theme.bg_urgent = "#ff0000"
|
||||
theme.bg_minimize = "#444444"
|
||||
|
||||
theme.fg_normal = "#aaaaaa"
|
||||
theme.fg_focus = "#ffffff"
|
||||
theme.fg_urgent = "#ffffff"
|
||||
theme.fg_minimize = "#ffffff"
|
||||
|
||||
theme.border_width = "1"
|
||||
theme.border_normal = "#000000"
|
||||
theme.border_focus = "#535d6c"
|
||||
theme.border_marked = "#91231c"
|
||||
|
||||
-- There are other variable sets
|
||||
-- overriding the default one when
|
||||
-- defined, the sets are:
|
||||
-- [taglist|tasklist]_[bg|fg]_[focus|urgent]
|
||||
-- titlebar_[bg|fg]_[normal|focus]
|
||||
-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color]
|
||||
-- mouse_finder_[color|timeout|animate_timeout|radius|factor]
|
||||
-- Example:
|
||||
--theme.taglist_bg_focus = "#ff0000"
|
||||
|
||||
-- Display the taglist squares
|
||||
theme.taglist_squares_sel = "/home/slash/.config/awesome/themes/custom/taglist/squarefw.png"
|
||||
theme.taglist_squares_unsel = "/home/slash/.config/awesome/themes/custom/taglist/squarew.png"
|
||||
|
||||
theme.tasklist_floating_icon = "/home/slash/.config/awesome/themes/custom/tasklist/floatingw.png"
|
||||
|
||||
-- Variables set for theming the menu:
|
||||
-- menu_[bg|fg]_[normal|focus]
|
||||
-- menu_[border_color|border_width]
|
||||
theme.menu_submenu_icon = "/home/slash/.config/awesome/themes/custom/submenu.png"
|
||||
theme.menu_height = "15"
|
||||
theme.menu_width = "100"
|
||||
|
||||
-- You can add as many variables as
|
||||
-- you wish and access them by using
|
||||
-- beautiful.variable in your rc.lua
|
||||
--theme.bg_widget = "#cc0000"
|
||||
|
||||
-- Define the image to load
|
||||
theme.titlebar_close_button_normal = "/home/slash/.config/awesome/themes/custom/titlebar/close_normal.png"
|
||||
theme.titlebar_close_button_focus = "/home/slash/.config/awesome/themes/custom/titlebar/close_focus.png"
|
||||
|
||||
theme.titlebar_ontop_button_normal_inactive = "/home/slash/.config/awesome/themes/custom/titlebar/ontop_normal_inactive.png"
|
||||
theme.titlebar_ontop_button_focus_inactive = "/home/slash/.config/awesome/themes/custom/titlebar/ontop_focus_inactive.png"
|
||||
theme.titlebar_ontop_button_normal_active = "/home/slash/.config/awesome/themes/custom/titlebar/ontop_normal_active.png"
|
||||
theme.titlebar_ontop_button_focus_active = "/home/slash/.config/awesome/themes/custom/titlebar/ontop_focus_active.png"
|
||||
|
||||
theme.titlebar_sticky_button_normal_inactive = "/home/slash/.config/awesome/themes/custom/titlebar/sticky_normal_inactive.png"
|
||||
theme.titlebar_sticky_button_focus_inactive = "/home/slash/.config/awesome/themes/custom/titlebar/sticky_focus_inactive.png"
|
||||
theme.titlebar_sticky_button_normal_active = "/home/slash/.config/awesome/themes/custom/titlebar/sticky_normal_active.png"
|
||||
theme.titlebar_sticky_button_focus_active = "/home/slash/.config/awesome/themes/custom/titlebar/sticky_focus_active.png"
|
||||
|
||||
theme.titlebar_floating_button_normal_inactive = "/home/slash/.config/awesome/themes/custom/titlebar/floating_normal_inactive.png"
|
||||
theme.titlebar_floating_button_focus_inactive = "/home/slash/.config/awesome/themes/custom/titlebar/floating_focus_inactive.png"
|
||||
theme.titlebar_floating_button_normal_active = "/home/slash/.config/awesome/themes/custom/titlebar/floating_normal_active.png"
|
||||
theme.titlebar_floating_button_focus_active = "/home/slash/.config/awesome/themes/custom/titlebar/floating_focus_active.png"
|
||||
|
||||
theme.titlebar_maximized_button_normal_inactive = "/home/slash/.config/awesome/themes/custom/titlebar/maximized_normal_inactive.png"
|
||||
theme.titlebar_maximized_button_focus_inactive = "/home/slash/.config/awesome/themes/custom/titlebar/maximized_focus_inactive.png"
|
||||
theme.titlebar_maximized_button_normal_active = "/home/slash/.config/awesome/themes/custom/titlebar/maximized_normal_active.png"
|
||||
theme.titlebar_maximized_button_focus_active = "/home/slash/.config/awesome/themes/custom/titlebar/maximized_focus_active.png"
|
||||
|
||||
-- You can use your own command to set your wallpaper
|
||||
theme.wallpaper_cmd = { "awsetbg -u feh -c /usr/share/archlinux/wallpaper/archlinux-simplyblack.png" }
|
||||
|
||||
-- You can use your own layout icons like this:
|
||||
theme.layout_fairh = "/home/slash/.config/awesome/themes/custom/layouts/fairhw.png"
|
||||
theme.layout_fairv = "/home/slash/.config/awesome/themes/custom/layouts/fairvw.png"
|
||||
theme.layout_floating = "/home/slash/.config/awesome/themes/custom/layouts/floatingw.png"
|
||||
theme.layout_magnifier = "/home/slash/.config/awesome/themes/custom/layouts/magnifierw.png"
|
||||
theme.layout_max = "/home/slash/.config/awesome/themes/custom/layouts/maxw.png"
|
||||
theme.layout_fullscreen = "/home/slash/.config/awesome/themes/custom/layouts/fullscreenw.png"
|
||||
theme.layout_tilebottom = "/home/slash/.config/awesome/themes/custom/layouts/tilebottomw.png"
|
||||
theme.layout_tileleft = "/home/slash/.config/awesome/themes/custom/layouts/tileleftw.png"
|
||||
theme.layout_tile = "/home/slash/.config/awesome/themes/custom/layouts/tilew.png"
|
||||
theme.layout_tiletop = "/home/slash/.config/awesome/themes/custom/layouts/tiletopw.png"
|
||||
theme.layout_spiral = "/home/slash/.config/awesome/themes/custom/layouts/spiralw.png"
|
||||
theme.layout_dwindle = "/home/slash/.config/awesome/themes/custom/layouts/dwindlew.png"
|
||||
|
||||
theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png"
|
||||
|
||||
return theme
|
||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
4
.config/clfswm/Makefile
Normal file
4
.config/clfswm/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/clfswm
|
||||
objects=clfswmrc
|
||||
|
||||
include ../../dotfiles.mk
|
4
.config/cower/Makefile
Normal file
4
.config/cower/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/cower
|
||||
objects=config
|
||||
|
||||
include ../../dotfiles.mk
|
|
@ -1,3 +1,3 @@
|
|||
Color = always
|
||||
TargetDir = ~/var/aur/
|
||||
TargetDir = /home/slash/var/aur/
|
||||
IgnoreRepo = pegas
|
4
.config/dunst/Makefile
Normal file
4
.config/dunst/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/dunst
|
||||
objects=dunstrc
|
||||
|
||||
include ../../dotfiles.mk
|
|
@ -1,16 +1,6 @@
|
|||
# -*- mode: conf-unix; -*-
|
||||
[global]
|
||||
font = Fantasque Sans Mono 13
|
||||
|
||||
# allow a small subset of html markup:
|
||||
# <b>bold</b>
|
||||
# <i>italic</i>
|
||||
# <s>strikethrough<s/>
|
||||
# <u>underline</u>
|
||||
#
|
||||
# for a complete reference see http://developer.gnome.org/pango/stable/PangoMarkupFormat.html
|
||||
# If markup is not allowed, those tags will be stripped out of the message.
|
||||
allow_markup = yes
|
||||
font = Monaco-12
|
||||
|
||||
# The format of the message. Possible variables are:
|
||||
# %a appname
|
||||
|
@ -44,9 +34,6 @@
|
|||
# split long notifications into multiple lines
|
||||
word_wrap = yes
|
||||
|
||||
# ignore newlines '\n' in notifications
|
||||
ignore_newline = no
|
||||
|
||||
|
||||
# the geometry of the window
|
||||
# geometry [{width}]x{height}][+/-{x}+/-{y}]
|
||||
|
@ -57,14 +44,11 @@
|
|||
# the window expands to the longest message displayed.
|
||||
# A positive x is measured from the left, a negative from the
|
||||
# right side of the screen. Y is measured from the top and down respectevly.
|
||||
geometry = "600x5-30+20"
|
||||
|
||||
# Shrink window if it's smaller than the width. Will be ignored if width is 0.
|
||||
shrink = yes
|
||||
geometry = "0x3-30+20"
|
||||
|
||||
# The transparency of the window. range: [0; 100]
|
||||
# This option will only work if a compositing windowmanager is present (e.g. xcompmgr, compiz, etc..)
|
||||
transparency = 20
|
||||
transparency = 0
|
||||
|
||||
# Don't remove messages, if the user is idle (no mouse or keyboard input)
|
||||
# for longer than idle_threshold seconds.
|
||||
|
@ -99,37 +83,11 @@
|
|||
# Set to 0 to disable
|
||||
separator_height = 2;
|
||||
|
||||
# padding between text and separator
|
||||
padding = 15
|
||||
|
||||
# horizontal padding
|
||||
horizontal_padding = 15
|
||||
|
||||
# Define a color for the separator.
|
||||
# This can either be "auto" or "foreground". "Auto" tries to find a color
|
||||
# that fits nicely to the background color.
|
||||
separator_color = auto
|
||||
|
||||
# print a notification on startup
|
||||
# This is mainly for error detection, since dbus (re-)starts dunst
|
||||
# automatically after a crash.
|
||||
startup_notification = false
|
||||
|
||||
# dmenu path
|
||||
dmenu = /usr/bin/dmenu -p dunst:
|
||||
|
||||
# browser for opening urls in context menu
|
||||
browser = /usr/bin/firefox -new-tab
|
||||
|
||||
# Align icons left
|
||||
icon_position = left
|
||||
|
||||
# Paths to default icons.
|
||||
icon_folders = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/:/usr/share/icons/hicolor/16x16/apps/
|
||||
|
||||
[frame]
|
||||
width = 2
|
||||
color = "#3d3d3d"
|
||||
|
||||
[shortcuts]
|
||||
# shortcuts are specified as [modifier+][modifier+]...key
|
||||
|
@ -138,17 +96,14 @@
|
|||
# xev might be helpful to find names for keys
|
||||
|
||||
# close notification
|
||||
close = mod4+m
|
||||
close = ctrl+space
|
||||
|
||||
# close all notifications
|
||||
close_all = mod4+shift+m
|
||||
close_all = ctrl+shift+space
|
||||
|
||||
# redisplay last message(s)
|
||||
# On the US keyboard layout 'grave' is normally above TAB and left of '1'.
|
||||
history = mod4+ctrl+m
|
||||
|
||||
# context menu
|
||||
context = mod4+mod1+m
|
||||
history = ctrl+grave
|
||||
|
||||
[urgency_low]
|
||||
# IMPORTANT: colors have to be defined in quotation marks.
|
||||
|
@ -204,24 +159,3 @@
|
|||
# summary = *twitter.com*
|
||||
# urgency = normal
|
||||
#
|
||||
|
||||
[Emacs]
|
||||
appname = Emacs
|
||||
background = "#7F5AB6"
|
||||
foreground = "#FAFAFA"
|
||||
format = "<b>%s</b>\n%b"
|
||||
|
||||
[Metal Express Radio]
|
||||
appname = Metal Express Radio
|
||||
background = "#EF4136"
|
||||
foreground = "#FFFFFF"
|
||||
|
||||
[Syncthing]
|
||||
appname = Syncthing GTK
|
||||
background = "#337ab7"
|
||||
foreground = "#ffffff"
|
||||
|
||||
[Lollypop]
|
||||
appname = Lollypop
|
||||
background = "#fd3e75"
|
||||
foreground = "#ffffff"
|
4
.config/fehlstart/Makefile
Normal file
4
.config/fehlstart/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/fehlstart
|
||||
objects=fehlstart.rc
|
||||
|
||||
include ../../dotfiles.mk
|
4
.config/fish/Makefile
Normal file
4
.config/fish/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/fish
|
||||
objects=config.fish
|
||||
|
||||
include ../../dotfiles.mk
|
4
.config/herbstluftwm/Makefile
Normal file
4
.config/herbstluftwm/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/herbstluftwm
|
||||
objects=autostart panel.sh
|
||||
|
||||
include ../../dotfiles.mk
|
77
.config/herbstluftwm/autostart
Executable file
77
.config/herbstluftwm/autostart
Executable file
|
@ -0,0 +1,77 @@
|
|||
#!/bin/zsh
|
||||
|
||||
function hc () {
|
||||
herbstclient $@
|
||||
}
|
||||
|
||||
modkey="Mod4"
|
||||
|
||||
hc keybind $modkey+Ctrl+b resize left +0.05
|
||||
hc keybind $modkey+Ctrl+f resize right +0.05
|
||||
hc keybind $modkey+Ctrl+n resize down +0.05
|
||||
hc keybind $modkey+Ctrl+p resize up +0.05
|
||||
hc keybind $modkey+Ctrl+q quit
|
||||
hc keybind $modkey+Ctrl+r reload
|
||||
hc keybind $modkey+Shift+1 spawn dmenu_run -p 'Run:' -b -nb '#111113' -nf '#eeeeec' -sb '#171719'
|
||||
hc keybind $modkey+Shift+b shift left
|
||||
hc keybind $modkey+Shift+f shift right
|
||||
hc keybind $modkey+Shift+n shift down
|
||||
hc keybind $modkey+Shift+p shift up
|
||||
hc keybind $modkey+Shift+s split horizontal 0.5
|
||||
hc keybind $modkey+b focus -i left
|
||||
hc keybind $modkey+c spawn urxvt
|
||||
hc keybind $modkey+comma cycle_monitor -1
|
||||
hc keybind $modkey+e spawn emacsclient -ca emacs
|
||||
hc keybind $modkey+f focus -i right
|
||||
hc keybind $modkey+k close
|
||||
hc keybind $modkey+n focus -i down
|
||||
hc keybind $modkey+o cycle_all
|
||||
hc keybind $modkey+p focus -i up
|
||||
hc keybind $modkey+period cycle_monitor 1
|
||||
hc keybind $modkey+q remove
|
||||
hc keybind $modkey+s split vertical 0.5
|
||||
hc keybind $modkey+space cycle_layout 1
|
||||
hc keybind $modkey+w spawn conkeror
|
||||
hc keybind Ctrl+Mod1+l spawn i3lock -c 000000
|
||||
hc keybind XF86AudioNext spawn mpc next
|
||||
hc keybind XF86AudioPlay spawn mpc toggle
|
||||
hc keybind XF86AudioPrev spawn mpc prev
|
||||
hc keybind XF86AudioStop spawn mpc stop
|
||||
|
||||
hc set default_frame_layout 2
|
||||
hc set focus_stealing_prevention 0
|
||||
hc set frame_bg_transparent 1
|
||||
hc set frame_border_width 0
|
||||
hc set raise_on_focus 1
|
||||
hc set window_border_active_color "#999999"
|
||||
hc set window_border_normal_color "#222224"
|
||||
hc set window_border_width 1
|
||||
|
||||
hc set_layout max
|
||||
|
||||
hc add default2
|
||||
hc remove_monitor 1
|
||||
hc move_monitor 0 1920x1080+0+0
|
||||
hc add_monitor 1680x1050+1920+0 default2
|
||||
|
||||
hc pad 0 20 -5 -5 -5
|
||||
hc pad 1 -5 -5 -5 -5
|
||||
|
||||
hc mousebind $modkey-Button1 move
|
||||
hc mousebind $modkey-Button2 resize
|
||||
hc mousebind $modkey-Button3 zoom
|
||||
|
||||
hc unrule -F
|
||||
hc rule focus=on
|
||||
hc rule windowtype=_NET_WM_WINDOW_TYPE_DIALOG focus=on pseudotile=on
|
||||
hc rule class=Xephyr pseudotile=on
|
||||
hc rule instance=Xine\ Window pseudotile=on
|
||||
hc rule class=Pinentry pseudotile=on
|
||||
hc rule class=Dispass pseudotile=on
|
||||
hc rule title="GIMP Startup" pseudotile=on
|
||||
|
||||
# xbindkeys
|
||||
|
||||
# ~/.config/herbstluftwm/panel.sh &
|
||||
|
||||
# hc load default "(split horizontal:0.550000:0 (split vertical:0.850000:0 (split horizontal:0.180000:1 (clients max:0) (clients max:0 0x140001a)) (clients max:0)) (clients max:0 0xc00077))"
|
4
.config/newsbeuter/Makefile
Normal file
4
.config/newsbeuter/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/newsbeuter
|
||||
objects=config urls
|
||||
|
||||
include ../../dotfiles.mk
|
4
.config/zathura/Makefile
Normal file
4
.config/zathura/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/zathura
|
||||
objects=zathurarc
|
||||
|
||||
include ../../dotfiles.mk
|
|
@ -3,5 +3,3 @@ map <C-n> scroll down
|
|||
map <C-p> scroll up
|
||||
map <C-f> scroll right
|
||||
map <C-b> scroll left
|
||||
|
||||
set guioptions cs
|
5
.conkerorrc/Makefile
Normal file
5
.conkerorrc/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
DESTDIR:=$(DESTDIR)/.conkerorrc
|
||||
modules=themes
|
||||
objects=gtk2rc init.js
|
||||
|
||||
include ../dotfiles.mk
|
240
.conkerorrc/init.js
Normal file
240
.conkerorrc/init.js
Normal file
|
@ -0,0 +1,240 @@
|
|||
require("content-policy.js");
|
||||
require("favicon");
|
||||
|
||||
load_paths.push("file:///home/slash/var/src/linkwave/conkeror/");
|
||||
theme_load_paths.push("/home/slash/.conkerorrc/themes/");
|
||||
|
||||
require("linkwave");
|
||||
|
||||
define_browser_object_class(
|
||||
"history-url", null,
|
||||
function (I, prompt) {
|
||||
check_buffer(I.buffer, content_buffer);
|
||||
var result = yield I.buffer.window.minibuffer.read_url(
|
||||
$prompt = prompt, $use_webjumps = false, $use_history = true,
|
||||
$use_bookmarks = false, $sort_order = 'date_descending'
|
||||
);
|
||||
yield co_return(result);
|
||||
}
|
||||
);
|
||||
|
||||
function ext_title_format(window) {
|
||||
return '(' + get_current_profile() +') '
|
||||
+ window.buffers.current.description;
|
||||
}
|
||||
|
||||
function oni_before_quit_func() {
|
||||
var w = get_recent_conkeror_window();
|
||||
var result = (w == null) ||
|
||||
"y" == (yield w.minibuffer.read_single_character_option(
|
||||
$prompt="Quit Conkeror? (y/n)",
|
||||
$options=["y", "n"]));
|
||||
yield co_return(result);
|
||||
}
|
||||
|
||||
function oni_block_flash(content_type, content_location) {
|
||||
var Y = content_policy_accept, N = content_policy_reject;
|
||||
var action = ({ "youtube.com": Y }
|
||||
[content_location.host] || N);
|
||||
|
||||
if (action == N)
|
||||
dumpln("blocked flash: " + content_location.spec);
|
||||
|
||||
return action;
|
||||
}
|
||||
|
||||
function oni_escape(str) {
|
||||
return str.replace(/(["$`])/g, '\\$1');
|
||||
}
|
||||
|
||||
function oni_org_store_link(I) {
|
||||
var cmd_str = 'emacsclient \"org-protocol://store-link://'
|
||||
+ encodeURIComponent(I.buffer.display_uri_string) + '/'
|
||||
+ encodeURIComponent(I.buffer.document.title) + '\"';
|
||||
|
||||
if (I.window != null) {
|
||||
window.minibuffer.message('Issuing ' + cmd_str);
|
||||
}
|
||||
|
||||
shell_command_blind(cmd_str);
|
||||
}
|
||||
interactive("org-store-link",
|
||||
"Stores [[url][title]] as org link and copies url to emacs "
|
||||
+ "kill ring",
|
||||
oni_org_store_link);
|
||||
|
||||
interactive("find-url-from-history",
|
||||
"Find a page from history in the current buffer",
|
||||
"find-url",
|
||||
$browser_object = browser_object_history_url);
|
||||
interactive("find-url-from-history-new-buffer",
|
||||
"Find a page from history in a new buffer",
|
||||
"find-url-new-buffer",
|
||||
$browser_object = browser_object_history_url);
|
||||
|
||||
define_webjump("emacswiki",
|
||||
"http://www.google.com/cse?cx=004774160799092323420%3A6-ff2s0o6yi&q=%s",
|
||||
$alternative="http://www.emacswiki.org");
|
||||
define_webjump("php",
|
||||
"http://www.php.net/manual-lookup.php?pattern=%s&scope=quickref",
|
||||
$alternative="http://www.php.net");
|
||||
define_webjump("python",
|
||||
"http://docs.python.org/search.html?q=%s&check_keywords=yes&area=default",
|
||||
$alternative="http://www.python.org");
|
||||
define_webjump("ddg",
|
||||
"https://duckduckgo.com/?q=%s",
|
||||
$alternative="https://duckduckgo.com");
|
||||
define_webjump("metal-archives",
|
||||
"http://www.metal-archives.com/search?searchString=%s&type=band_name",
|
||||
$alternative="http://www.metal-archives.com");
|
||||
define_webjump("djangodocs",
|
||||
"https://docs.djangoproject.com/search/?q=%s&release=5",
|
||||
$alternative="https://docs.djangoproject.com/");
|
||||
define_webjump("google",
|
||||
"https://duckduckgo.com?q=!google%%20%s");
|
||||
define_webjump("github",
|
||||
"https://github.com/search?q=%s&type=Everything&repo=&langOverride=&start_value=1",
|
||||
$alternative="https://github.com");
|
||||
define_webjump("mdn",
|
||||
"https://developer.mozilla.org/en-US/search?q=%s",
|
||||
$alternative="https://developer.mozilla.org/");
|
||||
define_webjump("monsterhunter",
|
||||
"http://monsterhunter.wikia.com/wiki/index.php?search=%s&fulltext=Search",
|
||||
$alternative="http://monsterhunter.wikia.com/");
|
||||
// Archlinux
|
||||
define_webjump("arch/wiki",
|
||||
"https://wiki.archlinux.org/index.php?search=%s",
|
||||
$alternative="https://wiki.archlinux.org");
|
||||
define_webjump("arch/aur",
|
||||
"https://aur.archlinux.org/packages.php?O=0&K=%s&do_Search=Go",
|
||||
$alternative="https://aur.archlinux.org");
|
||||
define_webjump("arch/packages",
|
||||
"https://www.archlinux.org/packages/?sort=&q=%s&limit=50",
|
||||
$alternative="https://packages.archlinux.org");
|
||||
|
||||
// content_policy_bytype_table.object = oni_block_flash;
|
||||
cwd = make_file("/home/slash/downloads/");
|
||||
hint_digits = "arstdhneio";
|
||||
read_buffer_show_icons = true;
|
||||
title_format_fn = ext_title_format;
|
||||
url_remoting_fn = load_url_in_new_buffer;
|
||||
|
||||
define_key(content_buffer_normal_keymap, "h",
|
||||
"find-url-from-history-new-buffer");
|
||||
define_key(content_buffer_normal_keymap, "H",
|
||||
"find-url-from-history");
|
||||
define_key(content_buffer_normal_keymap, "C-x C-b", "switch-to-buffer");
|
||||
define_key(default_base_keymap, "C-x f", "follow-new-buffer");
|
||||
|
||||
add_hook("before_quit_hook", oni_before_quit_func);
|
||||
add_hook("content_policy_hook", content_policy_bytype);
|
||||
add_hook("mode_line_hook", mode_line_adder(buffer_count_widget, true));
|
||||
add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget, true));
|
||||
add_hook("mode_line_hook", mode_line_adder(downloads_status_widget));
|
||||
|
||||
remove_hook("download_added_hook", open_download_buffer_automatically);
|
||||
|
||||
hints_minibuffer_annotation_mode(true);
|
||||
theme_load("naquadah");
|
||||
|
||||
external_content_handlers.set("application/pdf", "xpdf");
|
||||
|
||||
var gh_url = "http://github.com/";
|
||||
function read_url_github_ad_command_handler(input)
|
||||
{
|
||||
var m = /^gh\s+@(\S+)(?:\s+((?:un)?follow))?/.exec(input);
|
||||
if (m) {
|
||||
if (m[2])
|
||||
return gh_url + "users/follow?target=";
|
||||
return gh_url + m[1];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function read_url_github_my_command_handler(input)
|
||||
{
|
||||
var m = /^gh\s+my\s+(dashboard|issues|notifications|profile|pulls|stars)/.exec(input);
|
||||
|
||||
if (m) {
|
||||
switch (m[1]) {
|
||||
case "dashboard":
|
||||
case "notifications":
|
||||
case "stars":
|
||||
return gh_url + m[1];
|
||||
case "issues":
|
||||
case "pulls":
|
||||
return gh_url + "dashboard/" + m[1];
|
||||
case "profile":
|
||||
return gh_url + "settings/" + m[1];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function read_url_github_repo_command_handler(input)
|
||||
{
|
||||
var m = /^gh\s+(\S+\/\S+)(?:\s+(\#\d+|\@\S+|issues|pulls|wiki|graphs|network|admin)(?:\s+(\#\d+|new))?)?$/.exec(input);
|
||||
|
||||
if (m) {
|
||||
repo_url = gh_url + m[1] + "/";
|
||||
|
||||
switch (m[2]) {
|
||||
case "issues":
|
||||
issues_url = repo_url + m[2] + "/";
|
||||
|
||||
if (m[3]) {
|
||||
if (m[3][0] == '#')
|
||||
return issues_url + m[3].substring(1);
|
||||
else if (m[3] == "new")
|
||||
return issues_url + m[3];
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return issues_url;
|
||||
case "pulls":
|
||||
case "wiki":
|
||||
case "graphs":
|
||||
case "network":
|
||||
case "admin":
|
||||
return repo_url + m[2];
|
||||
default:
|
||||
// Still need watch and unwatch
|
||||
if (m[2]) {
|
||||
if (m[2][0] == '#')
|
||||
return repo_url + "issues/" + m[2].substring(1);
|
||||
else if (m[2][0] == '@')
|
||||
return repo_url + "tree/" + m[2].substring(1);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return repo_url;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function read_url_github_command_handler(input)
|
||||
{
|
||||
return read_url_github_ad_command_handler(input)
|
||||
|| read_url_github_my_command_handler(input)
|
||||
|| read_url_github_repo_command_handler(input);
|
||||
}
|
||||
|
||||
function read_url_local_port_handler(input)
|
||||
{
|
||||
var m = /^lh (\d{1,5})$/.exec(input);
|
||||
|
||||
if (m) {
|
||||
return "http://localhost:" + m[1];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
read_url_handler_list = [read_url_local_port_handler,
|
||||
read_url_github_command_handler];
|
4
.conkerorrc/themes/Makefile
Normal file
4
.conkerorrc/themes/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/themes
|
||||
modules=naquadah
|
||||
|
||||
include ../../dotfiles.mk
|
5
.conkerorrc/themes/naquadah/Makefile
Normal file
5
.conkerorrc/themes/naquadah/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
DESTDIR:=$(DESTDIR)/naquadah
|
||||
objects=conkeror--scrollbars.css hints--url-panel.css minibuffer.css \
|
||||
mode-line.css new-tabs.css tab-bar.css theme.json
|
||||
|
||||
include ../../../dotfiles.mk
|
17
.emacs.d/.gitignore
vendored
Normal file
17
.emacs.d/.gitignore
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
tramp
|
||||
elpa
|
||||
bookmarks
|
||||
abbrev_defs
|
||||
custom.el
|
||||
*.elc
|
||||
ac-comphist.dat
|
||||
auto-save-list/
|
||||
url/
|
||||
packages/
|
||||
newsticker/
|
||||
templates/
|
||||
rinit.*
|
||||
!rinit.org
|
||||
history
|
||||
init2.el
|
||||
*.html
|
11
.emacs.d/Makefile
Normal file
11
.emacs.d/Makefile
Normal file
|
@ -0,0 +1,11 @@
|
|||
DESTDIR:=$(DESTDIR)/.emacs.d
|
||||
objects=init.elc init.el gnus.elc gnus.el init2.elc init2.el
|
||||
modules=eshell site-lisp snippets
|
||||
|
||||
EMACS=emacs
|
||||
|
||||
include ../dotfiles.mk
|
||||
|
||||
init2.el: init.org
|
||||
$(EMACS) -Q -batch \
|
||||
-eval "(progn (require 'org) (require 'ob-tangle) (org-babel-tangle-file \"$^\"))"
|
5
.emacs.d/eshell/Makefile
Normal file
5
.emacs.d/eshell/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
DESTDIR:=$(DESTDIR)/eshell
|
||||
objects=alias
|
||||
modules=
|
||||
|
||||
include ../../dotfiles.mk
|
|
@ -1,11 +1,9 @@
|
|||
alias doco docker-compose $*
|
||||
alias hgit hgit --no-pager $*
|
||||
alias newsbeuter ansi-term newsbeuter newsbeuter
|
||||
alias d dired $1
|
||||
alias o find-file $1
|
||||
alias listen eshell-exec-visual mplayer http://usa7-vn.mixstream.net/listen/8248.pls
|
||||
alias ncmpcpp ansi-term ncmpcpp ncmpcpp
|
||||
alias sudo *sudo $*
|
||||
alias rm rm -v $*
|
||||
alias git git --no-pager $*
|
||||
alias scrot /usr/bin/scrot -e 'mv $f ~/pictures/screenshots' $*
|
||||
alias ll ls -l $*
|
57
.emacs.d/gnus.el
Normal file
57
.emacs.d/gnus.el
Normal file
|
@ -0,0 +1,57 @@
|
|||
(setq gnus-select-method '(nntp "news.gmane.org"))
|
||||
(setq gnus-secondary-select-methods
|
||||
'((nnmaildir "gmail"
|
||||
(directory "~/documents/mail/gmail/"))
|
||||
(nnmaildir "ninthfloor"
|
||||
(directory "~/documents/mail/ninthfloor/"))
|
||||
(nnmaildir "aethon"
|
||||
(directory "~/documents/mail/aethon/"))
|
||||
(nnmaildir "ryuslash"
|
||||
(directory "~/documents/mail/ryuslash.org/"))
|
||||
(nntp "news.gwene.org")))
|
||||
(setq gnus-auto-subscribed-groups nil)
|
||||
(setq gnus-extra-headers '(To))
|
||||
(setq gnus-save-newsrc-file nil)
|
||||
(setq gnus-read-newsrc-file nil)
|
||||
(setq gnus-novice-user t)
|
||||
(setq gnus-article-truncate-lines nil)
|
||||
;; (setq gnus-parameters
|
||||
;; '(("gmail"
|
||||
;; (display . all))
|
||||
;; ("aethon"
|
||||
;; (display . all)
|
||||
;; ("arch"
|
||||
;; (display . all)))))
|
||||
(setq gnus-permanently-visible-groups
|
||||
(eval-when-compile
|
||||
(regexp-opt '("gmail:inbox"
|
||||
"aethon:inbox"
|
||||
"ninthfloor:inbox"
|
||||
"ryuslash:inbox"))))
|
||||
(setq nntp-marks-is-evil t)
|
||||
(setq gnus-check-new-newsgroups nil)
|
||||
(setq gnus-posting-styles
|
||||
'((".*"
|
||||
(address "tom@ryuslash.org")
|
||||
(eval (setq message-sendmail-extra-arguments '("-a" "ryuslash")
|
||||
flyspell-default-dictionary "en")))
|
||||
("gmail:"
|
||||
(address "ryuslash@gmail.com")
|
||||
(eval (setq message-sendmail-extra-arguments '("-a" "gmail"))))
|
||||
("ninthfloor:"
|
||||
(address "ryuslash@ninthfloor.org")
|
||||
(eval (setq message-sendmail-extra-arguments '("-a" "ninthfloor"))))
|
||||
("arch:"
|
||||
(address "tom.willemsen@archlinux.us")
|
||||
(eval (setq message-sendmail-extra-arguments '("-a" "arch"))))
|
||||
("aethon:"
|
||||
(address "thomas@aethon.nl")
|
||||
(signature-file "~/documents/work/aethon/signature.txt")
|
||||
(eval (setq message-sendmail-extra-arguments '("-a" "aethon")
|
||||
flyspell-default-dictionary "nl")))))
|
||||
|
||||
;-----[ BBDB ]--------------------------------------------------------
|
||||
;; (require 'bbdb)
|
||||
;; (bbdb-initialize 'gnus 'message)
|
||||
;; (bbdb-insinuate-gnus)
|
||||
;; (setq bbdb-north-american-phone-numbers-p nil)
|
387
.emacs.d/init.el
Normal file
387
.emacs.d/init.el
Normal file
|
@ -0,0 +1,387 @@
|
|||
;;; init.el --- ryuslash's emacs init
|
||||
|
||||
;;; Commentary:
|
||||
;; Does so much and changes so often
|
||||
|
||||
|
||||
;;; Code:
|
||||
|
||||
(load (concat user-emacs-directory "init2"))
|
||||
|
||||
(eval-after-load "emms-source-file"
|
||||
'(progn
|
||||
(require 'emms-setup)
|
||||
(require 'emms-player-mpd)
|
||||
|
||||
(emms-standard)
|
||||
|
||||
(add-to-list 'emms-info-functions 'emms-info-mpd)
|
||||
(add-to-list 'emms-player-list 'emms-player-mpd)
|
||||
|
||||
(setq emms-player-mpd-server-name "localhost")
|
||||
(setq emms-player-mpd-server-port "6600")
|
||||
(setq emms-player-mpd-music-directory "/mnt/music/mp3")))
|
||||
|
||||
(eval-after-load "flymake"
|
||||
'(progn
|
||||
(require 'flymake-cursor)
|
||||
|
||||
(add-to-list ; Make sure pyflakes is loaded
|
||||
'flymake-allowed-file-name-masks ; for python files.
|
||||
'("\\.py\\'" ext:flymake-pyflakes-init))
|
||||
|
||||
(add-to-list ; Error line repexp for go
|
||||
'flymake-err-line-patterns ; compilation.
|
||||
'("^\\([a-zA-Z0-9_]+\\.go\\):\\([0-9]+\\):\\(.*\\)$"
|
||||
1 2 nil 3))
|
||||
|
||||
(add-to-list ; Go uses makefiles, makes
|
||||
'flymake-allowed-file-name-masks ; flymaking 'easy'.
|
||||
'("\\.go$" flymake-simple-make-init))))
|
||||
|
||||
(eval-after-load "ido"
|
||||
'(setq ido-ignore-buffers `(,@ido-ignore-buffers
|
||||
"^\\*.*\\*$" "^irc\\." "^\\#")))
|
||||
|
||||
(eval-after-load "jabber"
|
||||
'(remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo))
|
||||
|
||||
(eval-after-load "newst-treeview"
|
||||
'(require 'newsticker-init))
|
||||
|
||||
(eval-after-load "org"
|
||||
'(require 'org-init))
|
||||
|
||||
(eval-after-load "pretty-symbols-mode"
|
||||
'(diminish 'pretty-symbols-mode))
|
||||
|
||||
(eval-after-load "rainbow-mode"
|
||||
'(diminish 'rainbow-mode))
|
||||
|
||||
(eval-after-load "smex"
|
||||
'(progn
|
||||
(global-set-key (kbd "M-x") 'smex)
|
||||
(global-set-key (kbd "C-M-x") 'smex-major-mode-commands)))
|
||||
|
||||
(eval-after-load "yasnippet"
|
||||
'(diminish 'yas-minor-mode))
|
||||
|
||||
(put 'upcase-region 'disabled nil)
|
||||
(put 'downcase-region 'disabled nil)
|
||||
(put 'narrow-to-region 'disabled nil)
|
||||
(put 'scroll-left 'disabled nil)
|
||||
|
||||
(setq-default bidi-paragraph-direction 'left-to-right)
|
||||
(setq-default c-basic-offset 4)
|
||||
(setq-default fci-rule-column 73)
|
||||
(setq-default gac-automatically-push-p t)
|
||||
(setq-default indent-tabs-mode nil)
|
||||
(setq-default php-mode-warn-if-mumamo-off nil)
|
||||
(setq-default require-final-newline t)
|
||||
(setq-default tab-width 4)
|
||||
(setq-default truncate-lines t)
|
||||
|
||||
(setq appt-disp-window-function #'oni:appt-display-window-and-jabber)
|
||||
(setq appt-display-diary nil)
|
||||
(setq auto-mode-case-fold nil)
|
||||
(setq auto-save-file-name-transforms
|
||||
`((".*" ,temporary-file-directory t)))
|
||||
(setq avandu-article-render-function #'avandu-view-w3m)
|
||||
(setq backup-directory-alist
|
||||
`((".*" . ,temporary-file-directory)))
|
||||
(setq browse-url-browser-function 'browse-url-generic)
|
||||
(setq browse-url-generic-program (getenv "BROWSER"))
|
||||
(setq c-offsets-alist '((statement-block-intro . +)
|
||||
(knr-argdecl-intro . 5)
|
||||
(substatement-open . +)
|
||||
(substatement-label . 0)
|
||||
(label . 0)
|
||||
(statement-case-open . +)
|
||||
(statement-cont . +)
|
||||
(arglist-intro . +)
|
||||
(arglist-close . 0)
|
||||
(inline-open . 0)
|
||||
(brace-list-open . +)
|
||||
(topmost-intro-cont first c-lineup-topmost-intro-cont
|
||||
c-lineup-gnu-DEFUN-intro-cont)))
|
||||
(setq comment-auto-fill-only-comments t)
|
||||
(setq custom-file "~/.emacs.d/custom.el")
|
||||
(setq custom-theme-directory "~/.emacs.d/themes")
|
||||
(setq default-frame-alist
|
||||
`((border-width . 0)
|
||||
(internal-border-width . 0)
|
||||
(vertical-scroll-bars . nil)
|
||||
(menu-bar-lines . nil)
|
||||
(tool-bar-lines . nil)
|
||||
(font . "monaco-12")))
|
||||
(setq emms-source-file-default-directory "/mnt/music/")
|
||||
(setq erc-autojoin-channels-alist
|
||||
'(("freenode.net" "#ninthfloor" "#emacs" "#dispass")))
|
||||
(setq erc-hide-list '("JOIN" "PART" "QUIT"))
|
||||
(setq erc-insert-timestamp-function 'erc-insert-timestamp-left)
|
||||
(setq erc-nick "ryuslash")
|
||||
(setq erc-timestamp-format "[%H:%M] ")
|
||||
(setq erc-timestamp-only-if-changed-flag nil)
|
||||
(setq eshell-highlight-prompt nil)
|
||||
(setq eshell-prompt-function 'oni:eshell-prompt-function)
|
||||
(setq eshell-prompt-regexp "^[#$]> ")
|
||||
(setq fci-rule-color "darkred")
|
||||
(setq flymake-gui-warnings-enabled nil)
|
||||
(setq flymake-info-line-regexp
|
||||
(eval-when-compile
|
||||
(regexp-opt
|
||||
'("Invalid name"
|
||||
"String statement has no effect"
|
||||
"Missing docstring"
|
||||
"Empty docstring"
|
||||
"multiple imports on one line"
|
||||
"expected 2 blank lines, found 1"
|
||||
"expected 2 blank lines, found 0"
|
||||
"TODO:"
|
||||
"whitespace after '{'"
|
||||
"whitespace before '}'"
|
||||
"whitespace before ':'"
|
||||
"whitespace after '('"
|
||||
"whitespace before ')'"
|
||||
"whitespace after '['"
|
||||
"whitespace before ']'"
|
||||
"the backslash is redundant between brackets"
|
||||
"continuation line over-indented for visual indent"
|
||||
"continuation line under-indented for visual indent"
|
||||
"Too many statements"
|
||||
"comparison to None should be"
|
||||
"missing whitespace around operator"
|
||||
"missing whitespace after ','"
|
||||
"line too long"
|
||||
"at least two spaces before inline comment"
|
||||
"trailing whitespace"
|
||||
"imported but unused"
|
||||
"Unused import"
|
||||
"too many blank lines"))))
|
||||
(setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log"))
|
||||
(setq flymake-log-level 0)
|
||||
(setq flymake-warn-line-regexp
|
||||
(eval-when-compile
|
||||
(regexp-opt '("warning"
|
||||
"Warning"
|
||||
"redefinition of unused"
|
||||
"Redefining built-in"
|
||||
"Redefining name"
|
||||
"Unused argument"
|
||||
"Unused variable"
|
||||
"Dangerous default value {} as argument"
|
||||
"no newline at end of file"
|
||||
"Access to a protected member"))))
|
||||
(setq frame-title-format '(:eval (concat "emacs: " (buffer-name))))
|
||||
(setq geiser-repl-history-filename "~/.emacs.d/geiser-history")
|
||||
(setq gnus-init-file "~/.emacs.d/gnus")
|
||||
(setq gtags-auto-update t)
|
||||
(setq help-at-pt-display-when-idle t)
|
||||
(setq ido-auto-merge-delay-time 1000000)
|
||||
(setq ido-default-buffer-method 'selected-window)
|
||||
(setq ido-max-window-height 1)
|
||||
(setq ido-save-directory-list-file nil)
|
||||
(setq ido-ubiquitous-command-exceptions '(org-refile))
|
||||
(setq inferior-lisp-program "sbcl")
|
||||
(setq inhibit-default-init t)
|
||||
(setq inhibit-local-menu-bar-menus t)
|
||||
(setq inhibit-startup-message t)
|
||||
(setq initial-major-mode 'emacs-lisp-mode)
|
||||
(setq initial-scratch-message nil)
|
||||
(setq jabber-account-list '(("ryuslash@jabber.org")
|
||||
("tom@ryuslash.org"
|
||||
(:connection-type . ssl))))
|
||||
(setq jabber-chat-buffer-format "*jabber:%n*")
|
||||
(setq jabber-chat-buffer-show-avatar nil)
|
||||
(setq jabber-chat-fill-long-lines nil)
|
||||
(setq jabber-chat-foreign-prompt-format "%t <\n")
|
||||
(setq jabber-chat-local-prompt-format "%t >\n")
|
||||
(setq jabber-chatstates-confirm nil)
|
||||
(setq jabber-history-dir "~/.emacs.d/jabber")
|
||||
(setq jabber-roster-show-bindings nil)
|
||||
(setq jit-lock-defer-time 0.2)
|
||||
(setq magit-repo-dirs '("~/projects/" "~/var/src/"))
|
||||
(setq message-log-max 1000)
|
||||
(setq message-send-mail-function 'message-send-mail-with-sendmail)
|
||||
(setq message-sendmail-extra-arguments '("-a" "ryuslash"))
|
||||
(setq package-archives
|
||||
'(("melpa" . "http://melpa.milkbox.net/packages/")
|
||||
("ELPA" . "http://tromey.com/elpa/")
|
||||
("gnu" . "http://elpa.gnu.org/packages/")
|
||||
("marmalade" . "http://marmalade-repo.org/packages/")))
|
||||
(setq package-load-list '((htmlize "1.39")
|
||||
(lua-mode "20111107")
|
||||
all))
|
||||
(setq php-function-call-face 'font-lock-function-name-face)
|
||||
(setq php-mode-force-pear t)
|
||||
(setq pony-tpl-indent-moves t)
|
||||
(setq pp^L-^L-string-function 'oni:pretty-control-l-function)
|
||||
(setq pp^L-^L-string-pre nil)
|
||||
(setq rainbow-delimiters-max-face-count 12)
|
||||
(setq redisplay-dont-pause t)
|
||||
(setq send-mail-function 'smtpmail-send-it)
|
||||
(setq sendmail-program "/usr/bin/msmtp")
|
||||
(setq smex-key-advice-ignore-menu-bar t)
|
||||
(setq smex-save-file "~/.emacs.d/smex-items")
|
||||
(setq split-height-threshold 40)
|
||||
(setq time-stamp-active t)
|
||||
(setq time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u)")
|
||||
(setq type-break-good-rest-interval (* 60 10))
|
||||
(setq type-break-interval (* 60 50))
|
||||
(setq type-break-keystroke-threshold '(nil . nil))
|
||||
(setq uniquify-buffer-name-style 'post-forward)
|
||||
(setq use-dialog-box nil)
|
||||
(setq user-full-name "Tom Willemsen")
|
||||
(setq user-mail-address "tom@ryuslash.org")
|
||||
(setq w3m-fill-column 72)
|
||||
(setq window-combination-resize t)
|
||||
(setq yas-fallback-behavior nil)
|
||||
(setq yas-prompt-functions '(yas-ido-prompt))
|
||||
|
||||
(add-hook 'after-change-major-mode-hook 'set-current-mode-icon)
|
||||
(add-hook 'after-save-hook 'oni:after-save-func t)
|
||||
(add-hook 'before-save-hook 'oni:before-save-func)
|
||||
(add-hook 'c-mode-hook 'oni:c-mode-func)
|
||||
(add-hook 'css-mode-hook 'oni:css-mode-func)
|
||||
(add-hook 'diary-display-hook 'oni:diary-display-func)
|
||||
(add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-func)
|
||||
(add-hook 'erc-mode-hook 'oni:erc-mode-func)
|
||||
(add-hook 'eshell-mode-hook 'oni:eshell-mode-func)
|
||||
(add-hook 'flymake-mode-hook 'oni:flymake-mode-func)
|
||||
(add-hook 'go-mode-hook 'oni:go-mode-func)
|
||||
(add-hook 'gtags-mode-hook 'oni:gtags-mode-func)
|
||||
(add-hook 'html-mode-hook 'oni:html-mode-func)
|
||||
(add-hook 'jabber-alert-message-hooks 'oni:jabber-alert-message-func)
|
||||
(add-hook 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func)
|
||||
(add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func)
|
||||
(add-hook 'java-mode-hook 'oni:java-mode-func)
|
||||
(add-hook 'js-mode-hook 'oni:js-mode-func)
|
||||
(add-hook 'js2-mode-hook 'oni:js2-mode-func)
|
||||
(add-hook 'lua-mode-hook 'oni:lua-mode-func)
|
||||
(add-hook 'magit-log-edit-mode-hook 'oni:magit-log-edit-mode-func)
|
||||
(add-hook 'markdown-mode-hook 'oni:markdown-mode-func)
|
||||
(add-hook 'message-mode-hook 'oni:message-mode-func)
|
||||
(add-hook 'org-mode-hook 'oni:org-mode-func)
|
||||
(add-hook 'php-mode-hook 'oni:php-mode-func)
|
||||
(add-hook 'prog-mode-hook 'oni:prog-mode-func)
|
||||
(add-hook 'python-mode-hook 'oni:python-mode-func)
|
||||
(add-hook 'rst-mode-hook 'oni:rst-mode-func)
|
||||
(add-hook 'term-mode-hook 'oni:term-mode-func)
|
||||
(add-hook 'texinfo-mode-hook 'oni:texinfo-mode-func)
|
||||
(add-hook 'write-file-hooks 'oni:write-file-func)
|
||||
(add-hook 'yas-minor-mode-hook 'oni:yas-minor-mode-func)
|
||||
|
||||
(global-set-key (kbd "'") 'oni:self-insert-dwim)
|
||||
(global-set-key (kbd "<XF86AudioNext>") 'emms-next)
|
||||
(global-set-key (kbd "<XF86AudioPlay>") 'oni:emms-toggle-playing)
|
||||
(global-set-key (kbd "<XF86AudioPrev>") 'emms-previous)
|
||||
(global-set-key (kbd "<XF86AudioStop>") 'emms-stop)
|
||||
(global-set-key (kbd "<XF86HomePage>") 'oni:raise-scratch)
|
||||
(global-set-key (kbd "<XF86Mail>") 'oni:view-mail)
|
||||
(global-set-key (kbd "<XF86Tools>") 'oni:start-emms)
|
||||
(global-set-key (kbd "<f10>") 'git-project-show-files)
|
||||
(global-set-key (kbd "<f5>") 'ext:reload-buffer)
|
||||
(global-set-key (kbd "<f6>") 'jabber-switch-to-roster-buffer)
|
||||
(global-set-key (kbd "<f7>") 'magit-status)
|
||||
(global-set-key (kbd "<f8>") 'oni:raise-eshell)
|
||||
(global-set-key (kbd "C-<") 'oni:indent-shift-left)
|
||||
(global-set-key (kbd "C->") 'oni:indent-shift-right)
|
||||
(global-set-key (kbd "C-M-4") 'split-window-vertically)
|
||||
(global-set-key (kbd "C-M-SPC") 'er/expand-region)
|
||||
(global-set-key (kbd "C-M-d") 'kill-word)
|
||||
(global-set-key (kbd "C-M-w") 'backward-kill-word)
|
||||
(global-set-key (kbd "C-S-k") 'kill-whole-line)
|
||||
(global-set-key (kbd "C-a") 'oni:move-beginning-of-dwim)
|
||||
(global-set-key (kbd "C-c a") 'org-agenda)
|
||||
(global-set-key (kbd "C-c c") 'org-capture)
|
||||
(global-set-key (kbd "C-c i p") 'identica-update-status-interactive)
|
||||
(global-set-key (kbd "C-c p") 'oni:show-buffer-position)
|
||||
(global-set-key (kbd "C-c t") 'oni:raise-ansi-term)
|
||||
(global-set-key (kbd "C-d") 'oni:kill-region-or-forward-char)
|
||||
(global-set-key (kbd "C-e") 'oni:move-end-of-dwim)
|
||||
(global-set-key (kbd "C-k") 'oni:kill-region-or-line)
|
||||
(global-set-key (kbd "C-w") 'oni:kill-region-or-backward-char)
|
||||
(global-set-key (kbd "M-4") 'split-window-horizontally)
|
||||
(global-set-key (kbd "M-n") 'idomenu)
|
||||
(global-set-key (kbd "\"") 'oni:self-insert-dwim)
|
||||
(global-set-key (kbd "M-o") 'other-window)
|
||||
(global-set-key (kbd "M-1") 'delete-other-windows)
|
||||
(global-set-key (kbd "M-2") 'split-window-below)
|
||||
(global-set-key (kbd "M-3") 'split-window-right)
|
||||
(global-set-key (kbd "M-0") 'delete-window)
|
||||
|
||||
(if (daemonp)
|
||||
(global-set-key "\C-x\C-c" 'oni:close-client-window))
|
||||
|
||||
(when (or window-system (daemonp))
|
||||
(global-unset-key "\C-z"))
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.jl$" . sawfish-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode))
|
||||
(add-to-list 'auto-mode-alist
|
||||
'("\\.m\\(ark\\)?d\\(?:o?wn\\)?$" . markdown-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.tpl$" . html-mode))
|
||||
(add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode))
|
||||
(add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode))
|
||||
|
||||
(add-to-list 'debug-ignored-errors "^Can't shift all lines enough")
|
||||
|
||||
(add-to-list
|
||||
'display-buffer-alist
|
||||
'("^\\*\\(?:.+-\\)?scratch\\*$" . ((display-buffer-same-window . nil))))
|
||||
(add-to-list
|
||||
'display-buffer-alist
|
||||
'("^\\*git-project-list\\*$" . ((git-project-show-window . nil))))
|
||||
(add-to-list
|
||||
'display-buffer-alist
|
||||
'("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil))))
|
||||
|
||||
(unless (oni:required-packages-installed-p)
|
||||
(message "%s" "Refreshing package database...")
|
||||
(package-refresh-contents)
|
||||
(message "%s" " done.")
|
||||
(mapc #'(lambda (package)
|
||||
(when (not (package-installed-p package))
|
||||
(package-install package)))
|
||||
oni:required-packages))
|
||||
|
||||
(blink-cursor-mode -1)
|
||||
(column-number-mode -1)
|
||||
(line-number-mode -1)
|
||||
(menu-bar-mode -1)
|
||||
(scroll-bar-mode -1)
|
||||
(tool-bar-mode -1)
|
||||
(tooltip-mode -1)
|
||||
|
||||
(auto-insert-mode)
|
||||
(electric-indent-mode)
|
||||
(electric-pair-mode)
|
||||
(ido-mode)
|
||||
(ido-ubiquitous-mode)
|
||||
(savehist-mode)
|
||||
(show-paren-mode)
|
||||
(winner-mode)
|
||||
|
||||
(smex-initialize)
|
||||
(help-at-pt-set-timer)
|
||||
|
||||
(load-theme 'yoshi t)
|
||||
|
||||
(load custom-file)
|
||||
;; (load "rudel-loaddefs.el")
|
||||
(load (expand-file-name "~/quicklisp/slime-helper.el"))
|
||||
|
||||
(load "quick-edit-mode")
|
||||
(global-set-key (kbd "C-z") 'quick-edit-mode)
|
||||
|
||||
(unless (server-running-p)
|
||||
(server-start))
|
||||
|
||||
(diminish 'auto-fill-function "_")
|
||||
(ac-config-default)
|
||||
|
||||
(provide 'init)
|
||||
|
||||
;;; init.el ends here
|
356
.emacs.d/init.org
Normal file
356
.emacs.d/init.org
Normal file
|
@ -0,0 +1,356 @@
|
|||
#+TITLE: Emacs init
|
||||
#+STYLE: <link href="http://ryuslash.ninth.su/test2.css" rel="stylesheet">
|
||||
#+OPTIONS: author:nil
|
||||
|
||||
* Startup
|
||||
|
||||
Startup requires a bit of customization to handle all my
|
||||
customizations.
|
||||
|
||||
** Load paths
|
||||
|
||||
I have two versions of Emacs installed on my main computer. I have
|
||||
a daily build of Emacs's ~trunk~ (or currently ~emacs-24~) branch from
|
||||
bazaar and I have the official ~emacs~ package from archlinux
|
||||
installed. I keep that second one around so that the occasional
|
||||
emacs package that I install using ~pacman~ will recognize it as a
|
||||
dependency and so that if there has been some horrible mistake in
|
||||
the ~trunk~ branch I still have a stable version to fall back
|
||||
on[fn:1].
|
||||
|
||||
*** Package initialization
|
||||
|
||||
In order for packages installed through ELPA to be included
|
||||
without having to mess with load paths and such, use:
|
||||
|
||||
#+NAME: package-initialize
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(package-initialize)
|
||||
#+END_SRC
|
||||
|
||||
*** site-lisp
|
||||
|
||||
Because of the setup I wrote about I need to have both the
|
||||
self-built ~site-lisp~ directory in my load path *and* the "official"
|
||||
one.
|
||||
|
||||
#+NAME: load-site-lisps
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(mapc #'oni:add-all-to-load-path
|
||||
'("/usr/share/emacs/site-lisp"
|
||||
"/usr/local/emacs/share/emacs/site-lisp"))
|
||||
#+END_SRC
|
||||
|
||||
The =oni:add-all-to-load-path= function just binds =default-directory=
|
||||
to the given directory and calls
|
||||
=normal-top-level-add-subdirs-to-load-path= to add it and all its
|
||||
subdirectories to the load path.
|
||||
|
||||
#+NAME: add-all
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun oni:add-all-to-load-path (dir)
|
||||
(add-to-list 'load-path dir)
|
||||
(let ((default-directory dir))
|
||||
(normal-top-level-add-subdirs-to-load-path)))
|
||||
#+END_SRC
|
||||
|
||||
**** TODO Add load paths in different order depending on version
|
||||
|
||||
The officially installed version should load
|
||||
=/usr/share/emacs/site-lisp= before
|
||||
=/usr/local/emacs/share/emacs/sit-lisp= and the bzr version should
|
||||
do the reversed.
|
||||
|
||||
*** Projects
|
||||
|
||||
Then there are some projects I'm working on, which I use on a
|
||||
daily basis, these should also be added so I don't have to
|
||||
constantly remove and re-install them through ~package.el~ when
|
||||
working on them. And there is the ~load-defs.el~ in my personal
|
||||
~site-lisp~ directory of course.
|
||||
|
||||
#+NAME: load-projects
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(mapc #'oni:add-to-load-path-maybe-load-defs
|
||||
'("~/projects/emacs/dispass.el" "~/var/src/emacs/mode-icons"
|
||||
"~/.emacs.d/site-lisp"))
|
||||
#+END_SRC
|
||||
|
||||
The =oni:add-to-load-path-maybe-load-defs= function just adds the
|
||||
given directory to the load path and then looks for a file named
|
||||
~loaddefs.el~ within that directory, if it exists it loads it.
|
||||
|
||||
#+NAME: add-with-loaddefs
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun oni:add-to-load-path-maybe-load-defs (dir)
|
||||
(add-to-list 'load-path dir)
|
||||
(let ((loaddefs (concat dir "/loaddefs.el")))
|
||||
(when (file-exists-p loaddefs)
|
||||
(load loaddefs))))
|
||||
#+END_SRC
|
||||
|
||||
*** Themes
|
||||
|
||||
And, finally, I'm also working on a color theme for emacs, this
|
||||
should be added to ~custom-theme-load-path~. By using =mapc= here as
|
||||
well I'm keeping in mind that this isn't the first theme I've
|
||||
worked on and it might not be the last either.
|
||||
|
||||
#+NAME: load-themes
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(mapc #'oni:add-to-custom-theme-load-path
|
||||
'("~/projects/emacs/yoshi-theme"))
|
||||
#+END_SRC
|
||||
|
||||
The =oni:add-to-custom-theme-load-path= just adds the given
|
||||
directory to the cutom theme load path.
|
||||
|
||||
#+NAME: add-themes
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun oni:add-to-custom-theme-load-path (dir)
|
||||
(add-to-list 'custom-theme-load-path dir))
|
||||
#+END_SRC
|
||||
|
||||
*** Evaluation
|
||||
|
||||
Because during byte-compilation certain parts loaded so far might
|
||||
also be required I put it in an =eval-and-compile= form, so that all
|
||||
components are loaded with ~emacs -Q~ as well. Without this
|
||||
compilation might fail at certain points.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el :noweb yes
|
||||
(eval-and-compile
|
||||
<<add-all>>
|
||||
|
||||
<<add-with-loaddefs>>
|
||||
|
||||
<<add-themes>>
|
||||
|
||||
<<package-initialize>>
|
||||
<<load-site-lisps>>
|
||||
<<load-projects>>
|
||||
<<load-themes>>)
|
||||
#+END_SRC
|
||||
|
||||
** Modules
|
||||
|
||||
While I try to use =eval-after-load= and =autoload= as much as
|
||||
possible, some things require direct =require='ing to be of use.
|
||||
|
||||
*** Require
|
||||
|
||||
- ~auto-complete-config~ :: This sets up some default settings to
|
||||
make ~auto-complete~ work for most[fn:2] of the modes it
|
||||
supports.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(require 'auto-complete-config)
|
||||
#+END_SRC
|
||||
|
||||
- ~geiser-install~ :: Sets up geiser autoloads and such.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(require 'geiser-install)
|
||||
#+END_SRC
|
||||
|
||||
- ~uniquify~ :: Provides more helpful buffer name uniquification.
|
||||
The default of using ~buffer-name<2>~ is boring and
|
||||
uninformative, ~uniquify~ fixes this.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(require 'uniquify)
|
||||
#+END_SRC
|
||||
|
||||
- ~ext~ :: Functions from external sources.
|
||||
- ~oni~ :: Functions written personally.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(require 'ext)
|
||||
(require 'oni)
|
||||
#+END_SRC
|
||||
|
||||
*** Autoload
|
||||
|
||||
These might not be used at all in a session, so they should only
|
||||
be loaded when necessary.
|
||||
|
||||
=define-slime-contrib= was used by some module that didn't autoload
|
||||
or require it[fn:3]. But since I don't use whichever model it
|
||||
was every day, it is of no use to load it every single time.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(autoload 'define-slime-contrib "slime")
|
||||
#+END_SRC
|
||||
|
||||
I installed ~global~ with ~pacman~, but this doesn't add anything to
|
||||
any =loaddefs.el=, so doesn't create any autoloads.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(autoload 'gtags-mode "gtags" nil t)
|
||||
#+END_SRC
|
||||
|
||||
~jabber.el~ does create ~jabber-autoloads.el~, but I only ever start
|
||||
using it through ~jabber-connect~, so anything else isn't really
|
||||
necessary.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(autoload 'jabber-connect "jabber" nil t)
|
||||
#+END_SRC
|
||||
|
||||
I used to work a bit on ~php-mode~, but that was a while ago, so
|
||||
it's still in my ~site-lisp~ directory.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(autoload 'php-mode "php-mode" nil t)
|
||||
#+END_SRC
|
||||
|
||||
The same that goes for ~gtags.el~ also goes for ~po-mode.el~.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(autoload 'po-mode "po-mode" nil t)
|
||||
#+END_SRC
|
||||
|
||||
And the same that went for ~php-mode~ also goes for ~pony-mode~,
|
||||
except I'm still working on it and I was too lazy to put it with
|
||||
my other projects. I should still do that.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(autoload 'pony-mode "pony-mode" nil t)
|
||||
#+END_SRC
|
||||
|
||||
~sawfish.el~ has the same problem that ~gtags.el~ and ~po-mode.el~ have.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(autoload 'sawfish-mode "sawfish" nil t)
|
||||
#+END_SRC
|
||||
|
||||
I use =server-running-p= to check whether or not I should start a
|
||||
new server, but this function isn't autoloaded by default.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(autoload 'server-running-p "server")
|
||||
#+END_SRC
|
||||
|
||||
I was starting to try ~slime-js~ to make JavaScript programming
|
||||
more interesting, but I haven't gotten around to trying it out
|
||||
fully, yet. It shares issues with ~gtags.el~, ~po-mode.el~ and
|
||||
~sawfish.el~.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(autoload 'slime-js-minor-mode "slime-js" nil t)
|
||||
#+END_SRC
|
||||
|
||||
I found ~xmodmap-mode~ on the [[http://emacswiki.org][EmacsWiki]] some time ago, it was
|
||||
simple and a good example of how to use ~define-generic-mode~, but
|
||||
since it's not really my project and it's really small it just
|
||||
sits in my ~site-lisp~ directory.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(autoload 'xmodmap-mode "xmodmap-mode" nil t)
|
||||
#+END_SRC
|
||||
|
||||
~w3m~ also has a setup module like ~geiser-install~, but since I only
|
||||
ever use these two functions to start it, there is no real need
|
||||
for anything else.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(autoload 'w3m-bookmark-view "w3m" nil t)
|
||||
(autoload 'w3m-goto-url "w3m" nil t)
|
||||
#+END_SRC
|
||||
|
||||
* Aliases
|
||||
|
||||
I've never had any trouble with accidentally pressing ~y~ while being
|
||||
asked a question, so I've never had any reason to prefer ~yes-or-no-p~
|
||||
over ~y-or-n-p~.
|
||||
|
||||
#+begin_src emacs-lisp :tangle init2.el
|
||||
(defalias 'yes-or-no-p 'y-or-n-p)
|
||||
#+end_src
|
||||
|
||||
~ibuffer~ is a drop-in replacement for ~list-buffers~, but with more
|
||||
features.
|
||||
|
||||
#+begin_src emacs-lisp :tangle init2.el
|
||||
(defalias 'list-buffers 'ibuffer)
|
||||
#+end_src
|
||||
|
||||
I don't know if replacing ~dabbrev-expand~ with ~hippie-expand~, but at
|
||||
least ~hippie-expand~ doesn't use ~dabbrev-expand~, and I haven't
|
||||
noticed anything wrong so far, and ~hippie-expand~ does so much more
|
||||
than ~dabbrev-expand~.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(defalias 'dabbrev-expand 'hippie-expand)
|
||||
#+END_SRC
|
||||
|
||||
* Faces
|
||||
|
||||
Define a face to how the summary line of git commits as the first
|
||||
headline of an ~org-mode~ file.
|
||||
|
||||
#+begin_src emacs-lisp :tangle init2.el
|
||||
(defface git-commit-summary-face
|
||||
'((t (:inherit org-level-1)))
|
||||
"Face for the git title line."
|
||||
:group 'local)
|
||||
#+end_src
|
||||
|
||||
Define a face to show characters that have been placed beyond the
|
||||
maximum length of a summary line.
|
||||
|
||||
#+begin_src emacs-lisp :tangle init2.el
|
||||
(defface git-commit-overlong-summary-face
|
||||
'((t (:background "#873732")))
|
||||
"Face for commit titles that are too long."
|
||||
:group 'local)
|
||||
#+end_src
|
||||
|
||||
Define a face to show characters that have been placed on the second
|
||||
line of a git commit. Those should always remain empty.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
||||
(defface git-commit-nonempty-second-line-face
|
||||
'((t (:inherit git-commit-overlong-summary-face)))
|
||||
"Face for the supposedly empty line in commit messages."
|
||||
:group 'local)
|
||||
#+END_SRC
|
||||
|
||||
* Keys
|
||||
|
||||
Since the ~C-l~ combination is so much easier than ~C-j~ when using the
|
||||
[[http://colemak.com][colemak]] keyboard layout and I use ~C-j~ much more, switch them.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp tangle init2.el
|
||||
(define-key key-translation-map (kbd "C-j") (kbd "C-l"))
|
||||
(define-key key-translation-map (kbd "C-l") (kbd "C-j"))
|
||||
#+END_SRC
|
||||
|
||||
* eldoc
|
||||
|
||||
Diminish ~eldoc~'s lighter to nothing after it loads to keep the
|
||||
mode-line clean.
|
||||
|
||||
#+begin_src emacs-lisp :tangle init2.el
|
||||
(eval-after-load "eldoc"
|
||||
'(diminish 'eldoc-mode))
|
||||
#+end_src
|
||||
|
||||
* eshell
|
||||
|
||||
After ~em-term.el~ loads add ~unison~ to the ~eshell-visual-commands~ to
|
||||
make sure it gets unbuffered input.
|
||||
|
||||
#+begin_src emacs-lisp :tangle init2.el
|
||||
(eval-after-load "em-term"
|
||||
'(add-to-list 'eshell-visual-commands "unison"))
|
||||
#+end_src
|
||||
|
||||
* Footnotes
|
||||
|
||||
[fn:1] Though it doesn't happen often that ~trunk~ is so messed up that
|
||||
I can't use it.
|
||||
|
||||
[fn:2] Or perhaps all.
|
||||
|
||||
[fn:3] I think it was ~slime-js-minor-mode~, but I'm not sure.
|
7
.emacs.d/site-lisp/Makefile
Normal file
7
.emacs.d/site-lisp/Makefile
Normal file
|
@ -0,0 +1,7 @@
|
|||
DESTDIR:=$(DESTDIR)/site-lisp
|
||||
objects=dzen.elc dzen.el eltuki.elc eltuki.el ext.elc ext.el \
|
||||
metalexpress.elc metalexpress.el mu4e-init.elc mu4e-init.el \
|
||||
newsticker-init.elc newsticker-init.el oni.elc oni.el org-init.elc \
|
||||
org-init.el quick-edit-mode.elc quick-edit-mode.el
|
||||
|
||||
include ../../dotfiles.mk
|
84
.emacs.d/site-lisp/dzen.el
Normal file
84
.emacs.d/site-lisp/dzen.el
Normal file
|
@ -0,0 +1,84 @@
|
|||
;;; dzen.el --- Control DZEN2 from emacs
|
||||
|
||||
;; Copyright (C) 2012 Tom Willemsen
|
||||
|
||||
;; Author: Tom Willemsen <slash@drd>
|
||||
;; Keywords: convenience
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'newst-backend)
|
||||
(require 'sawfish)
|
||||
|
||||
(defvar dzen-process nil
|
||||
"Dzen2's process.")
|
||||
|
||||
(defvar dzen-timer nil
|
||||
"Timer used to update the dzen line.")
|
||||
|
||||
(defun get-mail-count (account)
|
||||
(length (directory-files (concat "/home/slash/documents/mail/"
|
||||
account "/inbox/new") nil "^[^.]")))
|
||||
|
||||
(defun dzen-update ()
|
||||
(let ((strl "")
|
||||
(strc metal-express-radio-currently-playing)
|
||||
(strr (format
|
||||
"jabber: %s ryu: %d gm: %d aet: %d 9n: %d rss: %d\n"
|
||||
(oni:current-jabber-status)
|
||||
(get-mail-count "ryuslash.org")
|
||||
(get-mail-count "gmail")
|
||||
(get-mail-count "aethon")
|
||||
(get-mail-count "ninthfloor")
|
||||
(newsticker--stat-num-items-total 'new))))
|
||||
(process-send-string
|
||||
"dzen2" (format "%s^p(_CENTER)^p(-%d)%s^p(_RIGHT)^p(-%d)%s"
|
||||
strl
|
||||
(* (floor (/ (length strc) 2)) 8) strc
|
||||
(+ 8 (* 8 (length strr))) strr))))
|
||||
|
||||
(defun dzen-start ()
|
||||
(interactive)
|
||||
(if (or (null dzen-process) (not (process-live-p dzen-process)))
|
||||
(progn
|
||||
(setq dzen-process
|
||||
(start-process "dzen2" "*dzen2*" "dzen2"
|
||||
"-w" "1920"
|
||||
"-fn" "Monaco-10"
|
||||
"-bg" "#222224"
|
||||
"-fg" "#eeeeec"
|
||||
"-y" "1060"))
|
||||
(dzen-update)
|
||||
(setq dzen-timer (run-with-timer 1 1 #'dzen-update)))
|
||||
(message "Dzen2 already running")))
|
||||
|
||||
(defun dzen-stop ()
|
||||
(interactive)
|
||||
(if (and dzen-process (process-live-p dzen-process))
|
||||
(progn
|
||||
(when dzen-timer
|
||||
(cancel-timer dzen-timer))
|
||||
(kill-process "dzen2"))
|
||||
(message "Dzen2 is not running"))
|
||||
(setq dzen-process nil
|
||||
dzen-timer nil))
|
||||
|
||||
(provide 'dzen)
|
||||
;;; dzen.el ends here
|
|
@ -1,8 +1,8 @@
|
|||
;;; eltuki.el --- Tekuti functions
|
||||
|
||||
;; Copyright (C) 2012 Tom Willemse
|
||||
;; Copyright (C) 2012 Tom Willemsen
|
||||
|
||||
;; Author: Tom Willemse <slash@drd>
|
||||
;; Author: Tom Willemsen <slash@drd>
|
||||
;; Keywords: convenience
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
|
@ -174,11 +174,9 @@
|
|||
|
||||
(defun eltuki-write-content (dir)
|
||||
(let ((org-export-with-toc nil)
|
||||
(org-export-with-section-numbers nil)
|
||||
(filename (concat dir "/content"))
|
||||
(org-export-show-temporary-export-buffer nil))
|
||||
(org-html-export-as-html nil nil nil t)
|
||||
(with-current-buffer "*Org HTML Export*"
|
||||
(filename (concat dir "/content")))
|
||||
(with-current-buffer (org-export-region-as-html
|
||||
(point-min) (point-max) t "*eltuki-html*")
|
||||
(write-region (point-min) (point-max) filename)
|
||||
(kill-buffer))
|
||||
filename))
|
||||
|
@ -230,37 +228,5 @@
|
|||
(eltuki-commit)
|
||||
(kill-buffer buffer)))
|
||||
|
||||
(defun eltuki-process-sentinel (proc status)
|
||||
"Print PROC's STATUS."
|
||||
(message "git %s" (substring status 0 -1)))
|
||||
|
||||
(defun eltuki--passwd-prompt (string)
|
||||
"Decide on what to prompt based on STRING."
|
||||
(cond
|
||||
((or
|
||||
(string-match "^Enter passphrase for key '\\\(.*\\\)': $" string)
|
||||
(string-match "^\\\(.*\\\)'s password:" string))
|
||||
(format "Password for '%s': " (match-string 1 string)))
|
||||
((string-match "^[pP]assword:" string)
|
||||
"Password:")))
|
||||
|
||||
(defun eltuki-process-filter (proc string)
|
||||
"Check if PROC is asking for a password in STRING."
|
||||
(with-current-buffer (process-buffer proc)
|
||||
(let ((inhibit-read-only t)
|
||||
(ask (eltuki--passwd-prompt string)))
|
||||
(if ask
|
||||
(process-send-string proc (concat (read-passwd ask nil) "\n"))
|
||||
(insert string)))))
|
||||
|
||||
(defun eltuki-publish ()
|
||||
"Publish posts."
|
||||
(interactive)
|
||||
(let* ((default-directory (concat eltuki-blog-dir "/"))
|
||||
(proc (start-process "eltuki-publish" "*eltuki-publish*"
|
||||
"git" "push")))
|
||||
(set-process-sentinel proc 'eltuki-process-sentinel)
|
||||
(set-process-filter proc 'eltuki-process-filter)))
|
||||
|
||||
(provide 'eltuki)
|
||||
;;; eltuki.el ends here
|
47
.emacs.d/site-lisp/ext.el
Normal file
47
.emacs.d/site-lisp/ext.el
Normal file
|
@ -0,0 +1,47 @@
|
|||
;;; ext.el --- More emacs functions
|
||||
|
||||
;; Copyright (C) 2012 Tom Willemsen
|
||||
|
||||
;; Author: Tom Willemsen <tom@ryuslash.org>
|
||||
;; Keywords: local
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defadvice org-agenda-redo (after ext:org-agenda-redo-add-appts)
|
||||
"Pressing `r' on the agenda will also add appointments."
|
||||
(progn
|
||||
(setq appt-time-msg-list nil)
|
||||
(org-agenda-to-appt)))
|
||||
|
||||
(defun ext:flymake-pyflakes-init ()
|
||||
"Initialize function for flymake with pyflakes."
|
||||
(let* ((temp-file (flymake-init-create-temp-buffer-copy
|
||||
'flymake-create-temp-inplace))
|
||||
(local-file (file-relative-name temp-file (file-name-directory
|
||||
buffer-file-name))))
|
||||
(list "pycheck.sh" (list local-file))))
|
||||
|
||||
(defun ext:reload-buffer ()
|
||||
"Reload current buffer."
|
||||
(interactive)
|
||||
(revert-buffer nil t nil))
|
||||
|
||||
(provide 'ext)
|
||||
;;; ext.el ends here
|
|
@ -1,8 +1,8 @@
|
|||
;;; metalexpress.el --- Listen to Metal Express Radio
|
||||
|
||||
;; Copyright (C) 2012 Tom Willemse
|
||||
;; Copyright (C) 2012 Tom Willemsen
|
||||
|
||||
;; Author: Tom Willemse <thomas@aethon.nl>
|
||||
;; Author: Tom Willemsen <thomas@aethon.nl>
|
||||
;; Keywords: multimedia
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
|
@ -24,8 +24,6 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(require 'notifications)
|
||||
|
||||
(defgroup metal-express-radio nil
|
||||
"Group for the Metal Express Radio listening functions."
|
||||
:group 'multimedia)
|
||||
|
@ -48,7 +46,7 @@
|
|||
(when (string-match "^ICY Info: StreamTitle='\\(.*\\)';StreamUrl='';"
|
||||
string)
|
||||
(setq metal-express-radio-currently-playing (match-string 1 string))
|
||||
(run-hooks 'metal-express-radio-song-changed-hook)))
|
||||
(apply 'run-hooks metal-express-radio-song-changed-hook)))
|
||||
|
||||
(defun metal-express-radio-echo-currently-playing ()
|
||||
(interactive)
|
||||
|
@ -57,15 +55,14 @@
|
|||
(defun metal-express-radio-notify ()
|
||||
(interactive)
|
||||
(notifications-notify :title "Now playing:"
|
||||
:body metal-express-radio-currently-playing
|
||||
:app-name "Metal Express Radio"))
|
||||
:body metal-express-radio-currently-playing))
|
||||
|
||||
;;;###autoload
|
||||
(defun metal-express-radio-start ()
|
||||
"Start listening to Metal Express Radio."
|
||||
(interactive)
|
||||
(let ((proc (start-process "metalexpress" "*Metal Express Radio*"
|
||||
"mplayer" "-playlist" metal-express-radio-playlist-url)))
|
||||
"mplayer" metal-express-radio-playlist-url)))
|
||||
(set-process-filter proc #'mer-proc-filter)))
|
||||
|
||||
(defun metal-express-radio-stop ()
|
54
.emacs.d/site-lisp/mu4e-init.el
Normal file
54
.emacs.d/site-lisp/mu4e-init.el
Normal file
|
@ -0,0 +1,54 @@
|
|||
;;; mu4e-init.el --- mu4e initialization
|
||||
|
||||
;; Copyright (C) 2012 Tom Willemsen
|
||||
|
||||
;; Author: Tom Willemsen <slash@drd>
|
||||
;; Keywords:
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'oni)
|
||||
|
||||
(oni:define-mailbox "aethon"
|
||||
(oni:email thomas at aethon dot nl)
|
||||
(expand-file-name "~/documents/work/aethon/signature.txt"))
|
||||
(oni:define-mailbox "gmail" (oni:email ryuslash at gmail dot com))
|
||||
(oni:define-mailbox "ninthfloor"
|
||||
(oni:email ryuslash at ninthfloor dot org))
|
||||
(oni:define-mailbox "ryuslash" (oni:email tom at ryuslash dot org)
|
||||
nil "ryuslash.org")
|
||||
|
||||
(setq mu4e-headers-date-format "%d-%m %H:%M")
|
||||
(setq mu4e-headers-fields '((:date . 11)
|
||||
(:flags . 6)
|
||||
(:to . 22)
|
||||
(:from . 22)
|
||||
(:subject)))
|
||||
(setq mu4e-headers-show-threads nil)
|
||||
(setq mu4e-headers-sort-revert nil)
|
||||
(setq mu4e-html2text-command "w3m -dump -T text/HTML -cols 72")
|
||||
(setq mu4e-my-email-addresses (list
|
||||
(oni:email tom at ryuslash dot org)
|
||||
(oni:email ryuslash at gmail dot com)
|
||||
(oni:email ryuslash at ninthfloor dot org)
|
||||
(oni:email thomas at aethon dot nl)))
|
||||
|
||||
(provide 'mu4e-init)
|
||||
;;; mu4e-init.el ends here
|
6
.emacs.d/site-lisp/newsticker-init.el
Normal file
6
.emacs.d/site-lisp/newsticker-init.el
Normal file
|
@ -0,0 +1,6 @@
|
|||
(setq newsticker-automatically-mark-items-as-old nil)
|
||||
(setq newsticker-html-renderer 'w3m-region)
|
||||
(setq newsticker-obsolete-item-max-age 604800)
|
||||
(setq newsticker-use-full-width nil)
|
||||
|
||||
(provide 'newsticker-init)
|
635
.emacs.d/site-lisp/oni.el
Normal file
635
.emacs.d/site-lisp/oni.el
Normal file
|
@ -0,0 +1,635 @@
|
|||
;;; oni.el --- Functions for emacs
|
||||
|
||||
;; Copyright (C) 2012 Tom Willemsen
|
||||
|
||||
;; Author: Tom Willemsen <tom@ryuslash.org>
|
||||
;; Keywords: local
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(autoload 'notifications-notify "notifications")
|
||||
(autoload 'jabber-send-message "jabber-chat")
|
||||
|
||||
(defmacro oni:define-mailbox (name email &optional signature longname)
|
||||
"Define a mailbox function for mailbox NAME with address EMAIL.
|
||||
Optionally set signature to SIGNATURE and use LONGNAME as the
|
||||
actual account name."
|
||||
`(defun ,(make-symbol (concat "oni:" name "-mailbox")) ()
|
||||
,(concat "Settings for " name " mailbox")
|
||||
(setq mu4e-mu-home ,(expand-file-name (concat "~/.mu/" name))
|
||||
mu4e-maildir ,(expand-file-name (concat "~/documents/mail/"
|
||||
(or longname name)))
|
||||
mu4e-get-mail-command ,(concat "offlineimap -oa " (or longname
|
||||
name))
|
||||
mu4e~main-buffer-name ,(concat "*mu4e-" name "*")
|
||||
user-mail-address ,email
|
||||
message-sendmail-extra-arguments '("-a" ,name)
|
||||
message-signature-file ,signature)))
|
||||
|
||||
(defmacro oni:email (user at host dot com)
|
||||
"Turn arguments into an email address.
|
||||
The resulting email address will look like: USER@HOST.COM, AT and
|
||||
DOT are intentionally being skipped."
|
||||
(concat (symbol-name user) "@" (symbol-name host) "."
|
||||
(symbol-name com)))
|
||||
|
||||
(defvar oni:mailbox-map
|
||||
'("top" ("menu"
|
||||
("ryulash.org" . "ryuslash")
|
||||
("ninthfloor" . "ninthfloor")
|
||||
("gmail" . "gmail")
|
||||
("aethon" . "aethon")))
|
||||
"A mailbox map for use with `tmm-prompt'.")
|
||||
|
||||
(defvar oni:required-packages
|
||||
'(graphviz-dot-mode htmlize magit rainbow-delimiters rainbow-mode
|
||||
yasnippet markdown-mode flymake flymake-cursor sauron expand-region
|
||||
fill-column-indicator git-auto-commit-mode idomenu magit smex)
|
||||
"List of all the packages I have (want) installed.")
|
||||
|
||||
(defun oni:after-save-func ()
|
||||
"Function for `after-save-hook'."
|
||||
(oni:compile-el)
|
||||
(executable-make-buffer-file-executable-if-script-p)
|
||||
(let* ((dom-dir (locate-dominating-file (buffer-file-name) "Makefile"))
|
||||
(TAGSp (not (string= "" (shell-command-to-string
|
||||
(concat "grep \"^TAGS:\" " dom-dir "Makefile"))))))
|
||||
(when (and dom-dir TAGSp)
|
||||
(shell-command
|
||||
(concat "make -C " dom-dir " TAGS >/dev/null 2>&1")))))
|
||||
|
||||
(defun oni:appt-display-window-and-jabber (min-to-app new-time appt-msg)
|
||||
"Send a message to my phone jabber account."
|
||||
(jabber-send-message (car jabber-connections) "phone@ryuslash.org"
|
||||
nil (format "%s%s (in %s minutes)"
|
||||
new-time appt-msg min-to-app) nil)
|
||||
(appt-disp-window min-to-app new-time appt-msg))
|
||||
|
||||
(defun oni:before-save-func ()
|
||||
"Function for `before-save-hook'."
|
||||
(if (eq major-mode 'html-mode)
|
||||
(oni:replace-html-special-chars))
|
||||
(if (not (eq major-mode 'markdown-mode))
|
||||
(delete-trailing-whitespace)))
|
||||
|
||||
(defun oni:c-mode-func ()
|
||||
"Function for `c-mode-hook'."
|
||||
(local-set-key [f9] 'compile)
|
||||
(local-set-key "\C-j" 'oni:newline-and-indent))
|
||||
|
||||
(defun oni:close-client-window ()
|
||||
"Close a client's frames."
|
||||
(interactive)
|
||||
(server-save-buffers-kill-terminal nil))
|
||||
|
||||
(defun oni:compile-el ()
|
||||
"Compile the current buffer file if it is an .el file."
|
||||
(let* ((full-file-name (buffer-file-name))
|
||||
(file-name (file-name-nondirectory full-file-name))
|
||||
(suffix (file-name-extension file-name)))
|
||||
(if (and (not (string-equal file-name ".dir-locals.el"))
|
||||
(string-equal suffix "el"))
|
||||
(byte-compile-file full-file-name))))
|
||||
|
||||
(defun oni:css-mode-func ()
|
||||
"Function for `css-mode-hook'."
|
||||
(local-set-key "\C-j" 'oni:newline-and-indent)
|
||||
(rainbow-mode))
|
||||
|
||||
(defun oni:current-jabber-status ()
|
||||
"Return a string representing the current jabber status."
|
||||
(or (and (not *jabber-connected*) "Offline")
|
||||
(and (not (string= *jabber-current-status* ""))
|
||||
*jabber-current-status*)
|
||||
"Online"))
|
||||
|
||||
(defun oni:diary-display-func ()
|
||||
"Function for `diary-display-hook'."
|
||||
(diary-fancy-display))
|
||||
|
||||
(defun oni:emacs-lisp-mode-func ()
|
||||
"Function for `emacs-lisp-mode-hook'."
|
||||
(eldoc-mode))
|
||||
|
||||
(defun oni:emms-toggle-playing ()
|
||||
"Toggle between playing/paused states."
|
||||
(interactive)
|
||||
(if (eq emms-player-playing-p nil)
|
||||
(emms-start)
|
||||
(emms-pause)))
|
||||
|
||||
(defun oni:erc-mode-func ()
|
||||
"Function for `erc-mode-hook'."
|
||||
(erc-fill-mode -1)
|
||||
(visual-line-mode)
|
||||
(setq truncate-lines nil))
|
||||
|
||||
(defun oni:eshell-mode-func ()
|
||||
"Function for `eshell-mode-hook'."
|
||||
(setq truncate-lines nil))
|
||||
|
||||
(defun oni:eshell-prompt-function ()
|
||||
"Show a pretty shell prompt."
|
||||
(let ((status (if (zerop eshell-last-command-status) ?+ ?-))
|
||||
(hostname (shell-command-to-string "hostname"))
|
||||
(dir (abbreviate-file-name (eshell/pwd)))
|
||||
(branch
|
||||
(shell-command-to-string
|
||||
"git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'"))
|
||||
(userstatus (if (zerop (user-uid)) ?# ?$)))
|
||||
(concat
|
||||
(propertize (char-to-string status)
|
||||
'face `(:foreground ,(if (= status ?+)
|
||||
"green"
|
||||
"red")))
|
||||
" "
|
||||
(propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id)
|
||||
" "
|
||||
(propertize (oni:shorten-dir dir) 'face 'font-lock-string-face)
|
||||
" "
|
||||
(when (not (string= branch ""))
|
||||
(propertize
|
||||
;; Cut off "* " and "\n"
|
||||
(substring branch 2 -1)
|
||||
'face 'font-lock-function-name-face))
|
||||
" \n"
|
||||
(propertize (char-to-string userstatus)
|
||||
'face `(:foreground "blue"))
|
||||
"> ")))
|
||||
|
||||
(defun oni:flymake-mode-func ()
|
||||
"Function for `flymake-mode-hook'."
|
||||
(local-set-key [M-P] 'flymake-goto-prev-error)
|
||||
(local-set-key [M-N] 'flymake-goto-next-error))
|
||||
|
||||
(defun oni:go-mode-func ()
|
||||
"Function for `go-mode-hook'."
|
||||
(setq indent-tabs-mode nil)
|
||||
(local-set-key "\C-j" 'oni:newline-and-indent))
|
||||
|
||||
(defun oni:gtags-mode-func ()
|
||||
"Function for `gtags-mode-hook'."
|
||||
(local-set-key "\M-," 'gtags-find-tag)
|
||||
(local-set-key "\M-." 'gtags-find-rtag))
|
||||
|
||||
(defun oni:html-mode-func ()
|
||||
"Function for `html-mode-hook'."
|
||||
(yas-minor-mode)
|
||||
(fci-mode))
|
||||
|
||||
(defun oni:indent-shift-left (start end &optional count)
|
||||
"Rigidly indent region.
|
||||
Region is from START to END. Move
|
||||
COUNT number of spaces if it is non-nil otherwise use
|
||||
`tab-width'."
|
||||
(interactive
|
||||
(if mark-active
|
||||
(list (region-beginning) (region-end) current-prefix-arg)
|
||||
(list (line-beginning-position)
|
||||
(line-end-position)
|
||||
current-prefix-arg)))
|
||||
(if count
|
||||
(setq count (prefix-numeric-value count))
|
||||
(setq count tab-width))
|
||||
(when (> count 0)
|
||||
(let ((deactivate-mark nil))
|
||||
(save-excursion
|
||||
(goto-char start)
|
||||
(while (< (point) end)
|
||||
(if (and (< (current-indentation) count)
|
||||
(not (looking-at "[ \t]*$")))
|
||||
(error "Can't shift all lines enough"))
|
||||
(forward-line))
|
||||
(indent-rigidly start end (- count))))))
|
||||
|
||||
(defun oni:indent-shift-right (start end &optional count)
|
||||
"Indent region between START and END rigidly to the right.
|
||||
If COUNT has been specified indent by that much, otherwise look at
|
||||
`tab-width'."
|
||||
(interactive
|
||||
(if mark-active
|
||||
(list (region-beginning) (region-end) current-prefix-arg)
|
||||
(list (line-beginning-position)
|
||||
(line-end-position)
|
||||
current-prefix-arg)))
|
||||
(let ((deactivate-mark nil))
|
||||
(if count
|
||||
(setq count (prefix-numeric-value count))
|
||||
(setq count tab-width))
|
||||
(indent-rigidly start end count)))
|
||||
|
||||
(defun oni:jabber-alert-message-func (from buffer text title)
|
||||
(notifications-notify :title title
|
||||
:body text))
|
||||
|
||||
(defun oni:jabber-chat-mode-func ()
|
||||
"Function for `jabber-chat-mode-hook'."
|
||||
(visual-line-mode)
|
||||
(setq mode-line-format (append (cddr jabber-chat-header-line-format)
|
||||
'(global-mode-string))
|
||||
header-line-format nil))
|
||||
|
||||
(defun oni:jabber-roster-mode-func ()
|
||||
"Function for `jabber-roster-mode-hook'."
|
||||
(setq mode-line-format
|
||||
(list (propertize " %m" 'face 'mode-line-buffer-id))))
|
||||
|
||||
(defun oni:java-mode-func ()
|
||||
"Function for `java-mode-hook'."
|
||||
(local-set-key "\C-j" 'oni:newline-and-indent))
|
||||
|
||||
(defun oni:js-mode-func ()
|
||||
"Function for `js-mode-hook'."
|
||||
(rainbow-delimiters-mode)
|
||||
(local-set-key "\C-j" 'oni:newline-and-indent)
|
||||
(pretty-symbols-mode -1))
|
||||
|
||||
(defun oni:js2-mode-func ()
|
||||
"Function for `js2-mode-hook'."
|
||||
(oni:prog-mode-func)
|
||||
(oni:js-mode-func)
|
||||
(local-set-key (kbd "<f5>") #'slime-js-reload)
|
||||
(slime-js-minor-mode))
|
||||
|
||||
(defun oni:kill-region-or-backward-char ()
|
||||
"Either `kill-region' or `backward-delete-char-untabify'."
|
||||
(interactive)
|
||||
(if (region-active-p)
|
||||
(kill-region (region-beginning) (region-end))
|
||||
(backward-delete-char-untabify 1)))
|
||||
|
||||
(defun oni:kill-region-or-forward-char ()
|
||||
"Either `kill-region' or `delete-forward-char'."
|
||||
(interactive)
|
||||
(if (region-active-p)
|
||||
(kill-region (region-beginning) (region-end))
|
||||
(delete-forward-char 1)))
|
||||
|
||||
(defun oni:kill-region-or-line ()
|
||||
"Either `kill-region' or `kill-line'."
|
||||
(interactive)
|
||||
(if (region-active-p)
|
||||
(kill-region (region-beginning) (region-end))
|
||||
(kill-line)))
|
||||
|
||||
(defun oni:lua-mode-func()
|
||||
"Function for `lua-mode-hook'."
|
||||
(local-unset-key (kbd ")"))
|
||||
(local-unset-key (kbd "]"))
|
||||
(local-unset-key (kbd "}")))
|
||||
|
||||
(defun oni:magit-log-edit-mode-func ()
|
||||
"Function for `magit-log-edit-mode-hook'."
|
||||
(auto-fill-mode)
|
||||
(font-lock-add-keywords
|
||||
nil
|
||||
'(("\\`\\(.\\{,50\\}\\)\\(.*\\)\n?\\(.*\\)$"
|
||||
(1 'git-commit-summary-face)
|
||||
(2 'git-commit-overlong-summary-face)
|
||||
(3 'git-commit-nonempty-second-line-face))
|
||||
("`\\([^']+\\)'" 1 font-lock-constant-face))
|
||||
t))
|
||||
|
||||
(defun oni:markdown-mode-func ()
|
||||
"Function for `markdown-mode-hook'."
|
||||
(setq-local comment-auto-fill-only-comments nil)
|
||||
(setq-local whitespace-style '(face trailing))
|
||||
(auto-fill-mode)
|
||||
(whitespace-mode))
|
||||
|
||||
(defun oni:message-mode-func ()
|
||||
"Function for `message-mode-hook'."
|
||||
(setq-local comment-auto-fill-only-comments nil)
|
||||
(auto-fill-mode)
|
||||
(flyspell-mode))
|
||||
|
||||
(defun oni:mini-fix-timestamp-string (date-string)
|
||||
"A minimal version of Xah Lee's `fix-timestamp-string'.
|
||||
Turn DATE-STRING into something else that can be worked with in
|
||||
code. Found at http://xahlee.org/emacs/elisp_parse_time.html"
|
||||
(setq date-string (replace-regexp-in-string "Jan" "01" date-string)
|
||||
date-string (replace-regexp-in-string "Feb" "02" date-string)
|
||||
date-string (replace-regexp-in-string "Mar" "03" date-string)
|
||||
date-string (replace-regexp-in-string "Apr" "04" date-string)
|
||||
date-string (replace-regexp-in-string "May" "05" date-string)
|
||||
date-string (replace-regexp-in-string "Jun" "06" date-string)
|
||||
date-string (replace-regexp-in-string "Jul" "07" date-string)
|
||||
date-string (replace-regexp-in-string "Aug" "08" date-string)
|
||||
date-string (replace-regexp-in-string "Sep" "09" date-string)
|
||||
date-string (replace-regexp-in-string "Oct" "10" date-string)
|
||||
date-string (replace-regexp-in-string "Nov" "11" date-string)
|
||||
date-string (replace-regexp-in-string "Dec" "12" date-string))
|
||||
(string-match
|
||||
"^\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{4\\}\\)$"
|
||||
date-string)
|
||||
(format "%s-%s-%s"
|
||||
(match-string 3 date-string)
|
||||
(match-string 2 date-string)
|
||||
(match-string 1 date-string)))
|
||||
|
||||
(defun oni:move-beginning-of-dwim ()
|
||||
"Move to beginning of line either after indentation or before."
|
||||
(interactive)
|
||||
(let ((start (point)))
|
||||
(back-to-indentation)
|
||||
(if (= start (point))
|
||||
(beginning-of-line))))
|
||||
|
||||
(defun oni:move-end-of-dwim ()
|
||||
"Move to end of line, either before any comments or after."
|
||||
(interactive)
|
||||
(let ((start (point))
|
||||
(eolpos (line-end-position)))
|
||||
(beginning-of-line)
|
||||
(if (and comment-start
|
||||
(comment-search-forward eolpos t))
|
||||
(progn
|
||||
(search-backward-regexp (concat "[^ \t" comment-start "]"))
|
||||
(forward-char)
|
||||
|
||||
(when (or (bolp)
|
||||
(= start (point)))
|
||||
(end-of-line)))
|
||||
(end-of-line))))
|
||||
|
||||
(defun oni:myepisodes-formatter (plist)
|
||||
"Format RSS items from MyEpisodes as org tasks.
|
||||
PLIST contains all the pertinent information."
|
||||
(let ((str (plist-get plist :title)))
|
||||
(string-match
|
||||
"^\\[ \\([^\]]+\\) \\]\\[ \\([^\]]+\\) \\]\\[ \\([^\]]+\\) \\]\\[ \\([^\]]+\\) \\]$"
|
||||
str)
|
||||
(let* ((title (match-string 1 str))
|
||||
(episode (match-string 2 str))
|
||||
(name (match-string 3 str))
|
||||
(date (oni:mini-fix-timestamp-string (match-string 4 str))))
|
||||
(format "* ACQUIRE %s %s - %s \n SCHEDULED: <%s>"
|
||||
title episode name date))))
|
||||
|
||||
(defun oni:newline-and-indent ()
|
||||
"`newline-and-indent', but with a twist.
|
||||
When dealing with braces, add another line and indent that too."
|
||||
(interactive)
|
||||
(if (and (not (or (= (point) (point-max))
|
||||
(= (point) (point-min))))
|
||||
(or (and (char-equal (char-before) ?{)
|
||||
(char-equal (char-after) ?}))
|
||||
(and (char-equal (char-before) ?\()
|
||||
(char-equal (char-after) ?\)))))
|
||||
(save-excursion (newline-and-indent)))
|
||||
(newline-and-indent))
|
||||
|
||||
(defun oni:org-mode-func ()
|
||||
"Function for `org-mode-hook'."
|
||||
(auto-fill-mode)
|
||||
(yas-minor-mode)
|
||||
(setq-local comment-auto-fill-only-comments nil))
|
||||
|
||||
(defun oni:php-mode-func ()
|
||||
"Function for `php-mode-hook'."
|
||||
(flymake-mode)
|
||||
(local-set-key "\C-j" 'oni:newline-and-indent)
|
||||
(c-set-offset 'arglist-intro '+)
|
||||
(c-set-offset 'arglist-close '0)
|
||||
(rainbow-delimiters-mode)
|
||||
(setq fci-rule-column 80))
|
||||
|
||||
(defun oni:pretty-control-l-function (win)
|
||||
"Just make a string of either `fci-rule-colum' or `fill-column'
|
||||
length -1. Use the `-' character. WIN is ignored."
|
||||
(make-string
|
||||
(1- (if (boundp 'fci-rule-column) fci-rule-column fill-column)) ?-))
|
||||
|
||||
(defun oni:prog-mode-func ()
|
||||
"Function for `prog-mode-hook'."
|
||||
(rainbow-delimiters-mode)
|
||||
(fci-mode)
|
||||
(pretty-symbols-mode)
|
||||
(yas-minor-mode)
|
||||
(auto-fill-mode))
|
||||
|
||||
(defun oni:python-mode-func ()
|
||||
"Function for `python-mode-hook'."
|
||||
(flymake-mode)
|
||||
(local-set-key (kbd "C->") 'python-indent-shift-right)
|
||||
(local-set-key (kbd "C-<") 'python-indent-shift-left)
|
||||
(set (make-local-variable 'electric-indent-chars) nil)
|
||||
(rainbow-delimiters-mode)
|
||||
(setq fci-rule-column 79
|
||||
fill-column 72)
|
||||
(setq-local whitespace-style '(tab-mark))
|
||||
(fci-mode)
|
||||
(whitespace-mode))
|
||||
|
||||
(defun oni:raise-ansi-term (arg)
|
||||
"Create or show an `ansi-term' buffer."
|
||||
(interactive "P")
|
||||
(let ((buffer (get-buffer "*ansi-term*")))
|
||||
(if (and buffer (not arg))
|
||||
(switch-to-buffer buffer)
|
||||
(call-interactively 'ansi-term))))
|
||||
|
||||
(defun oni:raise-eshell ()
|
||||
"Start or switch back to `eshell'.
|
||||
Also change directories to current working directory."
|
||||
(interactive)
|
||||
(let ((dir (file-name-directory
|
||||
(or (buffer-file-name) "~/")))
|
||||
(hasfile (not (eq (buffer-file-name) nil))))
|
||||
(eshell)
|
||||
(if (and hasfile (eq eshell-process-list nil))
|
||||
(progn
|
||||
(eshell/cd dir)
|
||||
(eshell-reset)))))
|
||||
|
||||
(defun oni:raise-scratch (&optional mode)
|
||||
"Show the *scratch* buffer.
|
||||
If called with a universal argument, ask the user which mode to
|
||||
use. If MODE is not nil, open a new buffer with the name
|
||||
*MODE-scratch* and load MODE as its major mode."
|
||||
(interactive (list (if current-prefix-arg
|
||||
(read-string "Mode: ")
|
||||
nil)))
|
||||
(let* ((bname (if mode
|
||||
(concat "*" mode "-scratch*")
|
||||
"*scratch*"))
|
||||
(buffer (get-buffer bname))
|
||||
(mode-sym (intern (concat mode "-mode"))))
|
||||
|
||||
(unless buffer
|
||||
(setq buffer (generate-new-buffer bname))
|
||||
(with-current-buffer buffer
|
||||
(when (fboundp mode-sym)
|
||||
(funcall mode-sym))))
|
||||
|
||||
(select-window (display-buffer buffer))))
|
||||
|
||||
(defun oni:replace-html-special-chars ()
|
||||
"Replace special characters with HTML escaped entities."
|
||||
(oni:replace-occurrences "é" "é"))
|
||||
|
||||
(defun oni:replace-occurrences (from to)
|
||||
"Replace all occurrences of FROM with TO in the current buffer."
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (search-forward from nil t)
|
||||
(replace-match to))))
|
||||
|
||||
(defun oni:request-pull ()
|
||||
"Start a mail to request pulling from a git repository."
|
||||
(interactive)
|
||||
(let* ((default-directory
|
||||
(expand-file-name
|
||||
(or (locate-dominating-file default-directory ".git")
|
||||
(magit-read-top-dir nil))))
|
||||
(refs (magit-list-interesting-refs magit-uninteresting-refs))
|
||||
(from (cdr (assoc (completing-read "From: " refs) refs)))
|
||||
(url (read-from-minibuffer "Pull URL: "))
|
||||
(to (symbol-name (read-from-minibuffer "Up to (HEAD): "
|
||||
nil nil t nil "HEAD")))
|
||||
(patchp (and current-prefix-arg (listp current-prefix-arg))))
|
||||
(message "Requesting pull for %s from %s to %s at %s with%s patch"
|
||||
default-directory from to url (if patchp "" "out"))
|
||||
|
||||
(compose-mail
|
||||
nil (concat
|
||||
"Requesting pull for "
|
||||
(file-name-base (directory-file-name default-directory))))
|
||||
|
||||
(save-excursion
|
||||
(goto-char (point-max))
|
||||
(insert
|
||||
(shell-command-to-string
|
||||
(concat "git --git-dir='" default-directory ".git' --work-tree='"
|
||||
default-directory "' request-pull " (when patchp "-p ")
|
||||
from " " url " " to))))))
|
||||
|
||||
(defun oni:required-packages-installed-p ()
|
||||
"Check if all the packages I need are installed."
|
||||
(let ((tmp-packages oni:required-packages)
|
||||
(result t))
|
||||
(while (and tmp-packages result)
|
||||
(if (not (package-installed-p (car tmp-packages)))
|
||||
(setq result nil))
|
||||
(setq tmp-packages (cdr tmp-packages)))
|
||||
result))
|
||||
|
||||
(defun oni:rst-mode-func ()
|
||||
"Function for `rst-mode-hook'."
|
||||
(auto-fill-mode))
|
||||
|
||||
(defun oni:self-insert-dwim ()
|
||||
"Execute self insert, but when the region is active call self
|
||||
insert at the end of the region and at the beginning."
|
||||
(interactive)
|
||||
(if (region-active-p)
|
||||
(let ((electric-pair-mode nil)
|
||||
(beginning (region-beginning))
|
||||
(end (region-end)))
|
||||
(goto-char end)
|
||||
(self-insert-command 1)
|
||||
(save-excursion
|
||||
(goto-char beginning)
|
||||
(self-insert-command 1)))
|
||||
(self-insert-command 1)))
|
||||
|
||||
(defun oni:shorten-dir (dir)
|
||||
"Shorten a directory, (almost) like fish does it."
|
||||
(while (string-match "\\(/\\.?[^./]\\)[^/]+/" dir)
|
||||
(setq dir (replace-match "\\1/" nil nil dir)))
|
||||
dir)
|
||||
|
||||
(defun oni:show-buffer-position ()
|
||||
"Show the position in the current buffer."
|
||||
(interactive)
|
||||
(message (format "%d:%d" (line-number-at-pos) (current-column))))
|
||||
|
||||
(defun oni:split-window-interactive (dir)
|
||||
"Split windows in direction DIR.
|
||||
|
||||
Can also delete or switch to another window."
|
||||
(interactive
|
||||
(list (read-char "Direction (h,v,q,d,o): ")))
|
||||
(case dir
|
||||
((?v) (split-window-vertically))
|
||||
((?h) (split-window-horizontally))
|
||||
((?q) (delete-other-windows))
|
||||
((?d) (delete-window))
|
||||
((?o) (other-window 1))))
|
||||
|
||||
(defun oni:split-window-interactively (window)
|
||||
"Ask for a direction and split WINDOW that way.
|
||||
|
||||
If no direction is given, don't split."
|
||||
(let ((dir (read-char "Direction (h,v): ")))
|
||||
(case dir
|
||||
((?v) (split-window-vertically))
|
||||
((?h) (split-window-horizontally))
|
||||
(t window))))
|
||||
|
||||
(defun oni:start-emms ()
|
||||
"Check to see if the function `emms' exists, if not call
|
||||
`emms-player-mpd-connect' and assume that will have loaded it."
|
||||
(interactive)
|
||||
(unless (fboundp 'emms)
|
||||
(emms-player-mpd-connect))
|
||||
(emms))
|
||||
|
||||
(defun oni:term-mode-func ()
|
||||
"Function for `term-mode-hook'."
|
||||
(setq truncate-lines nil))
|
||||
|
||||
(defun oni:texinfo-mode-func ()
|
||||
"Function for `texinfo-mode-hook'."
|
||||
(setq-local comment-auto-fill-only-comments nil)
|
||||
(auto-fill-mode))
|
||||
|
||||
(defun oni:view-mail (inbox)
|
||||
"Show a menu with all mailbox options from `oni:mailbox-map'
|
||||
for easy selection."
|
||||
(interactive
|
||||
(list (progn
|
||||
(require 'tmm)
|
||||
(let ((tmm-completion-prompt "Choose a mailbox\n"))
|
||||
(tmm-prompt oni:mailbox-map)))))
|
||||
(if inbox
|
||||
(progn
|
||||
(require 'mu4e)
|
||||
(funcall (intern (concat "oni:" inbox "-mailbox")))
|
||||
(mu4e))))
|
||||
|
||||
(defun oni:write-file-func ()
|
||||
"Function for `write-file-hooks'."
|
||||
(time-stamp))
|
||||
|
||||
(defun oni:yas-minor-mode-func ()
|
||||
"Function for `yas-minor-mode-hook'."
|
||||
(define-key yas-minor-mode-map (kbd "TAB") nil)
|
||||
(define-key yas-minor-mode-map [(tab)] nil)
|
||||
(define-key yas-minor-mode-map (kbd "C-\\") 'yas-expand))
|
||||
|
||||
(define-skeleton html-tag
|
||||
"Testing creation of an html tag"
|
||||
"Tagname:"
|
||||
"<" str ("Attribute: " " " str "=\"" (skeleton-read "Value: ") "\"") ">\n"
|
||||
"</" str ">\n")
|
||||
|
||||
(provide 'oni)
|
||||
;;; oni.el ends here
|
107
.emacs.d/site-lisp/org-init.el
Normal file
107
.emacs.d/site-lisp/org-init.el
Normal file
|
@ -0,0 +1,107 @@
|
|||
;;; org-init.el --- Org initialization
|
||||
|
||||
;; Copyright (C) 2012 Tom Willemsen
|
||||
|
||||
;; Author: Tom Willemsen <slash@drd>
|
||||
;; Keywords:
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'appt)
|
||||
(require 'oni)
|
||||
(require 'org-contacts)
|
||||
(require 'org-habit)
|
||||
(require 'org-protocol)
|
||||
|
||||
(eval-after-load "org-crypt"
|
||||
'(org-crypt-use-before-save-magic))
|
||||
|
||||
(setq org-agenda-custom-commands
|
||||
'(("w" "Work todo." tags-todo "work")))
|
||||
(setq org-agenda-prefix-format
|
||||
'((agenda . " %i %-12:c%?-12t% s")
|
||||
(timeline . " % s")
|
||||
(todo . " %i %-12:c %(concat \"[ \"(org-format-outline-path (org-get-outline-path)) \" ]\") ")
|
||||
(tags . " %i %-12:c %(concat \"[ \"(org-format-outline-path (org-get-outline-path)) \" ]\") ")
|
||||
(search . " %i %-12:c")))
|
||||
(setq org-agenda-sorting-strategy
|
||||
'((agenda habit-down time-up priority-down category-keep)
|
||||
(todo priority-down category-keep)
|
||||
(tags priority-down category-keep)
|
||||
(search category-keep)))
|
||||
(setq org-agenda-tags-column -101)
|
||||
(setq org-capture-templates
|
||||
'(("t" "Task" entry (file "~/documents/org/tasks")
|
||||
"* TODO %?")
|
||||
("T" "Linked task" entry (file "~/documents/org/tasks")
|
||||
"* TODO %?\n\n %a")))
|
||||
(setq org-contacts-files '("~/documents/org/misc/contacts.org"))
|
||||
(setq org-directory (expand-file-name "~/documents/org"))
|
||||
(setq org-agenda-files
|
||||
(append
|
||||
`(,(concat org-directory "/tasks")
|
||||
,(concat org-directory "/misc/contacts.org")
|
||||
,(concat org-directory "/misc/bookmarks.org"))
|
||||
org-agenda-files))
|
||||
(setq org-agenda-show-outline-path nil)
|
||||
(setq org-agenda-todo-ignore-deadlines 'far)
|
||||
(setq org-agenda-todo-ignore-scheduled t)
|
||||
(setq org-default-notes-file (concat org-directory "/org"))
|
||||
(setq org-export-htmlize-output-type 'css)
|
||||
(setq org-feed-alist
|
||||
'(("MyEpisodes"
|
||||
"http://www.myepisodes.com/rss.php?feed=mylist&uid=Slash&pwdmd5=04028968e1f0b7ee678b748a4320ac17"
|
||||
"~/documents/org/tasks" "MyEpisodes"
|
||||
:formatter oni:myepisodes-formatter)))
|
||||
(setq org-fontify-done-headline t)
|
||||
(setq org-hide-emphasis-markers t)
|
||||
(setq org-outline-path-complete-in-steps t)
|
||||
(setq org-refile-allow-creating-parent-nodes t)
|
||||
(setq org-refile-targets '((nil . (:maxlevel . 6))))
|
||||
(setq org-refile-use-outline-path 'file)
|
||||
(setq org-return-follows-link t)
|
||||
(setq org-src-fontify-natively t)
|
||||
(setq org-tags-column -101)
|
||||
(setq org-tags-exclude-from-inheritance '("crypt"))
|
||||
(setq org-todo-keyword-faces
|
||||
'(("TODO" :foreground "#ff756e" :background "#171719" :box (:width 1 :color "#282830"))
|
||||
("DONE" :foreground "#9ad870" :background "#222224" :box (:width 1 :color "#333335"))
|
||||
("SUCCEEDED" :foreground "#9ad870" :background "#222224" :box (:width 1 :color "#333335"))
|
||||
("WAITING" :foreground "#ffbb56" :background "#171719" :box (:width 1 :color "#282830"))
|
||||
("CANCELLED" :foreground "#93d8d8" :background "#222224" :box (:width 1 :color "#333335"))
|
||||
("FAILED" :foreground "#93d8d8" :background "#222224" :box (:width 1 :color "#333335"))
|
||||
("WIP" :foreground "#ff756e" :background "#171719" :box (:width 1 :color "#282830"))
|
||||
("HOLD" :foreground "#ffbb56" :background "#171719" :box (:width 1 :color "#282830"))
|
||||
("ACQUIRE" :foreground "#ff756e" :background "#171719" :box (:width 1 :color "#282830"))
|
||||
("IGNORED" :foreground "#999999" :background "#222224" :box (:width 1 :color "#333335"))))
|
||||
(setq org-use-fast-todo-selection t)
|
||||
(setq org-use-property-inheritance '("slug"))
|
||||
|
||||
(add-hook 'org-agenda-mode-hook 'org-agenda-to-appt)
|
||||
|
||||
(add-to-list 'org-modules 'habit)
|
||||
|
||||
(org-indent-mode t)
|
||||
|
||||
(org-agenda-to-appt)
|
||||
(ad-activate 'org-agenda-redo)
|
||||
|
||||
(provide 'org-init)
|
||||
;;; org-init.el ends here
|
|
@ -1,8 +1,8 @@
|
|||
;;; quick-edit-mode.el --- Quickly edit stuff
|
||||
|
||||
;; Copyright (C) 2012 Tom Willemse
|
||||
;; Copyright (C) 2012 Tom Willemsen
|
||||
|
||||
;; Author: Tom Willemse <slash@drd>
|
||||
;; Author: Tom Willemsen <slash@drd>
|
||||
;; Keywords: convenience
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
4
.emacs.d/snippets/Makefile
Normal file
4
.emacs.d/snippets/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/snippets
|
||||
modules=html-mode org-mode python-mode
|
||||
|
||||
include ../../dotfiles.mk
|
4
.emacs.d/snippets/html-mode/Makefile
Normal file
4
.emacs.d/snippets/html-mode/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/html-mode
|
||||
objects=for generic-block
|
||||
|
||||
include ../../../dotfiles.mk
|
4
.emacs.d/snippets/org-mode/Makefile
Normal file
4
.emacs.d/snippets/org-mode/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/org-mode
|
||||
objects=codeblock heading
|
||||
|
||||
include ../../../dotfiles.mk
|
4
.emacs.d/snippets/python-mode/Makefile
Normal file
4
.emacs.d/snippets/python-mode/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/python-mode
|
||||
objects=defm_empty form form_valid import_from permission_guard url
|
||||
|
||||
include ../../../dotfiles.mk
|
6
.emacs.d/snippets/python-mode/import_from
Normal file
6
.emacs.d/snippets/python-mode/import_from
Normal file
|
@ -0,0 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# name: from ... import ...
|
||||
# contributor: Tom Willemsen
|
||||
# key: from
|
||||
# --
|
||||
from ${1:module} import ${2:class_or_module}
|
|
@ -20,9 +20,9 @@
|
|||
<const>rgb</const>
|
||||
</edit>
|
||||
|
||||
<!-- <edit name="autohint" mode="assign"> -->
|
||||
<!-- <bool>true</bool> -->
|
||||
<!-- </edit> -->
|
||||
<edit name="autohint" mode="assign">
|
||||
<bool>true</bool>
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
<match target="font">
|
|
@ -1,15 +1,13 @@
|
|||
[user]
|
||||
name = Tom Willemse
|
||||
name = Tom Willemsen
|
||||
email = tom@ryuslash.org
|
||||
[core]
|
||||
editor = mg
|
||||
editor = emacs -nw
|
||||
whitespace = trailing-space,tab-in-indent,space-before-tab
|
||||
[color]
|
||||
ui = auto
|
||||
[alias]
|
||||
st = status -s
|
||||
stt = !git status | head -n2 | tail -n1 && git status -s
|
||||
su = status -suno
|
||||
unadd = reset HEAD
|
||||
lschanged = diff --name-only
|
||||
history = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
|
||||
|
@ -22,9 +20,3 @@
|
|||
tool = emerge
|
||||
[push]
|
||||
default = simple
|
||||
[diff "lisp"]
|
||||
xfuncname = "^\\([^ ]+ [^ ]+"
|
||||
[diff "org"]
|
||||
xfuncname = "^\\*+.*"
|
||||
[diff "dia"]
|
||||
textconv = gunzip -c
|
9
.gitignore
vendored
9
.gitignore
vendored
|
@ -1,9 +0,0 @@
|
|||
junk/
|
||||
.src/
|
||||
.cask/
|
||||
_publish/
|
||||
|
||||
.tern-project
|
||||
\#*\#
|
||||
*\#
|
||||
.\#*
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule ".config/zsh/syntax-highlighting"]
|
||||
path = .config/zsh/syntax-highlighting
|
||||
url = git://github.com/zsh-users/zsh-syntax-highlighting
|
4
.hgrc
Normal file
4
.hgrc
Normal file
|
@ -0,0 +1,4 @@
|
|||
[ui]
|
||||
username = Tom Willemsen <tom@ryuslash.org>
|
||||
[extensions]
|
||||
hgext.bookmarks =
|
4
.local/Makefile
Normal file
4
.local/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/.local
|
||||
modules=share
|
||||
|
||||
include ../dotfiles.mk
|
4
.local/share/Makefile
Normal file
4
.local/share/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/share
|
||||
modules=applications
|
||||
|
||||
include ../../dotfiles.mk
|
4
.local/share/applications/Makefile
Normal file
4
.local/share/applications/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/applications
|
||||
objects=moc.desktop ncmpcpp.desktop poweroff.desktop reboot.desktop
|
||||
|
||||
include ../../../dotfiles.mk
|
0
moc/.moc/.gitignore → .moc/.gitignore
vendored
0
moc/.moc/.gitignore → .moc/.gitignore
vendored
5
.moc/Makefile
Normal file
5
.moc/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
DESTDIR:=$(DESTDIR)/.moc
|
||||
modules=themes
|
||||
objects=config
|
||||
|
||||
include ../dotfiles.mk
|
|
@ -1,4 +1,3 @@
|
|||
Layout1 = playlist(0,0,100%,100%):directory(0,0,100%,100%)
|
||||
Layout2 = directory(0,0,50%,100%):playlist(50%,0,FILL,100%)
|
||||
CanStartInPlaylist = yes
|
||||
Theme = custom
|
4
.moc/themes/Makefile
Normal file
4
.moc/themes/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
DESTDIR:=$(DESTDIR)/themes
|
||||
objects=custom
|
||||
|
||||
include ../../dotfiles.mk
|
|
@ -88,13 +88,13 @@ background = default default
|
|||
frame = default default
|
||||
window_title = default default
|
||||
directory = default default bold
|
||||
selected_directory = default blue bold
|
||||
selected_directory = default black bold
|
||||
playlist = default default bold
|
||||
selected_playlist = default blue bold
|
||||
selected_playlist = default black bold
|
||||
file = default default
|
||||
selected_file = default blue
|
||||
selected_file = default black
|
||||
marked_file = green default bold
|
||||
marked_selected_file = green blue bold
|
||||
marked_selected_file = green black bold
|
||||
info = blue default bold
|
||||
status = default default
|
||||
title = default default bold
|
0
mutt/.mutt/.gitignore → .mutt/.gitignore
vendored
0
mutt/.mutt/.gitignore → .mutt/.gitignore
vendored
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue