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
-- Import the necessary modules
local lgi = require 'lgi'
local cairo = lgi.cairo
local Gdk = lgi.Gdk
local Gtk = lgi.Gtk
-- Define the window size
local window_width = 400
local window_height = 300
diff --git a/src/common.h b/src/common.h
index 193bc2a..74013da 100644
--- a/src/common.h
+++ b/src/common.h
@@ -109,6 +109,13 @@ typedef struct glx_prog_main {
GLint unifm_tex;
/// Location of uniform "time" in window GLSL program.
GLint unifm_time;
+ /// Location of the uniform "resolution" in window GLSL program.
+ GLint unifm_win_resolution;
#define PI 3.14159
#define colorRange 24.0
uniform vec2 resolution;
uniform sampler2D tex;
uniform float opacity;
uniform float time;
uniform bool invert_color;
// https://www.shadertoy.com/view/lsBfRc
client.connect_signal("request::titlebars", function(c)
local window_title = {
align = "center",
widget = b.titlewidget(c)
}
local move_window = click(left_click, function() c:emit_signal("request::activate", "titlebar", {raise = true}) awful.mouse.client.move(c) end )
titlebar_color = nil
# This Dockerfile creates a very small AppImage using static
# linking and LTO. It is 100% portable for all x86_64 *OR*
# aarch64 systems.
#
# The general idea is to create a single file you can `scp`
# into all of your system and have a Lua based self contained
# config "just working".
FROM debian:buster-slim as bootstrap
MAINTAINER Emmanuel Lepage Vallee <[email protected]>
@Elv13
Elv13 / fix_mouse_screen.lua
Created May 29, 2019 09:47
Crude and untested (written directly in GitHub editor) attempt to fix the mouse property::screen
-- Instructions:
-- 1) Put this into a file called fix_mouse_screen.lua in ~/.config/awesome
-- 2) add require("fix_mouse_screen") to rc.lua
local placement = require("awful.placement")
local wibox = require("wibox")
local cur = mouse.screen
client.connect_signal("focus", function(c)
@Elv13
Elv13 / radical.patch
Created May 17, 2019 21:40
Radical menu system fix for Awesome 4.3
diff --git a/radical/box.lua b/radical/box.lua
index 197b5cc..75ff7f7 100644
--- a/radical/box.lua
+++ b/radical/box.lua
@@ -24,7 +24,7 @@ local function new(args)
local s = w.screen
w:connect_signal("property::geometry", function()
if w.screen ~= s then
- w:move_by_parent()
+ w:move_next_to()
@Elv13
Elv13 / high_contrast_theme.lua
Created May 2, 2019 03:17
high_contrast_theme.lua
-- 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")
@Elv13
Elv13 / inner_shadow.lua
Last active October 27, 2021 03:46
An AwesomeWM "wibox" container to draw an inner shadow shaped like a rounded rectangle
local cairo = require("lgi").cairo
local gears = require("gears")
local wibox = require("wibox")
local inner_shadow = {}
function inner_shadow:layout(context, width, height)
if not self._private.widget then return end
local offset = (self._private.border_width or 0)
-- Get a string from the command prompt.
local function prompt(message)
return vim.api.nvim_call_function("input", {message})
end
--- Bring sanity back to search, no idiotic magic by default
local function search()
local res = prompt("Search: "):gsub("/", "\\/")
vim.api.nvim_input("<cmd>/\\V"..res.."/<cr><esc>n")