Skip to content

Instantly share code, notes, and snippets.

View Elv13's full-sized avatar

Emmanuel Lepage Vallée Elv13

  • Google
  • San Francisco
View GitHub Profile
gears.timer {
timeout = 30,
callback = function()
awful.spawn.easy_async(
{"sh", "-c", "acpi | sed -n 's/^.*, \\([0-9]*\\)%/\\1/p'"},
function(out)
for s=1, screen.count() do
screen[s].mywibox.bg = tonumber(out) < 5 and "#ffaa00" or beautiful.bg_normal
end
end
execute pathogen#infect()
call pathogen#infect('bundle/{}')
syntax on
filetype plugin indent on
set rtp+=$HOME/config_files/.vim/bundle/powerline/powerline/bindings/vim/
"let g:airline_section_z = airline#section#create(['windowswap', '⮀%3p%% ', 'linenr', ':%3v'])
set guifont=Ubuntu\ Mono\ derivative\ Powerline\ 13
---------------------------------------------------------------------------
--- Extra helper functions for the keygrabber.
--
-- @author dodo
-- @copyright 2012 dodo
-- @classmod keygrabber
---------------------------------------------------------------------------
local ipairs = ipairs
local table = table
1) install bob
2) install foo
3) build exe
cmake .. -Wno-dev -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF
ld: error: cannot find -lbob
--- sharingmodule.lua
local mysharedvariables = {
a = "foo",
b = "bar"
}
return mysharedvariables
@Elv13
Elv13 / rc.lua
Last active November 4, 2018 06:14
--- Main NeoMutt configuration file rewritten in Lua
local unpack = unpack or table.unpack --lua 5.1 compat
--FIXME remove this hack
local delimiter = "⮀"
------------------------------------
-- Constants --
------------------------------------
awesome-client 'print_as_csv = function(rows) local ret = {}; for k,v in pairs(rows) do table.insert(ret, table.concat(v, ",")) end; return table.concat(ret, "\n") end'
awesome-client 'local ret = {} for _,c in ipairs(client.get()) do table.insert(ret, {c.class, c.name, c.x, c.y, c.width, c.height}) end; return print_as_csv(ret)' | column -ts',' -o ' | '
local pb = wibox.widget {
value = 0.5,
color = "#0000ff",
border_color = "#00ff00",
border_width = 3,
bar_corder_color="#ff00ff",
bar_border_width = 2,
background_color = "#ffff00",
forced_width = 300,
widget = wibox.widget.progressbar
-- Add widgets to the wibox
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
mylauncher,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
local w = wibox {
bg = "#ff0000",
height = 50,
width =50,
shape = function(cr, w, h, ...)
return gears.shape.transform(gears.shape.arrow) : rotate_at(w/2, h/2, math.pi) (cr, w, h, ...)
end,
visible = true
}