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/25 12:01] – [Userfull list] adminen: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>ncdu]]
Line 123: Line 124:
 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]]. 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]].
  
-<file add-bookmark>+<code bash>
 #!/bin/bash #!/bin/bash
  
Line 135: Line 136:
  echo "$bookmark" >> "$file"  echo "$bookmark" >> "$file"
 fi fi
-</file>+</code>
 Then in my ''.config/i3/config'' i have the following shortcuts Then in my ''.config/i3/config'' i have the following shortcuts
-<file>+<code>
 bindsym $mod+Shift+b exec ~/s/add-bookmark 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+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)" bindsym $mod+n exec xdotool type "$(grep -v '^#' ~/.bookmarks-ssh | dmenu -i -l 50 | cut -f1)"
-</file>+</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]]// //⚠️ 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.1698228107.txt.gz
  • Last modified: 2023/10/25 12:01
  • by admin