Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:tools:linux:misc-tools [2023/10/01 18:09] – [Userfull list] crunchyslimeen:tools:linux:misc-tools [2024/01/28 12:44] (current) – [Download youtube vidéo from clipboard] crunchyslime
Line 31: Line 31:
     * [[man>noto-fonts-emoji]]     * [[man>noto-fonts-emoji]]
   * Utilities   * Utilities
 +    * [[man>yt-dlp]]
     * [[man>unrar]]     * [[man>unrar]]
 +    * [[man>ncdu]]
     * [[man>btop]]     * [[man>btop]]
     * [[man>obs-studio]]     * [[man>obs-studio]]
Line 117: Line 119:
  
 [[https://stackoverflow.com/questions/17440585/how-to-get-pid-of-process-by-specifying-process-name-and-store-it-in-a-variable|source]] [[https://stackoverflow.com/questions/17440585/how-to-get-pid-of-process-by-specifying-process-name-and-store-it-in-a-variable|source]]
 +
 +====Bookmarks====
 +A quick bookmarking script first seen in this video ([[https://invidious.fdn.fr/watch?v=d_11QaTlf1I|invidous link]]).
 +The goal is to store the content of what was highlighted at the time (using [[man>xclip]]) in a file ''.bookmarks''. We then, read this file with [[man>dmenu]].
 +
 +<code bash>
 +#!/bin/bash
 +
 +bookmark=`xclip -o`
 +file="$HOME/.bookmarks"
 +
 +if grep -q "^$bookmark" "$file"; then
 + notify-send "already exists"
 +else
 + notify-send "Bookmark added !" "$bookmark"
 + echo "$bookmark" >> "$file"
 +fi
 +</code>
 +Then in my ''.config/i3/config'' i have the following shortcuts
 +<code>
 +bindsym $mod+Shift+b exec ~/s/add-bookmark
 +bindsym $mod+b exec xdotool type "$(grep -v '^#' ~/.bookmarks | dmenu -i -l 50 | cut -f1)" 
 +bindsym $mod+n exec xdotool type "$(grep -v '^#' ~/.bookmarks-ssh | dmenu -i -l 50 | cut -f1)"
 +</code>
 +
 +//⚠️ this script was written for i3 under X, using Wayland you will need to replace ''xdotool type'' with ''wtype'' and ''xclip -o'' by a command base on [[https://github.com/bugaevc/wl-clipboard|wl-clipboard]]//
 +
 +====Download youtube vidéo from clipboard====
 +Using X with [[man>xsel]] : ''yt-dlp --write-sub -f bestvideo+bestaudio `xsel -ob`''\\
 +Using wayland with [[man>wl-paste]] (seems that wl-type can't fully replace xsel in this situation, using a temp file as buffer) : 
 +<code bash>
 +#!/bin/bash
 +cd "/path/to/download/folder"
 +wl-paste > /tmp/youtube-paste-to-dl
 +#launching in a detached terminal to make it work with shortcuts
 +xfce4-terminal -e 'yt-dlp --write-sub -f bestvideo+bestaudio -a /tmp/youtube-paste-to-dl'
 +rm /tmp/youtube-paste-to-dl
 +</code>
  
 ====bash tools==== ====bash tools====
  • en/tools/linux/misc-tools.1696176577.txt.gz
  • Last modified: 2023/10/01 18:09
  • by crunchyslime