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
This is how to trim some fat to make Linux slim:
1) Use Debian, Slackware or Arch as the Base distribution
2) Use LXDE, IceWM or JWM
3) Clear the boot services, 90% of them are not needed
4) Use kernel framebuffer and xfbdev instead of Xorg*
5) Swtich the shell from Bash to Dash
6) Use busybox to boot the system instead of coreutils
7) Trim the kernel to < 1.5mb
8) Remove the splash screen
9) Use RAMdisks
@Elv13
Elv13 / gist:5053942
Last active December 14, 2015 07:58
local setmetatable = setmetatable
local print , pairs = print , pairs
local ipairs , type = ipairs , type
local string = string
local debug = debug
local awful = require("awful")
local capi = {client = client , tag = tag ,
screen = screen , mouse = mouse }
local setmetatable = setmetatable
local print = print
local math = math
local beautiful = require( "beautiful" )
local wibox = require( "wibox" )
local cairo = require( "lgi" ).cairo
local capi = { screen = screen ,
mouse = mouse }
module("widgets.tooltip2")
@Elv13
Elv13 / gist:5722026
Created June 6, 2013 14:42
Desaturate and tint and icon using cairo and lua (for awesome WM)
local ic = cairo.Surface(c.icon)
local icp = cairo.Pattern.create_for_surface(ic)
local sw,sh = ic:get_width(),ic:get_height()
-- Create matrix
local ratio = (theme.default_height-4) / ((sw > sh) and sw or sh)
local matrix = cairo.Matrix()
cairo.Matrix.init_scale(matrix,ratio,ratio)
matrix:translate(theme.default_height/2 - 6,-2)
local lgi = require 'lgi'
local Gio = lgi.require 'Gio'
local core = require 'lgi.core'
local introspection_data = Gio.DBusNodeInfo.new_for_xml([=[<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object
Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
@Elv13
Elv13 / gist:5752291
Last active December 18, 2015 08:09
local capi = { client = client, mouse = mouse ,
screen = screen, keygrabber = keygrabber}
local ipairs,print = ipairs,print
local wibox,color = require( "wibox" ) , require( "gears.color" )
local cairo,beautiful = require( "lgi").cairo , require( "beautiful" )
local awful = require("awful")
local module,indicators,cur_c = {},nil,nil
local values = {"top" , "top_right" , "right" , "bottom_right" ,
"bottom" , "bottom_left", "left" , "top_left" }
diff --git a/lib/awful/util.lua.in b/lib/awful/util.lua.in
index ff94e0e..d5f589e 100644
--- a/lib/awful/util.lua.in
+++ b/lib/awful/util.lua.in
@@ -73,7 +73,8 @@ end
-- @param cmd The command.
-- @param sn Enable startup-notification.
-- @param screen The screen where to spawn window.
--- @return The awesome.spawn return value.
+-- @return The forked PID.
diff --git a/lib/wibox/layout/align.lua.in b/lib/wibox/layout/align.lua.in
index 1631c68..8465560 100644
--- a/lib/wibox/layout/align.lua.in
+++ b/lib/wibox/layout/align.lua.in
@@ -28,10 +28,10 @@ function align:draw(wibox, cr, width, height)
if self.first then
local w, h, _ = width, height, nil
if self.dir == "y" then
- _, h = self.first:fit(w, h)
+ _, h = base.fit_widget(self.first, w, h)
local lgi = require 'lgi'
local Gio = lgi.require 'Gio'
local core = require 'lgi.core'
local GLib = lgi.GLib
local introspection_data = Gio.DBusNodeInfo.new_for_xml([=[<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object
Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Introspectable">
function module.download_text_async(url)
local req = create_request()
print("starting",url)
gio.File.new_for_uri(url):load_contents_async(nil,function(file,task,c)
local content = file:load_contents_finish(task)
print("called",content)
if content then
req:emit_signal("request::completed",tostring(content))
end
end)