Skip to content

Instantly share code, notes, and snippets.

View SkyyySi's full-sized avatar

SkyyySi

View GitHub Profile
local getmetatable = getmetatable
local type = type
local assert = assert
local rawget = rawget
---@class private
local _M = {}
--- A helper function to check whether the type of a given parameter is correct,
--- generating an error message if it is not.
@SkyyySi
SkyyySi / gtk.css
Created October 22, 2023 17:58
Dracula for GTK4 / libadwaita applications
/*
Generated with Gradience
Issues caused by theming should be reported to Gradience repository, and not to upstream
https://github.com/GradienceTeam/Gradience
*/
@define-color accent_color #bd93f9;
@define-color accent_bg_color #bd93f9;
@SkyyySi
SkyyySi / get-battery.lua
Last active October 18, 2023 16:43
A standalone script to get the current charging percentage of your device's battery, written in Lua. Requires LGI. Linux only (maybe BSD too; probably not, though).
#!/usr/bin/env luajit
local script_version = "1.1.1"
local lgi = require("lgi")
local GLib = lgi.GLib
local UPowerGlib = lgi.UPowerGlib
local function get_battery()
for _, device in pairs(UPowerGlib.Client():get_devices()) do
@SkyyySi
SkyyySi / rc.moon
Last active February 8, 2023 22:06
Port of awesome wm's rc.lua to moonscript
-- 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"
awesome = awesome ---@type awesome
screen = screen ---@type screen
client = client ---@type client
awful = require "awful" ---@type awful
gears = require "gears" ---@type gears
@SkyyySi
SkyyySi / button.lua
Created January 26, 2023 16:50
A wibox.container for turning any widget into a button. For awesomewm.
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
---@class wibox.container.button : wibox.container.background
---@operator call(table): wibox.container.button._instance
---@field private _private table
local button = {}
button.mt = {}
setmetatable(button, button.mt)
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local lgi = require("lgi")
local dpi = beautiful.xresources.apply_dpi
local modkey = modkey or "Mod4"
local spacing = dpi(8)
local font_size = " "..tostring(math.floor(dpi(8)+0.5))
import modules.scripts as scripts
import gradio as gr
import os
from modules import images
from modules.processing import process_images, Processed
from modules.processing import Processed
from modules.shared import opts, cmd_opts, state
@SkyyySi
SkyyySi / LICENSE.md
Last active September 1, 2022 19:46
A nice string conversion module for tables

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@SkyyySi
SkyyySi / lambda.lua
Last active May 20, 2022 18:01
A simple lambda expression parser for Lua. Doesn't support accessing local variables (besides the parameters).
#!/usr/bin/env lua
--- Create a simple anonymous function with a Ruby-like syntax.
---
--- Usage:
---
--- ```
--- local lambda = require("lambda")
--- f = lambda[[|x, y| x + y + 2]]
--- print(f(3, 6))
@SkyyySi
SkyyySi / youtube-vanced-alternatives.md
Last active December 17, 2024 22:42
A list of alternatives after the shutdown of Vanced

NONE OF THESE CLIENTS ARE VERIFIED BY ME FOR SECURITY OR ANYTHING ELSE! USE AT YOUR OWN RISK!

These are the current alternatives (with links when possible):