Browse code

notify: wenn keine neuen Daten, dann kein popup

dewomser authored on19/03/2020 13:37:32
Showing1 changed files
... ...
@@ -9,8 +9,11 @@
9 9
 
10 10
 dl_folder=~/Downloads/youtube-dl/
11 11
 f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
12
+if [ -z "$f" ]
13
+then exit
14
+else
12 15
 folder1="$(echo $dl_folder|sed "s/\//\\\\\//g")"
13 16
 sedarg="sed s/$folder1/\n/g"
14 17
 f=$(echo "$f"|$sedarg)
15 18
 notify-send "Neue Videos": "$f" --icon=video-x-generic
16
-
19
+fi
Browse code

generalüberholte yt-dl-send-notify.sh

dewomser authored on18/03/2020 15:47:05
Showing1 changed files
... ...
@@ -3,16 +3,14 @@
3 3
 #This schows new Viedoclips. Script is tested with Kubuntu 19.10 and uses notify-send Popup-Window
4 4
 #dl_folder should be the same as in youtube-dl.sh
5 5
 #if you use the default,you need not edit this script.
6
-#If you want to be noticed regulary there is a line for your user crontab
6
+#If you want to be remembered regulary there is a line for your user crontab
7 7
 
8 8
 #0 *  * * *  XDG_RUNTIME_DIR=/run/user/$(id -u) /home/foo/bin/yt-dl-send-notify.sh
9 9
 
10 10
 dl_folder=~/Downloads/youtube-dl/
11 11
 f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
12
+folder1="$(echo $dl_folder|sed "s/\//\\\\\//g")"
13
+sedarg="sed s/$folder1/\n/g"
14
+f=$(echo "$f"|$sedarg)
15
+notify-send "Neue Videos": "$f" --icon=video-x-generic
12 16
 
13
-## comment f1=$f and uncomment next 2 lines. Reason,these lines are not shellcheck compatible.
14
-#folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
15
-#f1=$(echo "$f"|sed "s/$folder1/\n/g")
16
-f1=$f
17
-
18
-notify-send "Neue Videos": "$f1" --icon=video-x-generic
Browse code

shellcheck-test 4

dewomser authored on30/12/2019 22:49:32
Showing1 changed files
... ...
@@ -7,14 +7,12 @@
7 7
 
8 8
 #0 *  * * *  XDG_RUNTIME_DIR=/run/user/$(id -u) /home/foo/bin/yt-dl-send-notify.sh
9 9
 
10
-
11
-
12 10
 dl_folder=~/Downloads/youtube-dl/
13 11
 f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
14 12
 
13
+## comment f1=$f and uncomment next 2 lines. Reason,these lines are not shellcheck compatible.
15 14
 #folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
16
-f1=$f
17
-## comment f1=$f and uncomment next line. Reason is this line is not shellcheck compatible. 
18 15
 #f1=$(echo "$f"|sed "s/$folder1/\n/g")
16
+f1=$f
19 17
 
20 18
 notify-send "Neue Videos": "$f1" --icon=video-x-generic
Browse code

shellcheck-test 3

dewomser authored on30/12/2019 22:38:08
Showing1 changed files
... ...
@@ -11,8 +11,8 @@
11 11
 
12 12
 dl_folder=~/Downloads/youtube-dl/
13 13
 f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
14
-folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
15 14
 
15
+#folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
16 16
 f1=$f
17 17
 ## comment f1=$f and uncomment next line. Reason is this line is not shellcheck compatible. 
18 18
 #f1=$(echo "$f"|sed "s/$folder1/\n/g")
Browse code

shellcheck reason

dewomser authored on30/12/2019 22:33:39
Showing1 changed files
... ...
@@ -12,6 +12,9 @@
12 12
 dl_folder=~/Downloads/youtube-dl/
13 13
 f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
14 14
 folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
15
-f1=$(echo "$f"|sed "s/$folder1/\n/g")
15
+
16
+f1=$f
17
+## comment f1=$f and uncomment next line. Reason is this line is not shellcheck compatible. 
18
+#f1=$(echo "$f"|sed "s/$folder1/\n/g")
16 19
 
17 20
 notify-send "Neue Videos": "$f1" --icon=video-x-generic
Browse code

shellcheck -vorschläge eingebaut

dewomser authored on30/12/2019 17:23:49
Showing1 changed files
... ...
@@ -12,5 +12,6 @@
12 12
 dl_folder=~/Downloads/youtube-dl/
13 13
 f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
14 14
 folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
15
-f1=$(echo $f|sed "s/$folder1/\n /g")
15
+f1=$(echo "$f"|sed "s/$folder1/\n/g")
16
+
16 17
 notify-send "Neue Videos": "$f1" --icon=video-x-generic
Browse code

A notifier for KDE/Plasma. Shows newly downloaded videoclips and examples for crontab

dewomser authored on30/12/2019 13:13:16
Showing1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,16 @@
1
+#!/bin/bash
2
+
3
+#This schows new Viedoclips. Script is tested with Kubuntu 19.10 and uses notify-send Popup-Window
4
+#dl_folder should be the same as in youtube-dl.sh
5
+#if you use the default,you need not edit this script.
6
+#If you want to be noticed regulary there is a line for your user crontab
7
+
8
+#0 *  * * *  XDG_RUNTIME_DIR=/run/user/$(id -u) /home/foo/bin/yt-dl-send-notify.sh
9
+
10
+
11
+
12
+dl_folder=~/Downloads/youtube-dl/
13
+f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
14
+folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
15
+f1=$(echo $f|sed "s/$folder1/\n /g")
16
+notify-send "Neue Videos": "$f1" --icon=video-x-generic