Skip to content

Instantly share code, notes, and snippets.

View hammerill's full-sized avatar
🚘
learns to drive

Kirill hammerill

🚘
learns to drive
View GitHub Profile

Unified Copy

Sometimes it's not easy to get things from a terminal to your system clipboard. If you're connected locally, it has to be a special tool which handles this (like wl-clipboard under Wayland) or something other when connected remotely.

This is a Shell executable which ultimately solves the problem by always reaching your local system clipboard:

#!/bin/bash

printf "\e]52;c;$(base64 -w0)\a"

mpv Copy Timestamp

Lines to add to your ~/.config/mpv/input.conf:

n run sh -c 'echo ${time-pos} | oscopy'
N run sh -c 'echo ${time-pos/full} | oscopy'

This adds two keys:

mpv Autofit Window to 80%

This fixes the mpv window being too big when launching a 4K video on a 1080p screen, for example, by limiting it at 80% of the screen.

Add to ~/.config/mpv/mpv.conf:

autofit-larger=80%x80%

FFmpeg Convert 1.jpg to .jpg

for file in *1.jpg; do ffmpeg -i "$file" "${file%1.jpg}".jpg && rm "$file"; done

Tmux Config

echo -e 'set -g status-bg black\nset -g status-fg white\n\nset -g base-index 1\nsetw -g pane-base-index 1' > ~/.tmux.conf
@hammerill
hammerill / chrome-open-in-mpv.md
Last active June 15, 2025 17:15
Chrome "Open in mpv"

Chrome "Open in mpv"

This is a detailed guide of adding a "Open in mpv" option to your right-click menu in Google Chrome (and potentially all Chromium-based browsers).

Prerequisites

  • The mpv player itself.
  • python3.
  • yt-dlp.