Skip to content

Instantly share code, notes, and snippets.

View SkyyySi's full-sized avatar

Simon B. SkyyySi

View GitHub Profile
@SkyyySi
SkyyySi / systemd.zsh-theme
Created April 28, 2021 13:16
Make zsh look like systemd..!
#!/usr/bin/env zsh
setopt prompt_subst
PROMPT=$'[%(?. %2FOK%f .%1FFAILED%f)] %(?.$(echo "Started ${history[$(( $HISTCMD - 1 ))]}").$(echo "Failed to start ${history[$(( $HISTCMD - 1 ))]}")).\n> '
RPROMPT='%3~'
zle-line-init() {
emulate -L zsh
[[ $CONTEXT == start ]] || return 0
@SkyyySi
SkyyySi / center_widget.lua
Last active January 25, 2022 10:21
Center a widget spawned from a button in awesome wm
your_button:connect_signal("button:press", function(_,_,_,button)
if button == 1 then -- Check which mouse button is used; 1 = left click.
your_drawable.visible = not your_drawable.visible -- not related to placement
awful.placement.align(your_drawable, {
position = "top",
honor_workarea = true,
margins = { -- 10 pixels *in addition to the width of your panel(s)*!
top = 10,
},
})
@SkyyySi
SkyyySi / redraw_imagebox.md
Last active January 25, 2022 17:40
Redraw an awesome wm imagebox widget

Redraw an awesome wm imagebox widget

Description

This code snippet allows you to force a wibox.widget.imagebox to be re-draw itself without pointing it to a new file path.

Important: the solution given here only works with PNG files. If your file is either not a PNG or you are not sure about its type, you can convert it using ffmpeg, shown at the end.

@SkyyySi
SkyyySi / sideways_wibar.md
Last active March 14, 2022 21:01
Create a sideways wibar in awesome window manager

Create a sideways wibar in awesome wm

Description

The wibar of the awesome window manager is extremely flexible and can do many things that are hard to do with other panels at best, that ususally end up being janky anyway, and sometimes just are not possible outright. One of these things is to move the panel to the side of the screen and have everything behave correctly. In the following, I am going to show you how you can create a panel attactched to the right side of each of your connected screens.

@SkyyySi
SkyyySi / youtube-vanced-alternatives.md
Last active June 26, 2024 01:27
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):

@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 / 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

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
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))
@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)