commit 1bd8d070c3d650d1fb3b4a159402c6f0444e13aa
parent e98b77194781526f2a726e23e6638fe109809800
Author: regexghost <dev@regexghost.com>
Date: Thu, 28 May 2026 13:29:16 +0100
newsraft additions and other changes
Diffstat:
11 files changed, 79 insertions(+), 6 deletions(-)
diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc
@@ -66,6 +66,13 @@ alias rss='newsraft'
alias trash-size='du ~/.local/share/Trash/files/ -s -h | cut -f 1'
alias sync='echo "Syncing"; sync; echo "Done"; lsblk'
+function nnn () {
+ export NNN_FIFO=/tmp/nnn.fifo
+ export NNN_PLUG=v:preview-tui
+ tmux new-session -d -s mys "nnn -P v"
+ tmux attach
+}
+
# Aliases to Specific Commands
alias x='chmod +x'
@@ -88,7 +95,7 @@ alias gitd='git diff'
alias gitdc='git diff --word-diff-regex=.'
alias gits='git status'
alias gpl='git pull'
-alias gitl='git log --reverse'
+alias gitl='git log'
alias giturl='git config --get remote.origin.url'
alias gp='git push'
@@ -102,7 +109,7 @@ function gpp () {
function gpa () {
gpp
git push -u codeberg
- git push -u selfhost
+ git push -u mine
}
#### Start Substitute - Package_Manager
@@ -258,7 +265,7 @@ do_yt-dlp () {
shift
;;
--music)
- output_format_args=(-o "%(title)s - %(channel)s - %(album)s.%(ext)s")
+ output_format_args=(-o "%(title)s -- %(channel)s -- %(album)s.%(ext)s")
format_args=(-f 140)
shift
;;
diff --git a/dotfiles/.config/newsraft/config b/dotfiles/.config/newsraft/config
@@ -0,0 +1,3 @@
+bind g exec-silent '~/.config/newsraft/show-image.sh "%l"'
+bind f exec-silent '~/.config/newsraft/queue-vid.sh "%l"'
+bind t exec 'w3m "%l"'
diff --git a/dotfiles/.config/newsraft/extract-thumbnail.sh b/dotfiles/.config/newsraft/extract-thumbnail.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+URL="$1"
+OUTPUT_FILENAME="${2:-/tmp/youtube_thumbnail.webp}"
+
+video_id=$(echo $URL | sed 's/.*[?]v=//g')
+if echo "$video_id" | grep -q "www."; then
+ video_id=$(echo "$URL" | sed 's/.*\/shorts\///g')
+fi
+echo $video_id
+wget "https://i.ytimg.com/vi_webp/${video_id}/maxresdefault.webp" -P /tmp
+mv /tmp/maxresdefault.webp "$OUTPUT_FILENAME"
diff --git a/dotfiles/.config/newsraft/queue-vid.sh b/dotfiles/.config/newsraft/queue-vid.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+LOC="${HOME}/Videos/YouTube/toDownload"
+[ -d "$LOC" ] || mkdir -p "$LOC"
+[ -d "$LOC/Shorts" ] || mkdir "$LOC/Shorts"
+[ -d "$LOC/Videos" ] || mkdir "$LOC/Videos"
+
+if echo "$1" | grep -q "youtube.com/watch"; then
+ id="$(echo "$1" | sed -nE 's/.*=(.*)/\1/p')"
+ yt-data "$1" > "${LOC}/Videos/${id}.txt"
+elif echo "$1" | grep -q "youtube.com/shorts"; then
+ id="$(echo "$1" | sed -nE 's/.*\/(.*)/\1/p')"
+ yt-data "$1" > "${LOC}/Shorts/${id}.txt"
+fi
diff --git a/dotfiles/.config/newsraft/rssify.sh b/dotfiles/.config/newsraft/rssify.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+for arg; do
+ id="$(yt-dlp --flat-playlist -J --playlist-end 1 "$arg" | jq -r .channel_id)"
+ echo https://www.youtube.com/feeds/videos.xml?channel_id="${id}"
+done
diff --git a/dotfiles/.config/newsraft/show-image.sh b/dotfiles/.config/newsraft/show-image.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if echo "$1" | grep -q "youtube"; then
+ ~/.config/newsraft/extract-thumbnail.sh "$1"
+ feh /tmp/youtube_thumbnail.webp
+ rm -f /tmp/youtube_thumbnail.webp
+ rm -f /tmp/maxresdefault.webp
+elif echo "$1" | grep -q "redd.it"; then
+ filename="$(echo "$1" | sed 's/.*\///g')"
+ wget -P /tmp "$1"
+ feh "/tmp/${filename}"
+ rm -rf "/tmp/${filename}"
+fi
diff --git a/dotfiles/.xinitrc b/dotfiles/.xinitrc
@@ -14,5 +14,13 @@ setxkbmap -option caps:escape
# lemonbar
(sleep 10 && ~/.local/share/regexghost/panel/lemonbar-runner.sh) & disown
+# Wallpaper
+(sleep 8 && feh --bg-fill --no-fehbg ~/.config/regexghost/background.jpg) & disown
+
+# Compositor
+(sleep 6 && xcompmgr -n) & disown
+
# Window manger
exec jwm 2> ~/.cache/xsession-errors
+# exec awesome 2> ~/.cache/xsession-errors
+# exec i3 2> ~/.cache/xsession-errors
diff --git a/lists/dotfiles b/lists/dotfiles
@@ -26,3 +26,8 @@
~/.xinitrc
~/.vimrc
~/.config/dunst/dunstrc
+~/.config/newsraft/config
+~/.config/newsraft/queue-vid.sh
+~/.config/newsraft/extract-thumbnail.sh
+~/.config/newsraft/rssify.sh
+~/.config/newsraft/show-image.sh
diff --git a/panel-scripts/metoffice.sh b/panel-scripts/metoffice.sh
@@ -13,7 +13,7 @@ today_string="$(date "+%Y-%m-%d")"
tomorrow_string="$(date -d tomorrow "+%Y-%m-%d")"
second_day_string="$(date -d "+2 days" "+%Y-%m-%d")"
-curl -s -L "https://weather.metoffice.gov.uk/forecast/$geohash" > "/tmp/panel_i3_data/metoffice.html"
+curl --connect-timeout 5 -s -L "https://weather.metoffice.gov.uk/forecast/$geohash" > "/tmp/panel_i3_data/metoffice.html"
icon_name_today=$(cat "/tmp/panel_i3_data/metoffice.html" | grep -A 5 -B 5 -i "datetime=\"$today_string\"" | grep "class=\"tab-icon\"" | sed 's/;" class.*//g' | sed 's/.*alt="//g')
icon_name_tomorrow=$(cat "/tmp/panel_i3_data/metoffice.html" | grep -A 5 -B 5 -i "datetime=\"$tomorrow_string\"" | grep "class=\"tab-icon\"" | sed 's/;" class.*//g' | sed 's/.*alt="//g')
icon_name_second_day=$(cat "/tmp/panel_i3_data/metoffice.html" | grep -A 5 -B 5 -i "datetime=\"$second_day_string\"" | grep "class=\"tab-icon\"" | sed 's/;" class.*//g' | sed 's/.*alt="//g')
diff --git a/panel-scripts/sunrise.sh b/panel-scripts/sunrise.sh
@@ -23,7 +23,7 @@ fi
if [[ "$1" == "--sunrise" ]]; then
#json_tomorrow=$(curl -s "https://api.sunrisesunset.io/json?lat=${lat}&lng=${lon}&date=tomorrow&time_format=24")
- json_tomorrow=$(curl -s "https://api.sunrise-sunset.org/json?lat=${lat}&lng=${lon}&date=tomorrow&formatted=0")
+ json_tomorrow=$(curl --connect-timeout 5 -s "https://api.sunrise-sunset.org/json?lat=${lat}&lng=${lon}&date=tomorrow&formatted=0")
sunrise=$(echo "$json_tomorrow" | jq -r .results.sunrise | sed 's/.*T//g' | sed 's/:[0-9]*+.*//g')
astro_twilight=$(echo "$json_tomorrow" | jq -r .results.astronomical_twilight_begin | sed 's/.*T//g' | sed 's/:[0-9]*+.*//g')
if [[ "$2" == "--conky" ]]; then
@@ -35,7 +35,7 @@ if [[ "$1" == "--sunrise" ]]; then
fi
elif [[ "$1" == "--sunset" ]]; then
#json_today=$(curl -s "https://api.sunrisesunset.io/json?lat=${lat}&lng=${lon}&time_format=24")
- json_today=$(curl -s "https://api.sunrise-sunset.org/json?lat=${lat}&lng=${lon}&date=today&formatted=0")
+ json_today=$(curl --connect-timeout 5 -s "https://api.sunrise-sunset.org/json?lat=${lat}&lng=${lon}&date=today&formatted=0")
sunset=$(echo "$json_today" | jq -r .results.sunset | sed 's/.*T//g' | sed 's/:[0-9]*+.*//g')
astro_twilight=$(echo "$json_today" | jq -r .results.astronomical_twilight_end | sed 's/.*T//g' | sed 's/:[0-9]*+.*//g')
if [[ "$2" == "--conky" ]]; then
diff --git a/terminal-scripts/Makefile b/terminal-scripts/Makefile
@@ -1,4 +1,5 @@
BIN="${HOME}/.local/bin"
+TERMINAL="${XDG_DATA_HOME}/regexghost/terminal"
normal:
mkdir -p ${BIN}
@@ -16,3 +17,7 @@ normal:
go build -o geohash geohash.go
mv geohash ${BIN}/geohash
cd soundboard/; go1.26.2 build -o soundboard soundboard.go; mv soundboard ${BIN}/soundboard; cd ..
+ cp tag-song.sh ${BIN}/tag-song
+ cp download-vids.sh ${BIN}/download-vids
+ cp yt-data.sh ${BIN}/yt-data
+ cp tag-music.py ${TERMINAL}/tag-music.py