deleted double entries
This commit is contained in:
@@ -1,87 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
SHADER_DIR="$HOME/.config/hypr/shaders"
|
||||
SHADER_FILE="$SHADER_DIR/brightness.frag"
|
||||
|
||||
# Ensure shader directory exists
|
||||
mkdir -p "$SHADER_DIR"
|
||||
|
||||
# Get screen brightness level
|
||||
echo "Enter screen brightness level (0-10, where 10 = 100%):"
|
||||
read -r LEVEL
|
||||
|
||||
# Validate input
|
||||
if ! [[ "$LEVEL" =~ ^[0-9]+$ ]] || [ "$LEVEL" -lt 0 ] || [ "$LEVEL" -gt 10 ]; then
|
||||
echo "Invalid input. Please enter a number between 0 and 10."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Convert to decimal (0-10 -> 0.0-1.0)
|
||||
BRIGHTNESS=$(echo "scale=2; $LEVEL / 10" | bc)
|
||||
|
||||
# Ask about keyboard backlight
|
||||
echo "Adjust keyboard backlight? (y/n):"
|
||||
read -r KBD_ADJUST
|
||||
|
||||
if [[ "$KBD_ADJUST" == "y" || "$KBD_ADJUST" == "Y" ]]; then
|
||||
echo "Enter keyboard backlight level (0-10, where 10 = 100%):"
|
||||
read -r KBD_LEVEL
|
||||
|
||||
# Validate keyboard input
|
||||
if ! [[ "$KBD_LEVEL" =~ ^[0-9]+$ ]] || [ "$KBD_LEVEL" -lt 0 ] || [ "$KBD_LEVEL" -gt 10 ]; then
|
||||
echo "Invalid input. Please enter a number between 0 and 10."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Convert to percentage (0-10 -> 0-100)
|
||||
KBD_PERCENT=$((KBD_LEVEL * 10))
|
||||
|
||||
# Set keyboard backlight
|
||||
kbdlight set $KBD_PERCENT
|
||||
echo "Keyboard backlight set to ${KBD_PERCENT}%"
|
||||
fi
|
||||
|
||||
# Ask about blue light filter
|
||||
echo "Apply blue light filter? (y/n):"
|
||||
read -r BLUELIGHT
|
||||
|
||||
# Create shader based on choice
|
||||
cat > "$SHADER_FILE" << EOF
|
||||
#version 300 es
|
||||
|
||||
precision mediump float;
|
||||
|
||||
in vec2 v_texcoord;
|
||||
out vec4 fragColor;
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main() {
|
||||
vec4 pixColor = texture(tex, v_texcoord);
|
||||
|
||||
EOF
|
||||
|
||||
if [[ "$BLUELIGHT" == "y" || "$BLUELIGHT" == "Y" ]]; then
|
||||
cat >> "$SHADER_FILE" << EOF
|
||||
// Reduce blue light
|
||||
pixColor.r *= 1.0;
|
||||
pixColor.g *= 0.85;
|
||||
pixColor.b *= 0.65;
|
||||
|
||||
EOF
|
||||
fi
|
||||
|
||||
cat >> "$SHADER_FILE" << EOF
|
||||
// Adjust brightness
|
||||
pixColor.rgb *= $BRIGHTNESS;
|
||||
|
||||
fragColor = pixColor;
|
||||
}
|
||||
EOF
|
||||
|
||||
# Apply shader
|
||||
if [ -z "$HYPRLAND_INSTANCE_SIGNATURE" ]; then
|
||||
export HYPRLAND_INSTANCE_SIGNATURE=$(ls -t /tmp/hypr/ 2>/dev/null | head -n1)
|
||||
fi
|
||||
/usr/bin/hyprctl keyword decoration:screen_shader "$SHADER_FILE"
|
||||
|
||||
echo "Screen brightness set to ${LEVEL}0% $([ "$BLUELIGHT" == "y" ] || [ "$BLUELIGHT" == "Y" ] && echo "with blue light filter")"
|
||||
-107
@@ -1,107 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ask where to place the MP3 files
|
||||
read -p "Place MP3s in same folder as MP4s? (y/n) [y]: " same_folder
|
||||
same_folder=${same_folder:-y}
|
||||
|
||||
if [[ "$same_folder" =~ ^[Nn]$ ]]; then
|
||||
read -p "Enter output folder path: " output_folder
|
||||
mkdir -p "$output_folder"
|
||||
else
|
||||
output_folder=""
|
||||
fi
|
||||
|
||||
# Get default values from folder structure
|
||||
# Current directory is "The Energies of Love"
|
||||
default_album=$(basename "$PWD")
|
||||
# Parent directory is "Donna Eden & David Feinstein"
|
||||
default_album_artist=$(basename "$(dirname "$PWD")")
|
||||
|
||||
# Prompt for metadata with defaults
|
||||
read -p "Enter Album Artist [$default_album_artist]: " album_artist
|
||||
album_artist=${album_artist:-$default_album_artist}
|
||||
|
||||
read -p "Enter Release Date (YYYY): " release_date
|
||||
|
||||
echo ""
|
||||
echo "Processing MP4 files..."
|
||||
echo "Album Artist: $album_artist"
|
||||
echo ""
|
||||
|
||||
counter=0
|
||||
|
||||
# Process all mp4 files in subdirectories
|
||||
for file in */*.mp4 *.mp4; do
|
||||
# Skip if file doesn't exist
|
||||
[ -e "$file" ] || continue
|
||||
|
||||
dir=$(dirname "$file")
|
||||
filename=$(basename "$file" .mp4)
|
||||
|
||||
# Determine album based on folder structure
|
||||
if [ "$dir" != "." ]; then
|
||||
# File is in subfolder (Intro, week1, week2, etc.)
|
||||
album=$(basename "$dir")
|
||||
else
|
||||
# File is in current directory
|
||||
album="$default_album"
|
||||
fi
|
||||
|
||||
# Set output location
|
||||
if [ -n "$output_folder" ]; then
|
||||
# Create matching folder structure in output folder
|
||||
if [ "$dir" != "." ]; then
|
||||
mkdir -p "$output_folder/$dir"
|
||||
output="$output_folder/$dir/${filename}.mp3"
|
||||
else
|
||||
output="$output_folder/${filename}.mp3"
|
||||
fi
|
||||
else
|
||||
output="$dir/${filename}.mp3"
|
||||
fi
|
||||
|
||||
# Skip if already exists
|
||||
if [ -f "$output" ]; then
|
||||
echo "Skip: $filename (exists)"
|
||||
continue
|
||||
fi
|
||||
|
||||
# Get track number
|
||||
track_num=$(echo "$filename" | grep -oP '^\d+')
|
||||
|
||||
echo "Converting: $filename"
|
||||
echo " Album: $album"
|
||||
|
||||
# Convert using temp file
|
||||
temp_file="/tmp/convert_$$.mp3"
|
||||
|
||||
if [ -n "$track_num" ]; then
|
||||
ffmpeg -i "$file" -vn -acodec libmp3lame -q:a 0 \
|
||||
-metadata title="$filename" \
|
||||
-metadata track="$track_num" \
|
||||
-metadata album_artist="$album_artist" \
|
||||
-metadata artist="$album_artist" \
|
||||
-metadata album="$album" \
|
||||
-metadata date="$release_date" \
|
||||
"$temp_file" -y >/dev/null 2>&1
|
||||
else
|
||||
ffmpeg -i "$file" -vn -acodec libmp3lame -q:a 0 \
|
||||
-metadata title="$filename" \
|
||||
-metadata album_artist="$album_artist" \
|
||||
-metadata artist="$album_artist" \
|
||||
-metadata album="$album" \
|
||||
-metadata date="$release_date" \
|
||||
"$temp_file" -y >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [ -f "$temp_file" ]; then
|
||||
mv "$temp_file" "$output"
|
||||
echo " ✓ Done"
|
||||
((counter++))
|
||||
else
|
||||
echo " ✗ Failed"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Converted $counter files"
|
||||
@@ -1,92 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# --- CONFIGURATION ---
|
||||
# The user that runs paru inside the Arch LXCs
|
||||
AUR_USER="liph"
|
||||
|
||||
# 1. EXCLUDE LIST: Put CTIDs here that you want the script to TOTALLY ignore
|
||||
# Example: EXCLUDE_LIST=( 105 110 )
|
||||
EXCLUDE_LIST=(106 113 114 115 116)
|
||||
|
||||
declare -A CONTAINER_MAP
|
||||
CONTAINER_MAP[100]="/mnt/flash1/podman/lxc_servarr/"
|
||||
CONTAINER_MAP[101]="/mnt/flash1/podman/lxc_second/"
|
||||
CONTAINER_MAP[108]="/mnt/flash1/podman/lxc_dns/" # Multiple paths allowed
|
||||
CONTAINER_MAP[109]="/mnt/flash1/podman/lxc_immich/"
|
||||
CONTAINER_MAP[111]="/mnt/flash1/podman/lxc_ollama/"
|
||||
|
||||
ALL_CTIDS=$(pct list | awk 'NR>1 {print $1}')
|
||||
|
||||
for CTID in $ALL_CTIDS; do
|
||||
if [[ " ${EXCLUDE_LIST[@]} " =~ " ${CTID} " ]]; then continue; fi
|
||||
if pct config $CTID | grep -q "template: 1"; then continue; fi
|
||||
|
||||
NAME=$(pct config $CTID | grep "hostname:" | awk '{print $2}')
|
||||
STATUS=$(pct status $CTID | awk '{print $2}')
|
||||
|
||||
echo "======================================================="
|
||||
echo " PROCESSING LXC: $NAME (ID: $CTID)"
|
||||
echo "======================================================="
|
||||
|
||||
WAS_STOPPED=false
|
||||
if [ "$STATUS" == "stopped" ]; then
|
||||
pct start $CTID
|
||||
sleep 10
|
||||
WAS_STOPPED=true
|
||||
fi
|
||||
|
||||
# 1. OS UPDATER (Handling Paru correctly)
|
||||
echo "[+] Updating Arch packages..."
|
||||
# We use -Syu. We run it via 'sudo -u user' but because pct exec is root,
|
||||
# it won't ask for a password.
|
||||
pct exec $CTID -- sudo -u $AUR_USER paru -Syu --noconfirm --cleanafter
|
||||
|
||||
# 2. PODMAN SCAN & AUTO-DETECT COMMAND
|
||||
if [[ -n "${CONTAINER_MAP[$CTID]}" ]]; then
|
||||
ROOT_DIR=${CONTAINER_MAP[$CTID]}
|
||||
|
||||
# Detect which command works: 'podman compose' (V2) or 'podman-compose' (Python)
|
||||
# We test this inside the LXC
|
||||
if pct exec $CTID -- podman compose version >/dev/null 2>&1; then
|
||||
FINAL_CMD="podman compose"
|
||||
elif pct exec $CTID -- podman-compose version >/dev/null 2>&1; then
|
||||
FINAL_CMD="podman-compose"
|
||||
elif pct exec $CTID -- docker-compose version >/dev/null 2>&1; then
|
||||
FINAL_CMD="docker-compose"
|
||||
else
|
||||
FINAL_CMD=""
|
||||
fi
|
||||
|
||||
if [ -z "$FINAL_CMD" ]; then
|
||||
echo "[ERROR] No compose command found in LXC $CTID!"
|
||||
else
|
||||
echo "[#] Using command: $FINAL_CMD"
|
||||
COMPOSE_FILES=$(pct exec $CTID -- find "$ROOT_DIR" -maxdepth 2 -name "docker-compose.y*ml")
|
||||
|
||||
for FILE in $COMPOSE_FILES; do
|
||||
DIR=$(dirname "$FILE")
|
||||
echo " -> Updating: $DIR"
|
||||
|
||||
# Run the pull and up
|
||||
# Note: No 'sudo' here because pct exec is already root full
|
||||
pct exec $CTID -- bash -c "cd $DIR && $FINAL_CMD pull"
|
||||
|
||||
if [ "$WAS_STOPPED" = false ]; then
|
||||
pct exec $CTID -- bash -c "cd $DIR && $FINAL_CMD up -d"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo "[+] Pruning images..."
|
||||
pct exec $CTID -- podman image prune -f
|
||||
fi
|
||||
|
||||
# 3. MAINTENANCE
|
||||
pct exec $CTID -- journalctl --rotate
|
||||
pct exec $CTID -- journalctl --vacuum-time=7d
|
||||
pct exec $CTID -- bash -c 'orphans=$(pacman -Qtdq); if [ -n "$orphans" ]; then pacman -Rns $orphans --noconfirm; fi'
|
||||
|
||||
if [ "$WAS_STOPPED" = true ]; then
|
||||
pct shutdown $CTID
|
||||
fi
|
||||
done
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ask for the final filename first
|
||||
echo "=== Video Downloader (yt-dlp + aria2c) ==="
|
||||
read -p "Enter the final filename (without extension): " filename
|
||||
|
||||
# Then ask for the m3u8 URL
|
||||
read -p "Enter the m3u8 URL: " url
|
||||
|
||||
# Download using yt-dlp with aria2c
|
||||
echo "Starting download..."
|
||||
yt-dlp --external-downloader aria2c \
|
||||
--external-downloader-args "aria2c:-x 16 -s 16" \
|
||||
-o "${filename}.%(ext)s" \
|
||||
"$url"
|
||||
|
||||
echo "Download complete: ${filename}.mp4"
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get the current message's notmuch ID from aerc's environment
|
||||
# We'll use notmuch to find and move the file
|
||||
|
||||
maildir="$HOME/.local/share/mail"
|
||||
|
||||
# Find files for messages in current thread that aren't already in Trash
|
||||
notmuch search --output=files thread:{} 2>/dev/null | while read filepath; do
|
||||
# Skip if already in Trash
|
||||
if [[ "$filepath" == *"/Trash/"* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ -f "$filepath" ]]; then
|
||||
filename=$(basename "$filepath")
|
||||
mkdir -p "$maildir/Trash/cur"
|
||||
mv "$filepath" "$maildir/Trash/cur/$filename"
|
||||
fi
|
||||
done
|
||||
|
||||
# Re-index
|
||||
notmuch new >/dev/null 2>&1
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Read the message file path from aerc
|
||||
while read -r filepath; do
|
||||
# Get the base mail directory
|
||||
maildir="$HOME/.local/share/mail"
|
||||
|
||||
# Extract the filename
|
||||
filename=$(basename "$filepath")
|
||||
|
||||
# Create Trash/cur if it doesn't exist
|
||||
mkdir -p "$maildir/Trash/cur"
|
||||
|
||||
# Move the file to Trash
|
||||
if [[ -f "$filepath" ]]; then
|
||||
mv "$filepath" "$maildir/Trash/cur/$filename"
|
||||
echo "Moved to Trash: $filename" >&2
|
||||
fi
|
||||
done
|
||||
|
||||
# Re-index with notmuch
|
||||
notmuch new >/dev/null 2>&1
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
MBSYNC=$(pgrep mbsync)
|
||||
NOTMUCH=$(pgrep notmuch)
|
||||
|
||||
if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then
|
||||
echo "Already running one instance of mbsync or notmuch. Exiting..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Deleting messages tagged as *deleted*"
|
||||
notmuch search --format=text0 --output=files tag:deleted | xargs -0 --no-run-if-empty rm -v
|
||||
|
||||
mbsync -Va
|
||||
notmuch new
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
STATE_FILE="$HOME/.cache/brightness_state"
|
||||
TEMP_FILE="$HOME/.cache/bluelight_state"
|
||||
|
||||
CURRENT=$(cat "$TEMP_FILE" 2>/dev/null || echo "6500")
|
||||
BRIGHTNESS=$(cat "$STATE_FILE" 2>/dev/null || echo "1.0")
|
||||
|
||||
if [ "$CURRENT" = "6500" ]; then
|
||||
NEW=3400
|
||||
MSG="ON"
|
||||
else
|
||||
NEW=6500
|
||||
MSG="OFF"
|
||||
fi
|
||||
|
||||
pkill -9 gammastep
|
||||
gammastep -O $NEW -b "$BRIGHTNESS" &>/dev/null &
|
||||
|
||||
echo "$NEW" >"$TEMP_FILE"
|
||||
notify-send "Blue Light" "$MSG" -t 1000
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
STATE_FILE="$HOME/.cache/brightness_state"
|
||||
TEMP_FILE="$HOME/.cache/bluelight_state"
|
||||
|
||||
CURRENT=$(cat "$STATE_FILE" 2>/dev/null || echo "1.0")
|
||||
NEW=$(echo "$CURRENT - 0.1" | bc -l)
|
||||
if (($(echo "$NEW < 0.3" | bc -l))); then NEW=0.3; fi
|
||||
|
||||
TEMP=$(cat "$TEMP_FILE" 2>/dev/null || echo "6500")
|
||||
|
||||
pkill -9 gammastep
|
||||
gammastep -O $TEMP -b "$NEW" &>/dev/null &
|
||||
|
||||
echo "$NEW" >"$STATE_FILE"
|
||||
notify-send "Brightness" "$(printf '%.0f%%' $(echo "$NEW * 100" | bc))" -t 1000
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
STATE_FILE="$HOME/.cache/brightness_state"
|
||||
TEMP_FILE="$HOME/.cache/bluelight_state"
|
||||
|
||||
TEMP=$(cat "$TEMP_FILE" 2>/dev/null || echo "6500")
|
||||
|
||||
pkill -9 gammastep
|
||||
gammastep -O $TEMP -b 1.0 &>/dev/null &
|
||||
|
||||
echo "1.0" >"$STATE_FILE"
|
||||
notify-send "Brightness" "100%" -t 1000
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
STATE_FILE="$HOME/.cache/brightness_state"
|
||||
TEMP_FILE="$HOME/.cache/bluelight_state"
|
||||
|
||||
CURRENT=$(cat "$STATE_FILE" 2>/dev/null || echo "1.0")
|
||||
NEW=$(echo "$CURRENT + 0.1" | bc -l)
|
||||
if (($(echo "$NEW > 1.0" | bc -l))); then
|
||||
NEW=1.0
|
||||
notify-send "Brightness" "Maximum (100%)" -t 1000
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TEMP=$(cat "$TEMP_FILE" 2>/dev/null || echo "6500")
|
||||
|
||||
pkill -9 gammastep
|
||||
gammastep -O $TEMP -b "$NEW" &>/dev/null &
|
||||
|
||||
echo "$NEW" >"$STATE_FILE"
|
||||
notify-send "Brightness" "$(printf '%.0f%%' $(echo "$NEW * 100" | bc))" -t 1000
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Removing numbers from filenames and titles (keeping track numbers)..."
|
||||
echo ""
|
||||
|
||||
for file in *.mp3; do
|
||||
filename="${file%.*}"
|
||||
|
||||
# Extract track number before removing it from filename
|
||||
track_num=$(echo "$filename" | grep -oP '^\d+')
|
||||
|
||||
# Remove leading numbers and dot/space from filename
|
||||
new_filename=$(echo "$filename" | sed 's/^[0-9]\+[. ]\+//')
|
||||
new_file="${new_filename}.mp3"
|
||||
|
||||
if [ "$file" != "$new_file" ]; then
|
||||
echo "Processing: $file"
|
||||
echo " New filename: $new_file"
|
||||
echo " New title: $new_filename"
|
||||
echo " Track number: $track_num (kept)"
|
||||
|
||||
# Retag with new title (without number) but keep track number
|
||||
ffmpeg -i "$file" -c copy \
|
||||
-metadata title="$new_filename" \
|
||||
-metadata track="$track_num" \
|
||||
"${new_filename}_temp.mp3" 2>/dev/null
|
||||
|
||||
# Remove original and rename temp file
|
||||
rm "$file"
|
||||
mv "${new_filename}_temp.mp3" "$new_file"
|
||||
|
||||
echo " ✓ Done"
|
||||
echo ""
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Complete! All files processed."
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Removing thumbnails and associated CDs from MP3 files..."
|
||||
echo ""
|
||||
|
||||
counter=0
|
||||
|
||||
# Process all mp3 files
|
||||
for file in *.mp3 */*.mp3 */*/*.mp3; do
|
||||
# Skip if file doesn't exist
|
||||
[ -e "$file" ] || continue
|
||||
|
||||
filename=$(basename "$file")
|
||||
|
||||
echo "Processing: $file"
|
||||
|
||||
# Create temp file
|
||||
temp_file="/tmp/strip_${counter}_$$.mp3"
|
||||
|
||||
# Remove all images/artwork and strip video streams
|
||||
ffmpeg -i "$file" \
|
||||
-map 0:a \
|
||||
-c copy \
|
||||
-map_metadata 0 \
|
||||
-id3v2_version 3 \
|
||||
-vn \
|
||||
"$temp_file" -y >/dev/null 2>&1
|
||||
|
||||
if [ -f "$temp_file" ] && [ -s "$temp_file" ]; then
|
||||
# Remove disc number metadata using eyeD3 if available
|
||||
if command -v eyeD3 &> /dev/null; then
|
||||
eyeD3 --remove-images \
|
||||
--disc-num "" \
|
||||
"$temp_file" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
mv "$temp_file" "$file"
|
||||
echo " ✓ Done"
|
||||
((counter++))
|
||||
else
|
||||
echo " ✗ Failed"
|
||||
[ -f "$temp_file" ] && rm "$temp_file"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Processed $counter files"
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo chown -R 101000:100033 /mnt/{hdd1,hdd2,hdd3,hdd4,hdd5,ssd1,ssd2}
|
||||
|
||||
sudo chmod -R 775 /mnt/{hdd1,hdd2,hdd3,hdd4,hdd5,ssd1,ssd2}
|
||||
|
||||
sudo chown -R 101000:101000 /mnt/tank/audio
|
||||
sudo chmod -R 777 /mnt/tank/audio
|
||||
|
||||
sudo chown -R 101000:101000 /mnt/flash1/downloads/music
|
||||
sudo chmod -R 755 /mnt/flash1/downloads/music
|
||||
|
||||
sudo chown -R 101000:100033 /mnt/ssd2/cloud_phil /mnt/flash1/podman/browser/data/.consume
|
||||
sudo chmod -R 775 /mnt/ssd2/cloud_phil /mnt/flash1/podman/browser/data/.consume
|
||||
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get metadata from first mp3 file if it exists
|
||||
first_file=$(ls *.mp3 2>/dev/null | head -n 1)
|
||||
|
||||
if [ -n "$first_file" ]; then
|
||||
default_artist=$(ffprobe -v quiet -show_entries format_tags=artist -of default=noprint_wrappers=1:nokey=1 "$first_file")
|
||||
default_album=$(ffprobe -v quiet -show_entries format_tags=album -of default=noprint_wrappers=1:nokey=1 "$first_file")
|
||||
default_date=$(ffprobe -v quiet -show_entries format_tags=date -of default=noprint_wrappers=1:nokey=1 "$first_file")
|
||||
default_composer=$(ffprobe -v quiet -show_entries format_tags=composer -of default=noprint_wrappers=1:nokey=1 "$first_file")
|
||||
fi
|
||||
|
||||
# Prompt with defaults
|
||||
read -p "Enter Album Artist [$default_artist]: " album_artist
|
||||
album_artist=${album_artist:-$default_artist}
|
||||
|
||||
read -p "Enter Album [$default_album]: " album
|
||||
album=${album:-$default_album}
|
||||
|
||||
read -p "Enter Release Date (YYYY or YYYY-MM-DD) [$default_date]: " release_date
|
||||
release_date=${release_date:-$default_date}
|
||||
|
||||
read -p "Enter Composer [$default_composer]: " composer
|
||||
composer=${composer:-$default_composer}
|
||||
|
||||
echo ""
|
||||
echo "Retagging files..."
|
||||
echo "Album Artist: $album_artist"
|
||||
echo "Album: $album"
|
||||
echo "Release Date: $release_date"
|
||||
echo "Composer: $composer"
|
||||
echo ""
|
||||
|
||||
for file in *.mp3; do
|
||||
filename="${file%.*}"
|
||||
track_num=$(echo "$filename" | grep -oP '^\d+')
|
||||
|
||||
echo "Retagging: $file (Track $track_num)"
|
||||
|
||||
if [ -n "$composer" ]; then
|
||||
ffmpeg -i "$file" -c copy \
|
||||
-metadata title="$filename" \
|
||||
-metadata track="$track_num" \
|
||||
-metadata album_artist="$album_artist" \
|
||||
-metadata artist="$album_artist" \
|
||||
-metadata album="$album" \
|
||||
-metadata date="$release_date" \
|
||||
-metadata composer="$composer" \
|
||||
-metadata disc="" \
|
||||
-metadata discnumber="" \
|
||||
-metadata totaldiscs="" \
|
||||
-metadata disk="" \
|
||||
-metadata disknumber="" \
|
||||
"${filename}_temp.mp3" 2>/dev/null
|
||||
else
|
||||
ffmpeg -i "$file" -c copy \
|
||||
-metadata title="$filename" \
|
||||
-metadata track="$track_num" \
|
||||
-metadata album_artist="$album_artist" \
|
||||
-metadata artist="$album_artist" \
|
||||
-metadata album="$album" \
|
||||
-metadata date="$release_date" \
|
||||
-metadata composer="" \
|
||||
-metadata disc="" \
|
||||
-metadata discnumber="" \
|
||||
-metadata totaldiscs="" \
|
||||
-metadata disk="" \
|
||||
-metadata disknumber="" \
|
||||
"${filename}_temp.mp3" 2>/dev/null
|
||||
fi
|
||||
|
||||
mv "${filename}_temp.mp3" "$file"
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Done! All files retagged."
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Handle Ctrl+C gracefully
|
||||
trap ctrl_c INT
|
||||
|
||||
function ctrl_c() {
|
||||
echo ""
|
||||
echo "Cancelled by user."
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Function to read input with tab completion for paths
|
||||
read_path() {
|
||||
local prompt="$1"
|
||||
local input
|
||||
|
||||
# Use read with -e flag for readline editing (enables tab completion)
|
||||
read -e -p "$prompt" input
|
||||
echo "$input"
|
||||
}
|
||||
|
||||
# Get source folder
|
||||
SOURCE=$(read_path "Enter source folder path: ")
|
||||
|
||||
# Validate source exists
|
||||
if [ ! -d "$SOURCE" ]; then
|
||||
echo "Error: Source folder '$SOURCE' does not exist!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get destination folders
|
||||
echo "Enter destination folders (one per line, empty line to finish):"
|
||||
echo "(Tip: Use TAB for folder completion, Ctrl+C to cancel)"
|
||||
DESTINATIONS=()
|
||||
while true; do
|
||||
dest=$(read_path "Destination $((${#DESTINATIONS[@]} + 1)): ")
|
||||
if [ -z "$dest" ]; then
|
||||
break
|
||||
fi
|
||||
# Create destination if it doesn't exist
|
||||
if [ ! -d "$dest" ]; then
|
||||
read -p "Destination '$dest' doesn't exist. Create it? (y/n): " create
|
||||
if [ "$create" = "y" ]; then
|
||||
mkdir -p "$dest"
|
||||
else
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
DESTINATIONS+=("$dest")
|
||||
done
|
||||
|
||||
# Validate we have destinations
|
||||
if [ ${#DESTINATIONS[@]} -eq 0 ]; then
|
||||
echo "Error: No destination folders provided!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Display summary
|
||||
echo ""
|
||||
echo "=== Summary ==="
|
||||
echo "Source: $SOURCE"
|
||||
echo "Destinations:"
|
||||
for i in "${!DESTINATIONS[@]}"; do
|
||||
echo " $((i + 1)). ${DESTINATIONS[$i]}"
|
||||
done
|
||||
|
||||
# Get list of items in source
|
||||
items=("$SOURCE"/*)
|
||||
total=${#items[@]}
|
||||
items_per_dest=$((total / ${#DESTINATIONS[@]}))
|
||||
|
||||
echo ""
|
||||
echo "Total items to split: $total"
|
||||
echo "Items per destination: ~$items_per_dest"
|
||||
echo ""
|
||||
|
||||
read -p "Proceed with copy? (y/n): " confirm
|
||||
if [ "$confirm" != "y" ]; then
|
||||
echo "Cancelled."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Distribute items
|
||||
echo ""
|
||||
echo "Starting distribution..."
|
||||
for i in "${!DESTINATIONS[@]}"; do
|
||||
start=$((i * items_per_dest))
|
||||
if [ $i -eq $((${#DESTINATIONS[@]} - 1)) ]; then
|
||||
# Last destination gets remainder
|
||||
end=$total
|
||||
else
|
||||
end=$(((i + 1) * items_per_dest))
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Copying to ${DESTINATIONS[$i]} (items $((start + 1)) to $end)..."
|
||||
for ((j=start; j<end; j++)); do
|
||||
item_name=$(basename "${items[$j]}")
|
||||
echo " -> $item_name"
|
||||
rsync -a "${items[$j]}" "${DESTINATIONS[$i]}/"
|
||||
done
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Distribution complete!"
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Sync mail from ProtonMail Bridge (suppress CLOSE error)
|
||||
echo "Syncing mail from ProtonMail..."
|
||||
mbsync -a 2>&1 | grep -v "CLOSE"
|
||||
|
||||
# Index new mail (this automatically runs post-new hook)
|
||||
echo "Indexing new messages..."
|
||||
notmuch new
|
||||
|
||||
# Move all deleted messages to Trash folder
|
||||
echo "Cleaning up deleted messages..."
|
||||
DELETED_COUNT=0
|
||||
notmuch search --output=files tag:deleted 2>/dev/null | while read filepath; do
|
||||
if [ -f "$filepath" ]; then
|
||||
TRASH_DIR="$HOME/.local/share/mail/Trash/cur"
|
||||
mkdir -p "$TRASH_DIR"
|
||||
|
||||
FILENAME=$(basename "$filepath")
|
||||
mv "$filepath" "$TRASH_DIR/$FILENAME"
|
||||
((DELETED_COUNT++))
|
||||
fi
|
||||
done
|
||||
|
||||
# Update notmuch after moving files
|
||||
if [ $DELETED_COUNT -gt 0 ]; then
|
||||
echo "Moved $DELETED_COUNT message(s) to Trash"
|
||||
notmuch new --no-hooks >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
# Sync moved messages back to ProtonMail
|
||||
echo "Syncing changes to ProtonMail..."
|
||||
mbsync -a 2>&1 | grep -v "CLOSE" >/dev/null
|
||||
|
||||
# Notify if new mail
|
||||
NEW=$(notmuch count tag:unread)
|
||||
if [ $NEW -gt 0 ]; then
|
||||
notify-send "📬 Mail" "$NEW unread message(s)"
|
||||
fi
|
||||
|
||||
echo "Sync complete: $(date)"
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Sync with server (this pushes local changes including deletions)
|
||||
mbsync -a
|
||||
|
||||
# Re-index
|
||||
notmuch new
|
||||
|
||||
# Auto-tag folders
|
||||
notmuch tag +sent -- folder:Sent and not tag:sent
|
||||
notmuch tag +draft -- folder:Drafts and not tag:draft
|
||||
notmuch tag +trash -- folder:Trash and not tag:trash
|
||||
notmuch tag +spam -- folder:Spam and not tag:spam
|
||||
@@ -1,76 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
THEME="${1:-catppuccin-mocha}"
|
||||
CONFIG_DIR="$HOME/.config"
|
||||
# WAYBAR_DIR="$CONFIG_DIR/niri/waybar-niri"
|
||||
|
||||
declare -A THEMES=(
|
||||
["cat"]="catppuccin-mocha"
|
||||
["rose"]="rose-pine-moon"
|
||||
["dracula"]="dracula"
|
||||
)
|
||||
|
||||
if [[ ! -v "THEMES[$THEME]" ]]; then
|
||||
echo "Unknown theme: $THEME"
|
||||
echo "Available themes: ${!THEMES[@]}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Switching to theme: $THEME"
|
||||
|
||||
# Neovim
|
||||
echo "vim.cmd.colorscheme('${THEMES[$THEME]}')" >"$CONFIG_DIR/nvim/lua/current_theme.lua"
|
||||
echo " ✓ Neovim"
|
||||
|
||||
# Kitty
|
||||
if command -v kitty &>/dev/null && [[ -f "$CONFIG_DIR/kitty/themes/${THEME}.conf" ]]; then
|
||||
ln -sf "$CONFIG_DIR/kitty/themes/${THEME}.conf" "$CONFIG_DIR/kitty/current-theme.conf"
|
||||
kill -SIGUSR1 $(pgrep kitty) 2>/dev/null || true
|
||||
echo " ✓ Kitty"
|
||||
fi
|
||||
|
||||
# Btop
|
||||
if [[ -f "$CONFIG_DIR/btop/themes/${THEME}.theme" ]]; then
|
||||
sed -i "s|^color_theme = .*|color_theme = \"$CONFIG_DIR/btop/themes/${THEME}.theme\"|" "$CONFIG_DIR/btop/btop.conf"
|
||||
echo " ✓ Btop"
|
||||
fi
|
||||
|
||||
# Yazi
|
||||
if [[ -f "$CONFIG_DIR/yazi/themes/${THEME}.toml" ]]; then
|
||||
ln -sf "$CONFIG_DIR/yazi/themes/${THEME}.toml" "$CONFIG_DIR/yazi/theme.toml"
|
||||
echo " ✓ Yazi"
|
||||
fi
|
||||
|
||||
# # Waybar - simply copy the theme file to theme.css
|
||||
# if [[ -f "$WAYBAR_DIR/themes/${THEME}.css" ]]; then
|
||||
# cp "$WAYBAR_DIR/themes/${THEME}.css" "$WAYBAR_DIR/theme.css"
|
||||
#
|
||||
# pkill waybar 2>/dev/null || true
|
||||
# sleep 0.5
|
||||
# waybar -c "$WAYBAR_DIR/config.jsonc" -s "$WAYBAR_DIR/style.css" &
|
||||
# echo " ✓ Waybar"
|
||||
# else
|
||||
# echo " ✗ Waybar: theme file not found at $WAYBAR_DIR/themes/${THEME}.css"
|
||||
# fi
|
||||
|
||||
# Bat
|
||||
if command -v bat &>/dev/null; then
|
||||
case $THEME in
|
||||
catppuccin-mocha) BAT_THEME="Catppuccin Mocha" ;;
|
||||
rose-pine-moon) BAT_THEME="TwoDark" ;;
|
||||
*) BAT_THEME="Monokai Extended" ;;
|
||||
esac
|
||||
|
||||
if [[ -f "$CONFIG_DIR/bat/config" ]]; then
|
||||
sed -i "s/^--theme=.*/--theme=\"${BAT_THEME}\"/" "$CONFIG_DIR/bat/config"
|
||||
else
|
||||
mkdir -p "$CONFIG_DIR/bat"
|
||||
echo "--theme=\"${BAT_THEME}\"" >"$CONFIG_DIR/bat/config"
|
||||
fi
|
||||
echo " ✓ Bat"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "✓ Theme switched to: $THEME"
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ask for the thumbnail filename
|
||||
echo "=== Album Art Embedder (Recursive) ==="
|
||||
echo "Current directory: $(pwd)"
|
||||
read -p "Enter thumbnail filename in this directory (e.g., cover.jpg): " thumbnail
|
||||
|
||||
# Full path to thumbnail
|
||||
thumbnail_path="$(pwd)/$thumbnail"
|
||||
|
||||
# Check if thumbnail exists
|
||||
if [ ! -f "$thumbnail_path" ]; then
|
||||
echo "Error: Thumbnail not found at $thumbnail_path"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ask for album artist
|
||||
read -p "Enter album artist name: " album_artist
|
||||
|
||||
# Get album name from current directory
|
||||
album_name="$(basename "$(pwd)")"
|
||||
|
||||
echo ""
|
||||
echo "Found thumbnail: $thumbnail_path"
|
||||
echo "Album: $album_name"
|
||||
echo "Album Artist: $album_artist"
|
||||
echo "Processing all mp3/mp4 files in subdirectories..."
|
||||
echo ""
|
||||
|
||||
# Counter for processed files
|
||||
count=0
|
||||
|
||||
# Find all mp3 and mp4 files in subdirectories (not current dir)
|
||||
find . -mindepth 2 -type f \( -name "*.mp3" -o -name "*.mp4" \) | while read -r file; do
|
||||
echo "Processing: $file"
|
||||
|
||||
# Get file extension
|
||||
ext="${file##*.}"
|
||||
|
||||
# Create temporary filename
|
||||
temp_file="${file}.tmp.${ext}"
|
||||
|
||||
# Add thumbnail and metadata using ffmpeg
|
||||
if [ "$ext" = "mp3" ]; then
|
||||
ffmpeg -i "$file" -i "$thumbnail_path" \
|
||||
-map 0 -map 1 \
|
||||
-c copy \
|
||||
-metadata album_artist="$album_artist" \
|
||||
-metadata album="$album_name" \
|
||||
-disposition:v:0 attached_pic \
|
||||
"$temp_file" 2>/dev/null
|
||||
else
|
||||
# For mp4 files
|
||||
ffmpeg -i "$file" -i "$thumbnail_path" \
|
||||
-map 0 -map 1 \
|
||||
-c copy \
|
||||
-metadata artist="$album_artist" \
|
||||
-metadata album="$album_name" \
|
||||
-disposition:v:0 attached_pic \
|
||||
"$temp_file" 2>/dev/null
|
||||
fi
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
mv "$temp_file" "$file"
|
||||
((count++))
|
||||
echo "✓ Done"
|
||||
else
|
||||
echo "✗ Failed"
|
||||
[ -f "$temp_file" ] && rm "$temp_file"
|
||||
fi
|
||||
echo ""
|
||||
done
|
||||
|
||||
echo "Finished! Processed $count files."
|
||||
echo "Album Artist set to: $album_artist"
|
||||
echo "Album set to: $album_name"
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ~/scripts/yazi-picker.sh
|
||||
|
||||
# Launch Yazi and capture the selected file
|
||||
selected_file=$(yazi --chooser-file)
|
||||
|
||||
# If a file was selected, print it (or pass it to another application)
|
||||
if [ -n "$selected_file" ]; then
|
||||
echo "$selected_file" | xclip -selection clipboard # Copy to clipboard (optional)
|
||||
echo "Selected file: $selected_file"
|
||||
fi
|
||||
Reference in New Issue
Block a user