this post was submitted on 23 Jun 2025
146 points (99.3% liked)

Linux

55583 readers
1222 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

A while ago I made a tiny function in my ~/.zshrc to download a video from the link in my clipboard. I use this nearly every day to share videos with people without forcing them to watch it on whatever site I found it. What's a script/alias that you use a lot?

# Download clipboard to tmp with yt-dlp
tmpv() {
  cd /tmp/ && yt-dlp "$(wl-paste)"
}
you are viewing a single comment's thread
view the rest of the comments
[–] XXIC3CXSTL3Z@lemmy.ml 3 points 18 hours ago

Ooooou I got a couple :3

This one is just a basic mirror fixing thing cuz sometimes I go a while without updating pacman:

alias fixpkg='rate-mirrors --protocol https arch | sudo tee /etc/pacman.d/mirrorlist && sudo pacman -Syy'

This function I made to create virtual audio sinks so I can route audios via qpw and play earrape into discord calls if I want XD

create_vsink() {
    local sink_name=${1:-vsink}  # Default sink name is 'vsink' if no input is provided
    local description=${2:-"Virtual Sink"}  # Default description
    pactl load-module module-null-sink sink_name="$sink_name" sink_properties=device.des>
    echo "Virtual sink '$sink_name' created with description '$description'."
}

Simple parser function I made that makes a whole repo using my git key so it's not just locally created I kinda forgot why I made it tbh:

git_clone() {
    local url="${1#https://}"  # Remove "https://" if present
    git clone "https://$git_key@$url"
}

Awesome mpv function I made that allows for real time pitch+speed shifting via hotkeys and is flexible with extra parameters and shit:

mpv_pitch() {
    if [[ -z "$1" ]]; then
        echo "Usage: mpv_pitch <file> [mpv-options]"
        return 1
    fi
    local file="$1"
    shift
    mpv --input-conf=/dev/stdin "$file" "$@" <<EOF
SHIFT+RIGHT add audio-pitch-correction 0; add pitch 0.01; add speed 0.01  # Decrease pit>
SHIFT+LEFT add audio-pitch-correction 0; add pitch -0.01; add speed -0.01 # Increase pit>
EOF
}

Automatic audio router for firefox audio streams that uses the aforementioned create_sink function to make a specific sink that I can use carla on to mix and make cool shit out of haha

firefox_crush() {
    create_vsink CrunchSink "CrunchSink" 
    firefox --name firefox-vc &

    (while true; do
        SINK_INPUT_ID=$(pactl list sink-inputs short | grep "firefox" | awk '{print $1}')
        if [[ -n "$SINK_INPUT_ID" ]]; then
            pactl move-sink-input "$SINK_INPUT_ID" CrunchSink
            break
        fi
        sleep 0.25
    done) &
}