this post was submitted on 23 Jun 2025
193 points (99.0% liked)

Linux

56057 readers
564 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
[–] questionAsker@lemmy.ml 1 points 2 days ago
#Create predefined session with multiple tabs/panes (rss, bluetooth, docker...)
tmux-start 

#Create predefined tmux session with ncmpcpp and ueberzug cover
music 

#Comfort
ls = "ls --color=auto"
please = "sudo !!"

#Quick weather check
weatherH='curl -s "wttr.in/HomeCity?2QF"' 

#Download Youtube playlist videos in separate directory indexed by video order in playlist -> lectures, etc
ytPlaylist='yt-dlp -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s"'

#Download whole album  -> podcasts primarily 
ytAlbum='yt-dlp -x --audio-format mp3 --split-chapters --embed-thumbnail -o "chapter:%(section_title)s.%(ext)s"'

# download video -> extract audio -> show notification
ytm()
{
	tsp yt-dlp -x --audio-format mp3 --no-playlist -P "~/Music/downloaded" $1 \
		--exec "dunstify -i folder-download -t 3000 -r 2598 -u normal  %(filepath)q"

}

# Provide list of optional packages which can be manually selected
pacmanOpts()
{
typeset -a os
for o in `expac -S '%o\n' $1`
do
  read -p "Install ${o}? " r
  [[ ${r,,} =~ ^y(|e|es)$ ]] && os+=( $o )
done

sudo pacman -S $1 ${os[@]}
}

# fkill - kill process
fkill() {
  pid=$(ps -ef | sed 1d | fzf -m --ansi --color fg:-1,bg:-1,hl:46,fg+:40,bg+:233,hl+:46 --color prompt:166,border:46 --height 40%  --border=sharp --prompt="➤  " --pointer="➤ " --marker="➤ " | awk '{print $2}')

  if [ "x$pid" != "x" ]
  then
    kill -${1:-9} $pid
  fi
}