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
@Elv13
Elv13 / geticon.sh
Last active March 22, 2019 18:40
geticon.sh
#!/bin/sh
# This script get the various breeze icons used by an application
# and output a Qt plugin that can be statically linked using the
# official Qt plugin system. It makes applications more portable
# since they no longer require a valid icon theme to be installed.
#
# This is a *fallback* for platforms without an icon theme or with
# incomplete icon themes at the cost of a larger binary.
#
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
-- @DOC_REQUIRE_SECTION@
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
--- This is a LuaJIT FFI binding for the notmuch mail indexer.
--
-- It only supports LuaJIT2 and nothing else.
--
-- The first version only support running queries and tagging the result. That's
-- about has much (ah ah) as notmuch does anyway.
--
-- The thread support seems to crash, no thread tagging for now.
--
local ffi = require("ffi")
/***************************************************************************
* Copyright (C) 2017 by Bluesystems *
* Author : Emmanuel Lepage Vallee <elv1313@gmail.com> *
* *
* 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, *
@Elv13
Elv13 / gist:92b98579e62f086cd9c12f44e510cad0
Created November 6, 2018 14:22
A GDB extension to log changes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gdb
import operator
cs_instances = []
# This module helps generate a complete log of the call stack of a breakpoint.
# It can also record the value of some variables.
# Everything you need to know about static KF5 applications
Hello world!
It's been a long time since my last blog. In the coming weeks, I will publish
a series of post about Qt5/KF5 application minification. I spent almost a month
fixing all issues related to this and had literally no documentation or prior
work to follow. As a long time Gentoo users, I accumulated a large number of
tips and tricks about how to bend GCC to your will.
thinkpad-isa-0000
Adapter: ISA adapter
fan1: 2909 RPM
acpitz-virtual-0
Adapter: Virtual device
temp1: +58.0°C (crit = +200.0°C)
nouveau-pci-0100
Adapter: PCI adapter
#!/bin/bash
# Max out everything
if [ "$1" == "performance" ]; then
echo performance
for I in `seq 0 7`; do echo performance > /sys/devices/system/cpu/cpu${I}/cpufreq/scaling_governor;done
sudo su -c 'echo 4000 > /sys/class/backlight/intel_backlight/brightness'
sudo rfkill unblock 2
sudo /etc/init.d/NetworkManager start
echo N > /sys/module/workqueue/parameters/power_efficient
local function draw(self, content, cr, width, height)
local c = self._private.client[1]
local s = surface(c.content)
local geo = c:geometry()
local scale = math.min(width/geo.width, height/geo.height)
local w, h = geo.width*scale, geo.height*scale