Skip to content

Instantly share code, notes, and snippets.

View Mrfiregem's full-sized avatar

Firegem Mrfiregem

  • 00:21 (UTC -04:00)
View GitHub Profile
@Mrfiregem
Mrfiregem / note.py
Last active June 28, 2024 05:03
A one-file note taking program with colored output
#!/usr/bin/env python3
from pathlib import Path
from typing import Any
import argparse
import datetime
import json
import os
import sys
import textwrap
@Mrfiregem
Mrfiregem / lrc.sh
Created October 8, 2023 00:39
Wrapper around 0x7d4/syncedlyrics to more easily use in scripts. Searches "Artist Name - Song Title" and outputs file with same path as the song file.
#!/usr/bin/env bash
getTitle() {
ffprobe "$1" 2>&1 | sed -En 's/^ *title *: (.*)/\1/p'
}
getArtist() {
ffprobe "$1" 2>&1 | sed -En 's/^ *artist *: (.*)/\1/p'
}
@Mrfiregem
Mrfiregem / meme-text.sh
Last active October 7, 2023 04:14
A bash script to add meme text to a video file using ffmpeg
#!/usr/bin/env bash
# Initialize variables to customize output
: "${FFILE:="${HOME}/.fonts/i/impact.ttf"}" # Let user choose font file
: "${FSIZE:=72}" # Let user choose font size in px
: "${BSIZE:=5}" # Let user choose stroke size in px
: "${OFFSET:='(h*0.05)'}" # Let user choose text offset in px
# TTEXT - Text to display at the top of the image
# BTEXT - Text to display at the bottom of the image
# Exit value index:
#!/bin/sh
repo=${RCREPOPATH:-/usr/local/repo/custom/custom.db.tar.gz}
repo_name=$(echo "$repo" | awk -F '/' '{print $(NF-1)}')
list=$(pacman -Sl "$repo_name" | sed '/\[installed\]/d' | cut -d ' ' -f 2)
if [ -n "$list" ]; then
printf 'Remove packages: %s? [Y/n]: ' "$list"
read -r ans
@Mrfiregem
Mrfiregem / iriver.sh
Created April 9, 2022 06:14
A simple screenshot utility for Wayland WMs
#!/bin/sh
: "${IRIVER_DIR:=$(xdg-user-dir PICTURES)/iriver}"
if [ -z "$1" ]; then
[ -d "${IRIVER_DIR}" ] || mkdir -p "${IRIVER_DIR}"
outfile="${IRIVER_DIR}/$(date '+%FT%T%z').png"
else
_base=$(dirname "$1")
if [ -d "$_base" ]; then
outfile=$1
else