This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dump () | |
{ | |
local id="$1"; | |
local dir="/tmp/pane_dump"; | |
local base="pane"; | |
local index=1; | |
local file; | |
if [ -z "$id" ]; then | |
echo "Usage: dump <pane-id>" 1>&2; | |
return 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This was made for stitching uncopyable ncurses buffers textdumped to files | |
#Expects correct ordering of input, i.e.: pane1, pane2, pane3, etc. | |
#Accepts UTF-8 plain text files There is no restriction on file extension, but | |
# dumpfile names must regex match by 'pane\d+' | |
#If a proceeding pane contains completely new content it will be appended in full and in order, | |
# ortherwise it will append only non-overlapping tail of the next pane, effectively deduplicating overlaps. | |
#!/usr/bin/env python3 | |
import os | |
import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias paneid='kitty @ ls | jq -r ".[] | .tabs[] | select(.is_active) | .windows[] | select(.is_focused) | .id"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Log file opening to last_opened.txt | |
vim.api.nvim_create_autocmd("BufReadPost", { | |
callback = function() | |
local date = os.date("%b %d, %Y") -- Format the current date | |
local file_path = vim.fn.shellescape(vim.fn.expand("<afile>:p")) | |
os.execute(string.format("sed -i '1i%s' /home/user/.config/nvim/last_opened.txt", date .. " " .. file_path)) | |
end, | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local input_file = "tG1hCDXoE-I.en.vtt" -- Change this to your VTT file path | |
local output_file = "output.srt" | |
-- Define input and output file paths. | |
-- Read the entire VTT file into an array of lines. | |
local lines = {} | |
for line in io.lines(input_file) do | |
table.insert(lines, line) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--https://chatgpt.com/c/67e44b59-292c-800b-80b6-3e6b1c609524 | |
local mp = require("mp") | |
local utils = require("mp.utils") | |
local log_file = utils.join_path(os.getenv("HOME"), ".config/mpv/last_watched.txt") | |
-- Function to log current playback | |
local function log_last_watched() | |
local path = mp.get_property("path") | |
if not path then return end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tesseract OCR ; process images as arguments to convert image to text | |
## .bashrc: | |
# alias catpic='python3 $home/scripts/ocr.py' | |
## keybind that I use in my hyprland configuration file: | |
# bind = SUPER, o, exec, grim -g "$(slurp)" - | python3 $home/scripts/ocr.py | wl-copy | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# place in whisper.cpp/ | |
# assign this scfript to a hotkey to start a recording | |
# assign ffmpeg kill command to another hotkey to stop it | |
# if desired, | |
# modify the whisper.cpp/main command to add an argument | |
# for using a specific model other than whisper.cpp's base model | |
cd /home/user/whisper.cpp |