Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
fr:tools:linux:misc-tools [2023/10/25 12:01] – [Liste] adminfr:tools:linux:misc-tools [2024/01/28 12:44] (Version actuelle) – [Download youtube vidéo from clipboard] crunchyslime
Ligne 32: Ligne 32:
     * [[man>noto-fonts-emoji]]     * [[man>noto-fonts-emoji]]
   * Utilitaires   * Utilitaires
 +    * [[man>yt-dlp]]
     * [[man>unrar]]     * [[man>unrar]]
     * [[man>ncdu]]     * [[man>ncdu]]
Ligne 123: Ligne 124:
 Notre objectif est de pouvoir stocker ce qui est surligné (en utilisant [[man>xclip]]) dans un fichier ''.bookmarks''. On vient ensuite lire ce fichier avec [[man>dmenu]] Notre objectif est de pouvoir stocker ce qui est surligné (en utilisant [[man>xclip]]) dans un fichier ''.bookmarks''. On vient ensuite lire ce fichier avec [[man>dmenu]]
  
-<file add-bookmark>+<code bash>
 #!/bin/bash #!/bin/bash
  
Ligne 135: Ligne 136:
  echo "$bookmark" >> "$file"  echo "$bookmark" >> "$file"
 fi fi
-</file>+</code>
 puis dans mon ''.config/i3/config'' j'ai les raccourcis suivants puis dans mon ''.config/i3/config'' j'ai les raccourcis suivants
-<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>
  
 //⚠️ ce script a été rédigé pour i3 sous X, sous Wayland il conviendra de remplacer ''xdotool type'' par ''wtype'' et ''xclip -o'' par une commande basée sur [[https://github.com/bugaevc/wl-clipboard|wl-clipboard]]// //⚠️ ce script a été rédigé pour i3 sous X, sous Wayland il conviendra de remplacer ''xdotool type'' par ''wtype'' et ''xclip -o'' par une commande basée sur [[https://github.com/bugaevc/wl-clipboard|wl-clipboard]]//
 +
 +====Download youtube vidéo from clipboard====
 +Avec X en utilisant [[man>xsel]] : ''yt-dlp --write-sub -f bestvideo+bestaudio `xsel -ob`''\\
 +Avec wayland en utilisant [[man>wl-paste]] (il semblerait que wl-paste ne reproduit pas exactement le comportement de [[man>xsel]], utilisation d'un fichier temporaire tampon) : 
 +<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====
  
  • fr/tools/linux/misc-tools.1698228119.txt.gz
  • Dernière modification : 2023/10/25 12:01
  • de admin