Skip to content

Instantly share code, notes, and snippets.

View marcelarie's full-sized avatar
🐢
always learning

Marcel Arie marcelarie

🐢
always learning
View GitHub Profile
@marcelarie
marcelarie / show_webcam.sh
Created November 13, 2024 11:01
Show webcam (Wayland)
#!/usr/bin/env bash
default_webcam=$(ls /dev/video* | head -n 1)
if [ -z "$1" ]; then
webcam_number=$default_webcam
else
webcam_number="/dev/video$1"
fi
@marcelarie
marcelarie / tofi-calculator.sh
Created October 28, 2024 20:01
Minimal tofi calculator
#!/usr/bin/env bash
XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
tmp_dir="$XDG_CACHE_HOME/tofi-calc"
tmp_path="$tmp_dir/history"
is_history_value=false
max_age_days=10
mkdir -p "$tmp_dir"
if [ ! -f "$tmp_path" ]; then
@marcelarie
marcelarie / cmp-source-creation.lua
Created December 19, 2021 14:47
cmp source creation
local source = {}
---Source constructor.
source.new = function()
local self = setmetatable({}, { __index = source })
self.your_awesome_variable = 1
return self
end
---Return the source name for some information.