Skip to content

Instantly share code, notes, and snippets.

View slonkazoid's full-sized avatar
💭
How do you get dark mode

slonkazoid slonkazoid

💭
How do you get dark mode
View GitHub Profile
@slonkazoid
slonkazoid / commands_in_particubes.lua
Last active November 4, 2021 17:01
Command parsing with arguments in Particubes
-- define your commands here
commands = {
help = {
description = "List all commands, or see one's description",
exec = function(cmd)
if cmd[2] ~= nil then -- if user supplied a command name
if commands[cmd[2]] ~= nil then -- and if that command exists
print(cmd[2] .. ": " .. commands[cmd[2]].description) -- print the command's description
else -- if it does not exist
print("Command not found: " .. cmd[2]) -- inform the user
@slonkazoid
slonkazoid / switchHeadphones.sh
Last active April 17, 2021 18:28 — forked from OndraZizka/switchHeadphones.sh
Bluetooth headset - switch between quality sound + no mic (A2DP) and crappy sound and mic (HSP/HFP)
#!/usr/bin/env bash
ID="74_5C_4B_63_EF_A2" # check 'pacmd list-sinks | grep bluez'
#### Restart Bluetooth
if [ "$1" == "resetBT" ] ; then
sudo rfkill block bluetooth && sleep 0.1 && sudo rfkill unblock bluetooth;
exit;
fi;
#### Toggle listen/speak