scripts: add meme download script

This commit is contained in:
Leonardo Eugênio 2023-02-07 13:39:04 -03:00
parent e64d87ae1c
commit 670ae65181
3 changed files with 19 additions and 0 deletions

View file

@ -24,6 +24,7 @@ create_scripts
{ {
br = [ ]; br = [ ];
bmenu = [ final.bemenu final.dhist fish j4-dmenu-desktop jq sway ]; bmenu = [ final.bemenu final.dhist fish j4-dmenu-desktop jq sway ];
down_meme = [ wl-clipboard yt-dlp libnotify ];
wl-copy-file = [ wl-clipboard fish ]; wl-copy-file = [ wl-clipboard fish ];
_diffr = [ diffr ]; _diffr = [ diffr ];
_thunar-terminal = [ final.terminal ]; _thunar-terminal = [ final.terminal ];

17
scripts/down_meme Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
DIR=$(mktemp -d)
cd "$DIR"
yt-dlp --merge-output-format mp4 "$(wl-paste)"
FILENAME="$(ls)"
cp * "$HOME/Downloads/Memes/$FILENAME"
wl-copy-file "$HOME/Downloads/Memes/$FILENAME"
notify-send "Meme downloaded" "$FILENAME"
rm -rf "$DIR"

View file

@ -6,6 +6,7 @@ in {
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
down_meme
yt-dlp yt-dlp
ffmpeg ffmpeg
imagemagick imagemagick