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
@hammerill
hammerill / chrome-open-in-mpv.md
Last active June 13, 2025 12:52
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.

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

FFmpeg Convert 1.jpg to .jpg

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

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%

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:

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"

Sunshine Lock Systemd Entry

/etc/systemd/user/sunshine-lock.service:

[Unit]
Description=Lock Screen When Sunshine Loaded
After=sunshine.service

[Service]

Arch Linux Printer

sudo pacman -S --needed cups system-config-printer
sudo systemctl enable cups --now

system-config-printer
@hammerill
hammerill / arch-pandoc.md
Created April 7, 2025 09:08
Install minimal dependencies in Arch Linux to get Pandoc MD -> PDF conversion working.

Arch Linux Install Pandoc MD -> PDF Convertor

sudo pacman -S --needed pandoc texlive-latexrecommended texlive-fontsrecommended
@hammerill
hammerill / vimrc.md
Last active April 8, 2025 12:24
Define global Vim config.

Define "/etc/vimrc" Config

VIMRC_PATH=/etc/vimrc

echo -e '\nset number\nset relativenumber\n\nset shiftwidth=4\nset smarttab\n\nsyntax on' | sudo tee -a "$VIMRC_PATH"