Skip to content

Instantly share code, notes, and snippets.

@MartinRamm
MartinRamm / nixos-rescue.bash
Last active October 29, 2024 19:37
NixOS Rescue Script for Live Disk
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ]
then echo -e 'Forgot "sudo"??\n';
exit
fi
echo -e 'Unencrypt disks with gparted\n';
read -n 1 -s -r -p "Press any key to continue";
echo -e '\n';
@MartinRamm
MartinRamm / awesome-layout-sprial-changable-width.lua
Last active July 6, 2025 23:45
AwesomeWM: Spiral layout with changable width
-- as seen on https://gist.github.com/MartinRamm/fd91dbaa9744e9301ec8e617416ccc49
local spiralWithChangableWidth = {}
spiralWithChangableWidth.name = "dwindle"
function spiralWithChangableWidth.arrange(p)
local fullWidth = p.workarea.width
local fullHeight = p.workarea.height
local tag = p.tag or screen[p.screen].selected_tag
--number between 0 and 1, by default changable via Mod+L and Mod+H. Defaults to 0.5
local rawFactor = tag.master_width_factor
@MartinRamm
MartinRamm / dynamic-menu-awesomewm.lua
Last active July 12, 2025 05:46
Dynamic Menu Entries for Awesome WM
--as seen on https://gist.github.com/MartinRamm/d2c9762fe87c9ed0427ff2a36cc7b74a
--we extend the awful menu class here
DynamicMenu = awful.menu
--there is no "super" function in LUA. So we need to keep a reference of the original method like this
local original_new_fn = DynamicMenu.new
--now override the super method. In this case this is the method that is
function DynamicMenu.new(args, parent)
--if required, set iconRight to the fallbackSubmenuIcon
if args.fallbackSubmenuIcon and args.items then