Commit 01881af
xxwhirlpool
·
2026-04-25 17:12:14 -0400 EDT
parent 1d218bc
misc, iconshare ruby script
5 files changed,
+55,
-2
+2,
-0
| ... | ... | @@ -47,3 +47,5 @@ config/.local/bin/uvx | |
| 47 | 47 | ||
| 48 | 48 | .directory | |
| 49 | 49 | scripts/Scripts/.directory | |
| 50 | + | scripts/Scripts/icons | |
| 51 | + | scripts/Scripts/gallery.html |
+1,
-0
| ... | ... | @@ -12,3 +12,4 @@ color_labels: disabled | |
| 12 | 12 | accessible_colors: disabled | |
| 13 | 13 | accessible_prompter: disabled | |
| 14 | 14 | spinner: enabled | |
| 15 | + | telemetry: disabled |
R config/.local/bin/scratchpad =>
config/.local/bin/mess
+0,
-0
+5,
-2
| ... | ... | @@ -2,9 +2,12 @@ | |
| 2 | 2 | # | |
| 3 | 3 | # lazy ass way to get my idol MP3s | |
| 4 | 4 | ||
| 5 | - | if [[ $# -eq 0 ]]; then | |
| 5 | + | url="$1" | |
| 6 | + | vidname="$2" | |
| 7 | + | ||
| 8 | + | if [[ "$#" -eq 0 || "$#" -ne 2 ]]; then | |
| 6 | 9 | echo "Usage: ytmp3 [URL]" | |
| 7 | 10 | exit 1 | |
| 8 | 11 | fi | |
| 9 | 12 | ||
| 10 | - | yt-dlp -f ba -x --audio-format mp3 -o "%(title)s.%(ext)s" "$1" | |
| 13 | + | yt-dlp -f ba -x --audio-format mp3 -o "$vidname.%(ext)s" "$url" |
| ... | ... | @@ -0,0 +1,47 @@ | |
| 1 | + | #!/usr/bin/env ruby | |
| 2 | + | ||
| 3 | + | def usage | |
| 4 | + | puts "Usage: iconshare.rb [DIR]" | |
| 5 | + | end | |
| 6 | + | ||
| 7 | + | icondir = ARGV[0] || "./icons/*" | |
| 8 | + | ||
| 9 | + | if icondir.nil? | |
| 10 | + | puts usage | |
| 11 | + | exit | |
| 12 | + | end | |
| 13 | + | ||
| 14 | + | htmlfile = File.open("./gallery.html", "w+") | |
| 15 | + | ||
| 16 | + | css = <<-EOF | |
| 17 | + | <style> | |
| 18 | + | html { | |
| 19 | + | background: #eff1f5; | |
| 20 | + | display: flex; | |
| 21 | + | flex-direction: column; | |
| 22 | + | align-items: center; | |
| 23 | + | } | |
| 24 | + | ||
| 25 | + | .wrapper { | |
| 26 | + | background: #303446; | |
| 27 | + | padding-block: 1rem; | |
| 28 | + | padding-inline: 1rem; | |
| 29 | + | max-width: 420px; | |
| 30 | + | } | |
| 31 | + | ||
| 32 | + | .wrapper img { | |
| 33 | + | margin-block-end: 4px; | |
| 34 | + | padding-inline: 2px; | |
| 35 | + | } | |
| 36 | + | </style> | |
| 37 | + | EOF | |
| 38 | + | ||
| 39 | + | htmlfile.write(css) | |
| 40 | + | htmlfile.write("<main class=\"wrapper\">") | |
| 41 | + | ||
| 42 | + | files = Dir[icondir].each do |icon| | |
| 43 | + | imghtml = "<img src=\"#{icon}\">" | |
| 44 | + | htmlfile.write(imghtml) | |
| 45 | + | end | |
| 46 | + | ||
| 47 | + | htmlfile.write("</main") |