• 2 Posts
  • 7 Comments
Joined 2 years ago
cake
Cake day: July 12th, 2023

help-circle
  • #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
    }