summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-03-11 11:07:59 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-03-11 11:07:59 +0100
commitbfeeb48f551dcef96819eb124aa72241656c393b (patch)
tree08b2cb0f684ca069397cabd6433ac70a47edbb86
parent49461617903c19c98cadac9da510a011a524ff59 (diff)
refactor
-rwxr-xr-xbin/common/ytclipo2
-rwxr-xr-xbin/extra/magnet2torrent8
-rwxr-xr-xbin/guiscripts/lh (renamed from bin/guiscripts/linkhandler)18
-rwxr-xr-xbin/menuscripts/mpass-otp2
-rw-r--r--config/common/newsraft/feeds38
-rw-r--r--config/common/newsraft/newpipe_subscriptions_202402222357.json1
6 files changed, 56 insertions, 13 deletions
diff --git a/bin/common/ytclipo b/bin/common/ytclipo
index 1a82df2..b11f84a 100755
--- a/bin/common/ytclipo
+++ b/bin/common/ytclipo
@@ -2,7 +2,7 @@
inp="$(ytlink)"
>&2 printf "inp: %s\n" "$inp"
-notify-send "ytclipo" "downloading <i>$inp</i>" || :
+notify-send "ytclipo" "$inp" || :
yt-dlp "$inp" \
--restrict-filenames \
diff --git a/bin/extra/magnet2torrent b/bin/extra/magnet2torrent
index 0a1f83e..9f7d006 100755
--- a/bin/extra/magnet2torrent
+++ b/bin/extra/magnet2torrent
@@ -21,7 +21,11 @@ fi
hash="${1##*btih:}"
hash="${hash%%&*}"
+url="$(curl -s "https://torrage.info/torrent.php?h=$hash" |
+ pup '#torrent-operation-link attr{href}')"
+>&2 printf "url: %s\n" "$url"
+
# Download the torrent file from a torrent website
torrent_file="${hash}.torrent"
-wget "https://itorrents.org/torrent/${hash}.torrent" -O "$torrent_file"
-echo "Torrent file written to ${torrent_file}"
+curl "$url" -H 'Referer: https://torrage.info/' > tmp.torrent
+echo "$torrent_file"
diff --git a/bin/guiscripts/linkhandler b/bin/guiscripts/lh
index 329e267..956b99b 100755
--- a/bin/guiscripts/linkhandler
+++ b/bin/guiscripts/lh
@@ -6,9 +6,9 @@
# if a music file or pdf, it will download,
# otherwise it opens link in browser.
-test -z "${url:=$1}" &&
- url="$(xclip -sel c -o)"
-dunstify "linkhandler" "<b>handling</b> $url"
+[ "${url:=$1}" ] || url="$(clipo)"
+notify-send "linkhandler" "$url"
+echo "$url" > ~/file.txt
case "$url" in
file://*) file="${url##file:/}"
@@ -17,14 +17,14 @@ case "$url" in
image) imv "$file" ;;
*) xdg-open "$file" ;;
esac ;;
- *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*)
- setsid -f mpv --quiet --ytdl --ytdl-raw-options="format-sort=res:720" "$url" > /dev/null 2>&1 ;;
- *png|*jpg|*jpe|*jpeg|*gif)
- curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && $IMAGE -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
+ *mkv|*webm|*mp4|*bitchute.com*|*odysee.com*) mpv "$url" ;;
+ *youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*) mpv "$(ytlink "$url")" ;;
+ *png|*jpg|*jpe|*jpeg|*gif) curl -sL "$url" | imv - ;;
*pdf|*cbz|*cbr)
- curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && $VIEWER "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
+ curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")"
+ $VIEWER "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;;
*mp3|*flac|*opus|*mp3?source*)
- mpv "$url" 'curl -LO' >/dev/null 2>&1 ;;
+ mpv "$url" ;;
*)
if [ -f "$url" ]
then setsid -f "$TERMINAL" -e "$EDITOR" "$url" >/dev/null 2>&1
diff --git a/bin/menuscripts/mpass-otp b/bin/menuscripts/mpass-otp
index e771f9f..86690d3 100755
--- a/bin/menuscripts/mpass-otp
+++ b/bin/menuscripts/mpass-otp
@@ -4,4 +4,4 @@ pass="$(find "$PASSWORD_STORE_DIR"/keys/otp -name "*.gpg" -printf '%f\n' |
commander -c)"
[ "$pass" ] || exit 1
pass otp -c keys/otp/"$pass"
-notify-send -t 1000 "mpass" "copied <b>$pass</b>"
+notify-send -t 1000 "mpass" "copied $pass"
diff --git a/config/common/newsraft/feeds b/config/common/newsraft/feeds
new file mode 100644
index 0000000..f4f7030
--- /dev/null
+++ b/config/common/newsraft/feeds
@@ -0,0 +1,38 @@
+@ Hardware
+https://www.youtube.com/feeds/videos.xml?channel_id=UC9PBzalIcEQCsiIkq36PyUA "Digital Foundry"
+https://www.youtube.com/feeds/videos.xml?channel_id=UCI8iQa1hv7oV_Z8D35vVuSg "Hardware Unboxed"
+https://www.youtube.com/feeds/videos.xml?channel_id=UCXuqSBlHAE6Xw-yeJA0Tunw "Linus Tech Tips"
+https://www.youtube.com/feeds/videos.xml?channel_id=UChIs72whgZI9w6d6FhwGGHA "Gamer's Nexus"
+
+@ Top
+https://www.youtube.com/feeds/videos.xml?channel_id=UCaTznQhurW5AaiYPbhEA-KA "Molly Rocket"
+https://www.computerenhance.com/feed "Computer, Enhance!"
+https://xkcd.com/rss.xml
+
+@ Hacking
+https://www.youtube.com/feeds/videos.xml?channel_id=UClcE-kVhqyiHCcjYwcpfj9w "LiveOverflow"
+https://feeds.feedburner.com/TheHackersNews
+
+@ Music
+https://www.youtube.com/feeds/videos.xml?channel_id=UC3vYz1SAtcbRhsatydObGQw "Shijun Wang"
+https://www.youtube.com/feeds/videos.xml?channel_id=UC2q7OXP-mPxHzJerA9tXe7Q "Ashish Xiangyi Kumar"
+
+@ Blogs
+https://arthurmelton.com/blogs.rss "Arthur Melton's blog'"
+
+@ Linux
+https://www.youtube.com/feeds/videos.xml?channel_id=UC-V8FVQCUpRRUPNClviki3w "Luke Smith"
+https://youtube.com/feeds/video.xml?channel_id=UCngn7SVujlvskHRvRKc1cTw "Bugswriter"
+https://youtube.com/feeds/video.xml?channel_id=UCVls1GmFKf6WlTraIb_IaJg "DistroTube"
+
+@ Entertainment
+https://www.youtube.com/feeds/videos.xml?channel_id=UCi8C7TNs2ohrc6hnRQ5Sn2w "Programmers are also human"
+https://www.youtube.com/feeds/videos.xml?channel_id=UCUyeluBRhGPCW4rPe_UvBZQ "The Primagean"
+
+@ VIM
+https://www.youtube.com/feeds/videos.xml?channel_id=UCVk4b-svNJoeytrrlOixebQ "The Vimagean"
+https://www.youtube.com/feeds/videos.xml?channel_id=UCd3dNckv1Za2coSaHGHl5aA "TJ DeVries"
+
+@ News
+https://rss.rtbf.be/article/rss/highlight_rtbf_info.xml?source=internal
+https://news.ycombinator.com/rss
diff --git a/config/common/newsraft/newpipe_subscriptions_202402222357.json b/config/common/newsraft/newpipe_subscriptions_202402222357.json
new file mode 100644
index 0000000..fbb88e7
--- /dev/null
+++ b/config/common/newsraft/newpipe_subscriptions_202402222357.json
@@ -0,0 +1 @@
+{"app_version":"0.25.2","app_version_int":994,"subscriptions":[{"service_id":0,"url":"https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw","name":"3Blue1Brown"},{"service_id":0,"url":"https://www.youtube.com/channel/UC9PBzalIcEQCsiIkq36PyUA","name":"Digital Foundry"},{"service_id":0,"url":"https://www.youtube.com/channel/UChIs72whgZI9w6d6FhwGGHA","name":"Gamers Nexus"},{"service_id":0,"url":"https://www.youtube.com/channel/UCI8iQa1hv7oV_Z8D35vVuSg","name":"Hardware Unboxed"},{"service_id":0,"url":"https://www.youtube.com/channel/UCCuoqzrsHlwv1YyPKLuMDUQ","name":"Jonathan Blow"},{"service_id":0,"url":"https://www.youtube.com/channel/UCXuqSBlHAE6Xw-yeJA0Tunw","name":"Linus Tech Tips"},{"service_id":0,"url":"https://www.youtube.com/channel/UCaTznQhurW5AaiYPbhEA-KA","name":"Molly Rocket"},{"service_id":0,"url":"https://www.youtube.com/channel/UC8ENHE5xdFSwx71u3fDH5Xw","name":"ThePrimeagen"},{"service_id":0,"url":"https://www.youtube.com/channel/UCUyeluBRhGPCW4rPe_UvBZQ","name":"ThePrimeTime"}]} \ No newline at end of file