Elektrine lite

← Feed

@BananaTrifleViolin@lemmy.world

Post #2176228

2026-02-22 23:38 UTC

That's great! Here's a few tips to take it a bit further; the world is your oyster! Open your .bashrc file (e.g. /home/yourusername/.bashrc) and add the following: `alias get="/path/to/your/bash/file"` Now open a terminal and type **get**, and it'll launch the script. No clicking needed, it'll run anytime from any terminal! And if you do use the alias then you can use another refinement, you can drop the echo: instead of $a, you can use **$1** and remove the echo & read as you no longer need them: `#! /usr/bin/bash yt-dlp -x $1 ` Now for example you can type in a terminal: `get http://url.to.video/ ` And yt-dlp will do it's stuff. $1 passes the first parameter after starting the script as a variable to it. You can use the keyboard shortcut **Control+shift+v** to paste a URL into the terminal, no mouse needed; just remember to add a space after typing **get**

Replies (2)

  • @0t79JeIfK01RHyzo@lemmy.ml 2026-02-23 00:02

    What does your ~/.bashrc look like? My last change was modifying a `playlist` command ::: spoiler spoiler: I explain my last change to my ~/.bashrc file ```bash playlist https://www.youtube.com/@YouTube/videos ``` or ```bash playlist /home/username/Videos ``` or just from any directory with files ```bash playlist ``` And then takes all the videos found at the url or at the path (including within folders), adds them to a playlist, shuffles them, and plays them from mpv. ![](https://lemmy.ml/pictrs/image/8a7722a2-065a-41d3-9ffc-bcb6a5f0b239.jpeg) ![](https://lemmy.ml/pictrs/image/f3dbcc63-b4e7-4007-aef0-1502e345ae0d.png) ```bash playlist() { param="" # If the first parameter has a length more than 1 character if [ ${#1} -gt 1 ]; then param="${@}" else param="." fi screen mpv $param --shuffle --ytdl-raw-options-add=cookies-from-browser=firefox --loop-playlist=inf --no-keepaspect-window --no-auto-window-resize } ``` ::: ::: spoiler other functions and aliases in my ~/.bashrc ```bash alias code=codium alias files=nautilus alias explorer=nautilus alias rust="/path/to/.cargo/bin/evcxr" alias sniffnet="export ICED_BACKEND=tiny-skia; /path/to/.cargo/bin/sniffnet" alias http-server='/path/to/.cargo/bin/miniserve' alias iphone='uxplay' alias airplay='uxplay' alias watch='screen mpv --ytdl-raw-options-add=remote-components=ejs:github --ytdl-raw-options-add=cookies-from-browser=firefox --no-keepaspect-window ' alias twitch='watch' alias timeshift-launcher="pkexec env WAYLAND_DISPLAY='$WAYLAND_DISPLAY' XDG_RUNTIME_DIR='$XDG_RUNTIME_DIR' /usr/bin/timeshift-launcher" alias update="sudo apt update && sudo apt upgrade -y && sudo flatpak update -y && sudo snap refresh" alias resize="path/to/resize/videos/resize.sh" playlist() { param="" # If the first parameter has a length more than 1 character if [ ${#1} -gt 1 ]; then param="${@}" else param="." fi screen mpv $param --shuffle --ytdl-raw-options-add=cookies-from-browser=firefox --loop-playlist=inf --no-keepaspect-window --no-auto-window-resize } gif() { ffmpeg -i $1 -f yuv4mpegpipe - | gifski -o $2 ${@:3} -;} ``` :::

    Open ##2176273

  • @db2@lemmy.world 2026-02-23 04:20

    The op script is meant to be opened in the GUI in a terminal then the URL gets pasted in there. It took me a second to see it.

    Open ##2176274