mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Compare commits
4 Commits
c238e027a2
...
d7553fe27c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7553fe27c | ||
|
|
a7061f79bf | ||
|
|
60866cad50 | ||
|
|
996af9904e |
@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
while ! ping -c 1 9.9.9.9 > /dev/null 2>&1; do sleep 0.5; done
|
while ! ping -c 1 9.9.9.9 > /dev/null 2>&1; do sleep 0.5; done
|
||||||
|
|
||||||
|
# "~/.local/share/channels.txt" looks like below:
|
||||||
|
# Luke Smith=https://www.youtube.com/@LukeSmithxyz/videos
|
||||||
|
# Mental Outlaw=https://www.youtube.com/@MentalOutlaw/videos
|
||||||
|
|
||||||
|
# ~/.local/share/categories.txt looks like below:
|
||||||
|
# Tech=Luke Smith|Mental Outlaw
|
||||||
|
|
||||||
|
INSTALLER="sudo pacman -S --noconfirm"
|
||||||
DATA_DIR="$HOME/.cache/youtube_channels"
|
DATA_DIR="$HOME/.cache/youtube_channels"
|
||||||
CHANNEL_LIST="$HOME/.local/share/channels.txt"
|
CHANNEL_LIST="$HOME/.local/share/channels.txt"
|
||||||
mkdir -p "$DATA_DIR" && touch "$CHANNEL_LIST"
|
mkdir -p "$DATA_DIR" && touch "$CHANNEL_LIST"
|
||||||
@ -15,7 +23,16 @@ error_handling() {
|
|||||||
notify-send "'channels.txt' formatting is wrong."
|
notify-send "'channels.txt' formatting is wrong."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
}
|
for pkg in yt-dlp mpv jq; do
|
||||||
|
command -v "$pkg" >/dev/null || {
|
||||||
|
notify-send "$pkg is not installed. Installing..."
|
||||||
|
$INSTALLER "$pkg" || {
|
||||||
|
notify-send "Failed to install $pkg."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
compare_data() {
|
compare_data() {
|
||||||
local channel_name="$1"
|
local channel_name="$1"
|
||||||
|
|||||||
@ -8,6 +8,11 @@ CUSTOM_LIST_DIR="$DATA_DIR/custom_lists"
|
|||||||
|
|
||||||
mkdir -p "$DATA_DIR" "$DOWNLOAD_DIR" "$CUSTOM_LIST_DIR"
|
mkdir -p "$DATA_DIR" "$DOWNLOAD_DIR" "$CUSTOM_LIST_DIR"
|
||||||
|
|
||||||
|
[ "$(find "$DATA_DIR" -maxdepth 1 -type f -name "*.tsv" 2>/dev/null)" ] || {
|
||||||
|
notify-send "You need to run "channelrefresh" script first."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
DMENU() {
|
DMENU() {
|
||||||
dmenu -i -l $1 -p "$2"
|
dmenu -i -l $1 -p "$2"
|
||||||
}
|
}
|
||||||
@ -64,7 +69,7 @@ custom_list_menu() {
|
|||||||
[ -z "$list" ] && return
|
[ -z "$list" ] && return
|
||||||
case "$list" in
|
case "$list" in
|
||||||
*CREATE*)
|
*CREATE*)
|
||||||
new_list=$(DMENU 0 "Enter the name of the new list")
|
new_list=$(echo "" | DMENU 0 "Enter the name of the new list")
|
||||||
[ -n "$new_list" ] && touch "$CUSTOM_LIST_DIR/$new_list"
|
[ -n "$new_list" ] && touch "$CUSTOM_LIST_DIR/$new_list"
|
||||||
;;
|
;;
|
||||||
*DELETE*)
|
*DELETE*)
|
||||||
Loading…
x
Reference in New Issue
Block a user