Skip to content

Instantly share code, notes, and snippets.

@kohane27
kohane27 / nixos_in_virtualbox.md
Last active July 11, 2024 22:28 — forked from johnrichardrinehart/nixos_in_virtualbox.md
NixOS from "scratch" as Virtualbox Guest

Steps

Inside the Live CD

UEFI instructions

sudo su # assume root
parted /dev/sda -- mklabel gpt
parted /dev/sda -- mkpart primary 512MiB -8GiB
@kohane27
kohane27 / swap-container.sh
Created November 18, 2023 04:45
swap-container.sh
#!/bin/bash
# A list specifies the old and new names of a workspace, then the workspace 'old' is renamed to 'new' if
# 'new' does not exist, UNLESS swapping 'old' and 'new' satisfies the name requirements. The 3rd list
# item specifies the output where the new workspace is to be moved; there may only be two but guessing
# which one is hard, it's easier to be explicit.
function move_workspace_to_output_helper { # Make new the current workspace.
swaymsg "workspace number $1" # Map output letter to output name. Do not insist on the colon being absent or present.
case "${2:0:1}" in z) swaymsg "move workspace to HDMI-A-2" ;; x) swaymsg "move workspace to HDMI-A-1" ;; c) swaymsg "move workspace to VGA-1" ;; esac
@kohane27
kohane27 / kbd
Last active April 8, 2024 21:28
kanata.kbd
(defcfg
linux-dev /dev/input/by-path/platform-i8042-serio-0-event-kbd
process-unmapped-keys yes
)
;; layers
(defalias
super (layer-toggle super)
alt_nav (layer-toggle alt_nav)
)
local CONTEXT = 8
-- change line col text
-- 4 18 9 change one
-- 3 28 21 change two
-- 2 39 23 change three
-- 1 54 13 another change
local function get_text(changelist, current)
local width = 0