commit e77854b6b5b497c89f30e57c03d32b493dd34398 Author: shibao Date: Wed Nov 17 14:17:36 2021 -0500 add sway config add bashrc ignore xauthority add autounlocking keepass desktop entry add fonts for waybar add alacritty config move scripts location and adjust bashrc use materia theme sway and lockscreen add list packages script add ranger desktop item add mpd config add indicator ring to swaylock remove mpd password add global asdf tool versions add mako config update keys add swaylock theme add suspend to lock config move ssh commands to aliases tweak mpd section in waybar add kanshi config for work update bashrc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +* diff --git a/home/default/.bashrc b/home/default/.bashrc new file mode 100644 index 0000000..4ada453 --- /dev/null +++ b/home/default/.bashrc @@ -0,0 +1,45 @@ +# if not running interactively, don't do anything +[[ $- != *i* ]] && return + +# hidpi potential fix +export QT_AUTO_SCREEN_SCALE_FACTOR=1 +# for waybar +export XDG_CURRENT_DESKTOP=Unity +# dark gtk themes +export GTK_THEME=Materia:dark + +# set neovim as default editor +export VISUAL=nvim +export EDITOR=nvim + +# add scripts folder to path +export PATH="~/scripts:$PATH" + +# dotnet +export MSBuildSDKsPath="/usr/share/dotnet/sdk/`dotnet --version`/Sdks/" +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export PATH="~/.dotnet/tools:$PATH" + +# fcitx +export GTK_IM_MODULE=fcitx +export QT_IM_MODULE=fcitx +export XMODIFIERS="@im=fcitx" + +# aliases +alias v=nvim +alias ls="ls --color=auto" +alias errors="journalctl -b -p err | less" + +# git +export GIT_DISCOVERY_ACROSS_FILESYSTEM=true +source /usr/share/git/completion/git-prompt.sh +source /usr/share/git/completion/git-completion.bash +PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' + +# direnv +eval "$(direnv hook bash)" + +# asdf-vm +. /opt/asdf-vm/asdf.sh + +proverb diff --git a/home/default/.config/alacritty/alacritty.yml b/home/default/.config/alacritty/alacritty.yml new file mode 100644 index 0000000..bbfe533 --- /dev/null +++ b/home/default/.config/alacritty/alacritty.yml @@ -0,0 +1 @@ +background_opacity: 0.85 diff --git a/home/default/.config/kanshi/config b/home/default/.config/kanshi/config new file mode 100644 index 0000000..bbd4ded --- /dev/null +++ b/home/default/.config/kanshi/config @@ -0,0 +1,8 @@ +profile { + output eDP-1 scale 2.00 position 0,540 mode 3200x1800 + output "Acer Technologies G257HU T1WAA0012432" scale 1.00 position 1600,0 mode 2560x1440 +} + +profile { + output eDP-1 scale 2.00 position 0,540 mode 3200x1800 +} diff --git a/home/default/.config/mako/config b/home/default/.config/mako/config new file mode 100644 index 0000000..6c036be --- /dev/null +++ b/home/default/.config/mako/config @@ -0,0 +1,6 @@ +font=IBMPlexMono 10 +background-color=#222222 +border-color=#333333 +anchor=top-right +default-timeout=6000 +width=350 diff --git a/home/default/.config/mpd/mpd.conf b/home/default/.config/mpd/mpd.conf new file mode 100644 index 0000000..c79b0d6 --- /dev/null +++ b/home/default/.config/mpd/mpd.conf @@ -0,0 +1,34 @@ +# mpd.conf + +pid_file "/home/default/.config/mpd/mpd.pid" +db_file "/home/default/.config/mpd/mpd.db" +state_file "/home/default/.config/mpd/mpd.state" +playlist_directory "/home/default/.config/mpd/music/music/playlists/mpd" +music_directory "/home/default/.config/mpd/music" +sticker_file "/home/default/.config/mpd/sticker.sql" +log_file "syslog" +auto_update "yes" +user "default" +bind_to_address "localhost" +port "6600" +volume_normalization "yes" + +# pulse audio +audio_output { + type "pulse" + name "pulse audio" +} + +# httpd stream +# audio_output { +# type "httpd" +# name "My HTTP Stream" +# encoder "wave" # optional, vorbis or lame +# port "8000" +# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 +# quality "5.0" # do not define if bitrate is defined +# bitrate "128" # do not define if quality is defined +# format "44100:16:1" +# max_clients "0" # optional 0=no limit +#} + diff --git a/home/default/.config/rofi/config.rasi b/home/default/.config/rofi/config.rasi new file mode 100644 index 0000000..d2406ec --- /dev/null +++ b/home/default/.config/rofi/config.rasi @@ -0,0 +1,8 @@ +configuration { + modi: "combi"; + font: "hack 10"; + combi-modi: "window,drun,ssh"; + show-icons: true; +} + +@theme "/usr/share/rofi/themes/solarized_alternate.rasi" diff --git a/home/default/.config/sway/config b/home/default/.config/sway/config new file mode 100644 index 0000000..44accdc --- /dev/null +++ b/home/default/.config/sway/config @@ -0,0 +1,234 @@ +### sway settings + +# logo key. Use Mod1 for Alt. +set $mod Mod4 + +# home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l + +set $term alacritty +set $menu rofi -show combi | xargs swaymsg exec -- + +# wallpaper +output * bg ~/syncthing/default/photos/wallpaper.jpg fill + +### daemons + +# notification daemon +exec --no-startup-id mako + +# display orientation +exec --no-startup-id kanshi + +# polkit +exec --no-startup-id lxpolkit + +# wifi applet +exec nm-applet --indicator + +### gtk settings + +set $gnome-schema org.gnome.desktop.interface + +exec_always { + gsettings set $gnome-schema gtk-theme 'Materia-dark' + gsettings set $gnome-schema icon-theme 'Papirus-Dark' +} + +### idle configuration + +# timeout +exec swayidle -w \ + timeout 300 'playerctl -a pause && swaylock' \ + timeout 600 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'playerctl -a pause' \ + lock 'swaylock' + +# screen lock +bindsym Ctrl+Shift+l exec playerctl -a pause && \ + systemctl suspend && \ + swaylock + +### input configuration + +# fcitx +exec --no-startup-id fcitx -d + +### key bindings + +# start terminal +bindsym $mod+Return exec $term + +# kill focused window +bindsym $mod+Shift+q kill + +# start your launcher +bindsym $mod+q exec $menu + +# drag floating windows by holding down $mod and left mouse button. +# resize them with right mouse button + $mod. +# despite the name, also works for non-floating windows. +# change normal to inverse to use left mouse button for resizing and right +# mouse button for dragging. +floating_modifier $mod normal + +# reload the configuration file +bindsym $mod+Shift+c reload + +# exit sway (logs you out of your Wayland session) +bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' + +# move your focus around +bindsym $mod+$left focus left +bindsym $mod+$down focus down +bindsym $mod+$up focus up +bindsym $mod+$right focus right +# or use $mod+[up|down|left|right] +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move the focused window with the same, but add Shift +bindsym $mod+Shift+$left move left +bindsym $mod+Shift+$down move down +bindsym $mod+Shift+$up move up +bindsym $mod+Shift+$right move right + +# ditto, with arrow keys +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# switch to workspace +bindsym $mod+1 workspace number 1 +bindsym $mod+2 workspace number 2 +bindsym $mod+3 workspace number 3 +bindsym $mod+4 workspace number 4 +bindsym $mod+5 workspace number 5 +bindsym $mod+6 workspace number 6 +bindsym $mod+7 workspace number 7 +bindsym $mod+8 workspace number 8 +bindsym $mod+9 workspace number 9 +bindsym $mod+0 workspace number 10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number 1 +bindsym $mod+Shift+2 move container to workspace number 2 +bindsym $mod+Shift+3 move container to workspace number 3 +bindsym $mod+Shift+4 move container to workspace number 4 +bindsym $mod+Shift+5 move container to workspace number 5 +bindsym $mod+Shift+6 move container to workspace number 6 +bindsym $mod+Shift+7 move container to workspace number 7 +bindsym $mod+Shift+8 move container to workspace number 8 +bindsym $mod+Shift+9 move container to workspace number 9 +bindsym $mod+Shift+0 move container to workspace number 10 + +# splits +bindsym $mod+b splith +bindsym $mod+v splitv + +# switch the current container between different layout styles +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# make the current focus fullscreen +bindsym $mod+f fullscreen + +# toggle the current focus between tiling and floating mode +bindsym $mod+Shift+space floating toggle + +# swap focus between the tiling area and the floating area +bindsym $mod+space focus mode_toggle + +# move focus to the parent container +bindsym $mod+a focus parent + +# move the currently focused window to the scratchpad +bindsym $mod+Shift+minus move scratchpad + +# show the next scratchpad window or hide the focused scratchpad window. +# if there are multiple scratchpad windows, this command cycles through them. +bindsym $mod+minus scratchpad show + +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + + +# waybar +bar { + swaybar_command waybar +} + +### special keys + +# volume +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% + +# mute +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle + +# keyboard brightness +bindsym XF86MonBrightnessDown exec brightnessctl set 10%- +bindsym XF86MonBrightnessUp exec brightnessctl set +10% + +# music controls +bindsym XF86AudioPlay exec playerctl play-pause +bindsym XF86AudioNext exec playerctl next +bindsym XF86AudioPrev exec playerctl previous +# bindsym XF86AudioPlay exec mpc toggle +# bindsym XF86AudioNext exec mpc next +# bindsym XF86AudioPrev exec mpc prev + +# run menu +bindsym XF86Search exec $menu + +# screenshot +bindsym Ctrl+Shift+p exec ~/scripts/screenshot + +### gaps +gaps inner 25 +# smart_gaps on + +# notifications +bindsym $mod+m exec makoctl dismiss +bindsym $mod+n exec makoctl restore + +### styles + +# class border backgr text +client.focused #333333 #333333 #FFFFFF +client.focused_inactive #222222 #222222 #AAAAAA +client.unfocused #222222 #222222 #AAAAAA + +# font +font pango: IBMPlexMono Regular 10 + +include /etc/sway/config.d/* diff --git a/home/default/.config/swaylock/config b/home/default/.config/swaylock/config new file mode 100644 index 0000000..5adf41c --- /dev/null +++ b/home/default/.config/swaylock/config @@ -0,0 +1,19 @@ +daemonize +indicator-idle-visible +color=222222ee +bs-hl-color=333333 +key-hl-color=eeeeee +inside-color=00000000 +inside-ver-color=eeeeee +inside-clear-color=cccccc +inside-wrong-color=202020 +line-color=00000000 +line-ver-color=00000000 +line-clear-color=00000000 +line-wrong-color=00000000 +separator-color=00000000 +ring-color=777777 +ring-ver-color=bbbbbb +ring-clear-color=cccccc +ring-wrong-color=151515 +text-wrong-color=eeeeee diff --git a/home/default/.config/waybar/config b/home/default/.config/waybar/config new file mode 100644 index 0000000..f69685a --- /dev/null +++ b/home/default/.config/waybar/config @@ -0,0 +1,146 @@ +{ + // "layer": "top", // Waybar at top layer + "position": "top", // Waybar position (top|bottom|left|right) + "height": 20, // Waybar height (to be removed for auto height) + // "width": 1280, // Waybar width + // Choose the order of the modules + "modules-left": ["sway/workspaces", "sway/mode", "custom/media"], + "modules-center": [], + "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "battery", "clock", "tray"], + "sway/workspaces": { + "disable-scroll-wraparound": true + }, + // Modules configuration + // "sway/workspaces": { + // "disable-scroll": true, + // "all-outputs": true, + // "format": "{name}: {icon}", + // "format-icons": { + // "1": "", + // "2": "", + // "3": "", + // "4": "", + // "5": "", + // "urgent": "", + // "focused": "", + // "default": "" + // } + // }, + "keyboard-state": { + "numlock": true, + "capslock": true, + "format": "{name} {icon}", + "format-icons": { + "locked": "", + "unlocked": "" + } + }, + "sway/mode": { + "format": "{}" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + "icon-size": 15, + "spacing": 10 + }, + "clock": { + // "timezone": "America/New_York", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format": "{:%Y-%m-%d %I:%M:%S %p}", + "interval": 1 + }, + "cpu": { + "format": " {usage}%", + // "tooltip": false + }, + "memory": { + "format": " {}%" + }, + "battery": { + "states": { + "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{icon} {capacity}% ({time})", + "format-charging": " {capacity}%", + "format-plugged": " {capacity}%", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": " {essid} ({signalStrength}%)", + "format-ethernet": " {ifname}: {ipaddr}/{cidr}", + "format-linked": " {ifname} (No IP)", + "format-disconnected": "⚠ Disconnected", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{icon} {volume}%", + "format-bluetooth": "{volume}% {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": " {volume}%", + // "format-source": "{volume}% ", + // "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, + "mpd": { + "server": "localhost", + "port": 6600, + "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon} {artist} | {title} | {elapsedTime:%M:%S}/{totalTime:%M:%S}", + // "max-length": 200, + "format-disconnected": "Disconnected", + "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped", + "interval": 2, + "consume-icons": { + "on": " " // Icon shows only when "consume" is on + }, + "random-icons": { + "off": " ", // Icon grayed out when "random" is off + "on": " " + }, + "repeat-icons": { + "on": " " + }, + "single-icons": { + "on": "1 " + }, + "state-icons": { + "paused": "", + "playing": "" + }, + "tooltip-format": "MPD (connected)", + "tooltip-format-disconnected": "MPD (disconnected)" + }, + "custom/media": { + "format": "{icon} {}", + "return-type": "json", + "max-length": 40, + "format-icons": { + "spotify": "", + "default": "🎜" + }, + "escape": true, + "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder + // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name + } +} + diff --git a/home/default/.config/waybar/style.css b/home/default/.config/waybar/style.css new file mode 100644 index 0000000..49be6f5 --- /dev/null +++ b/home/default/.config/waybar/style.css @@ -0,0 +1,243 @@ +* { + border: none; + border-radius: 0; + /* `otf-font-awesome` is required to be installed for icons */ + font-family: IBMPlexMono, monospace, 'Font Awesome 5 Free Solid'; + font-size: 14px; + min-height: 0; +} + +window#waybar { + background-color: #000; + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +#workspaces button { + padding: 0 8px; + background-color: transparent; + color: #ffffff; + min-width: 0; +} + + +#workspaces button.focused { + background-color: #424242; + box-shadow: inset 2px 2px #555555, inset -2px -2px #555555; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#mpd { + padding: 0 6px; + border-right: 2px solid #424242; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +/* +#clock { + background-color: #64727D; +} + +#battery { + background-color: #ffffff; + color: #000000; +} +*/ + +#battery.charging, #battery.plugged { + color: #ffffff; + background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.warning:not(.charging) { + background-color: #F57C00; + color: black; +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +/* +#cpu { + background-color: #2ecc71; + color: #000000; +} + +#memory { + background-color: #9b59b6; +} + +#disk { + background-color: #964B00; +} + +#backlight { + background-color: #90b1b1; +} + +#network { + background-color: #2980b9; +} +*/ + +#network.disconnected { + background-color: #424242; +} + +#pulseaudio.muted { + background-color: #424242; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#mpd { + /* background-color: #66cc99; */ + /* color: #2a5c45; */ +} + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + /* background-color: #90b1b1; */ +} + +#mpd.paused { + /* background-color: #51a37a; */ +} + +#language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state > label { + padding: 0 5px; +} + +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +} diff --git a/home/default/.fonts/Font Awesome 5 Brands-Regular-400.otf b/home/default/.fonts/Font Awesome 5 Brands-Regular-400.otf new file mode 100644 index 0000000..1840b93 Binary files /dev/null and b/home/default/.fonts/Font Awesome 5 Brands-Regular-400.otf differ diff --git a/home/default/.fonts/Font Awesome 5 Free-Regular-400.otf b/home/default/.fonts/Font Awesome 5 Free-Regular-400.otf new file mode 100644 index 0000000..0f55808 Binary files /dev/null and b/home/default/.fonts/Font Awesome 5 Free-Regular-400.otf differ diff --git a/home/default/.fonts/Font Awesome 5 Free-Solid-900.otf b/home/default/.fonts/Font Awesome 5 Free-Solid-900.otf new file mode 100644 index 0000000..fb8c079 Binary files /dev/null and b/home/default/.fonts/Font Awesome 5 Free-Solid-900.otf differ diff --git a/home/default/.local/share/applications/org.keepassxc.KeePassXC.desktop b/home/default/.local/share/applications/org.keepassxc.KeePassXC.desktop new file mode 100644 index 0000000..8fa8bba --- /dev/null +++ b/home/default/.local/share/applications/org.keepassxc.KeePassXC.desktop @@ -0,0 +1,15 @@ +[Desktop Entry] +Name=KeePassXC +GenericName=Password Manager +GenericName[zh_TW]=密碼管理員 +Comment=Community-driven port of the Windows application “KeePass Password Safe” +Exec=sh -c "cat /etc/password | keepassxc --pw-stdin ~/syncthing/default/docs/passwords.kdbx" %f +TryExec=keepassxc +Icon=keepassxc +StartupWMClass=keepassxc +StartupNotify=true +Terminal=false +Type=Application +Version=1.0 +Categories=Utility;Security;Qt; +MimeType=application/x-keepass2; diff --git a/home/default/.local/share/applications/ranger.desktop b/home/default/.local/share/applications/ranger.desktop new file mode 100644 index 0000000..bedb988 --- /dev/null +++ b/home/default/.local/share/applications/ranger.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Version=1.0 +Name=ranger +GenericName=File Manager +Comment=Launches the ranger file manager +# needs full path to bin +Exec=/home/path-to/open-tui ranger %F +Icon=utilities-terminal +Terminal=false +X-MultipleArgs=false +Type=Application +MimeType=inode/directory; +StartupNotify=true +Categories=System;FileTools;FileManager diff --git a/home/default/.tool-versions b/home/default/.tool-versions new file mode 100644 index 0000000..b2786fd --- /dev/null +++ b/home/default/.tool-versions @@ -0,0 +1,3 @@ +elixir 1.12.2-otp-23 +erlang 23.3 +nodejs 14.16.0 \ No newline at end of file diff --git a/home/default/scripts/append-urls-to-titles b/home/default/scripts/append-urls-to-titles new file mode 100755 index 0000000..f8c76a5 --- /dev/null +++ b/home/default/scripts/append-urls-to-titles @@ -0,0 +1,23 @@ +#!/usr/bin/env sh +set pipefail -eou + +# Old script to get json url for some reason? Don't know why I did this +# youtube-dl -j --flat-playlist -a - | \ +# jq -r '.id' | \ +# sed 's_^_https://youtu.be/_' | \ +# wget-titles-from-urls >> titles.txt + +test -f append.txt +if [[ $? -ne 0 ]]; then + echo No append.txt found! Cannot append + exit +fi + +if [[ ! -s append.txt ]]; then + echo append.txt is empty + exit +fi + +cat append.txt | wget-titles-from-urls >> titles.txt +cat append.txt | youtube-audio +> append.txt diff --git a/home/default/scripts/backup-archive b/home/default/scripts/backup-archive new file mode 100755 index 0000000..be968dc --- /dev/null +++ b/home/default/scripts/backup-archive @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +set -uo pipefail #set -e causes errors since most playlist will throw errors + +PARENT='/run/media/default/backup' + +# audio +PARENT_AUDIO="$PARENT/audio" +(cd "$PARENT_AUDIO/anjunadeep" && echo https://www.youtube.com/playlist?list=UUbDgBFAketcO26wz-pR6OKA | youtube-archive-audio) +(cd "$PARENT_AUDIO/eeuphonious" && echo https://www.youtube.com/playlist?list=UUaHM7hKCwJ_eR-dP3c7PKHw | youtube-archive-audio) +(cd "$PARENT_AUDIO/trianglemusic" && echo https://www.youtube.com/playlist?list=UUDBdeEaSnlu-AU-ITBTRkeQ | youtube-archive-audio) +(cd "$PARENT_AUDIO/ikiru" && echo https://www.youtube.com/playlist?list=UUVg1vfzDjkT9T_F-PZGC5Mw | youtube-archive-audio) + +# video +PARENT_VIDEO="$PARENT/youtube" +(cd "$PARENT_VIDEO/yotsu" && echo https://www.youtube.com/playlist?list=UU0FplT88irKbHeZucDiFplw | youtube-archive) +(cd "$PARENT_VIDEO/jeb-gardener" && echo https://www.youtube.com/playlist?list=UU5zdi4KM3ewwfYMNo_KnU0A | youtube-archive) +(cd "$PARENT_VIDEO/vagrant-holiday" && echo https://www.youtube.com/channel/UCgNqlRGqHdxNRPR6ycynWhw | youtube-archive) +(cd "$PARENT_VIDEO/fredrik-knudsen" && echo https://www.youtube.com/channel/UCbWcXB0PoqOsAvAdfzWMf0w | youtube-archive) +(cd "$PARENT_VIDEO/internet-historian" && echo https://www.youtube.com/channel/UCR1D15p_vdP3HkrH8wgjQRw | youtube-archive) +(cd "$PARENT_VIDEO/breadsword" && echo https://www.youtube.com/channel/UCcScIr2iskFm-zRo8FZ7cRw | youtube-archive) +#(cd "$PARENT_VIDEO/" && echo | youtube-archive) + +# git +PARENT_GIT="$PARENT/git" +(cd "$PARENT_GIT/deluge" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/calibre" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/hydrus" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/kdeconnect-kde" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/keepassxc" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/liferea" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/mpd" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/mpv" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/quassel" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/syncthing" && git remote update && git fetch --all && git reset --hard origin/main) +(cd "$PARENT_GIT/syncthing-android" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/trackma" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/bibanon" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/deemix" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/deemix-pyweb" && git remote update && git fetch --all && git reset --hard origin/master) +(cd "$PARENT_GIT/deemix-webui" && git remote update && git fetch --all && git reset --hard origin/master) diff --git a/home/default/scripts/booksplit b/home/default/scripts/booksplit new file mode 100755 index 0000000..50f77e1 --- /dev/null +++ b/home/default/scripts/booksplit @@ -0,0 +1,46 @@ +#!/bin/sh + +# Requires ffmpeg (audio splitting) and my `tag` wrapper script. + +[ ! -f "$2" ] && printf "The first file should be the audio, the second should be the timecodes.\\n" && exit + +echo "Enter the album/book title:"; read -r booktitle + +echo "Enter the artist/author:"; read -r author + +echo "Enter the publication year:"; read -r year + +inputaudio="$1" + +# Get a safe file name from the book. +#escbook="$(echo "$booktitle" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")" +escbook="$(echo "$booktitle" | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")" + +! mkdir -p "$escbook" && echo "Do you have write access in this directory?" && exit 1 + +# As long as the extension is in the tag script, it'll work. +ext="opus" +#ext="${1#*.}" + +# Get the total number of tracks from the number of lines. +total="$(wc -l < "$2")" + +while read -r x; +do + end="$(echo "$x" | cut -d' ' -f1)" + [ -n "$start" ] && + echo "From $start to $end; $track $title" + file="$escbook/$(printf "%.2d" "$track") - $author - $esctitle.$ext" + [ -n "$start" ] && echo "Splitting \"$title\"..." && ffmpeg -nostdin -y -loglevel -8 -i "$inputaudio" -ss "$start" -to "$end" -vn "$file" && + echo "Tagging \"$title\"..." && tag -a "$author" -A "$booktitle" -t "$title" -n "$track" -N "$total" -d "$year" "$file" + title="$(echo "$x" | cut -d' ' -f 2-)" + # esctitle="$(echo "$title" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")" + esctitle="$(echo "$title" | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")" + track="$((track+1))" + start="$end" +done < "$2" +# The last track must be done outside the loop. +echo "From $start to the end: $title" +file="$escbook/$track - $author - $esctitle.$ext" +echo "Splitting \"$title\"..." && ffmpeg -nostdin -y -loglevel -8 -i "$inputaudio" -ss "$start" -vn "$file" && + echo "Tagging \"$title\"..." && tag -a "$author" -A "$booktitle" -t "$title" -n "$track" -N "$total" -d "$year" "$file" diff --git a/home/default/scripts/create-playlist b/home/default/scripts/create-playlist new file mode 100755 index 0000000..a1ffeea --- /dev/null +++ b/home/default/scripts/create-playlist @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +find . -type f -iregex ".*\.\(mp3\|opus\|flac\|aac\)" | sort > playlist.m3u diff --git a/home/default/scripts/del-macos-folders b/home/default/scripts/del-macos-folders new file mode 100644 index 0000000..31471f6 --- /dev/null +++ b/home/default/scripts/del-macos-folders @@ -0,0 +1,3 @@ +#/usr/bin/env bash +set -v #echo on +find . -type d -name '__MACOSX' -print -exec rm -rf {} \; diff --git a/home/default/scripts/generate-mpd-playlists b/home/default/scripts/generate-mpd-playlists new file mode 100755 index 0000000..144cafe --- /dev/null +++ b/home/default/scripts/generate-mpd-playlists @@ -0,0 +1,68 @@ +#!/usr/bin/env sh +set -ou pipefail + +# Generates playlists for all mp3 and flac files in a directory, ignoring itself in the "parent" folder + +PLAYLIST_FOLDER="/home/default/Music/playlists/mpd" # Playlist folder for mpd +PREFIX="music/playlists" # relative links to add to playlists, based on mpd virtual file structure +EXTENSIONS=("mp3" "opus" "flac" "m4a" "mkv" "webm") + +# Disable nullglob and set pattern matching to fix spaces +shopt -s nullglob +SAVEIFS=$IFS +IFS=$(echo -en "\n\b") + +cd $PLAYLIST_FOLDER || { echo "Could not cd into PLAYLIST_FOLDER"; exit 1; } +parent=`basename $PWD` + +# Delete old generated playlists +if [[ -f "*.gen.m3u" ]]; then + rm *.gen.m3u +fi +if [[ -f ".trackNames" ]]; then + rm .trackNames +fi + +# For all playlist directories to generate +for playlistDir in ../*; do + if [[ -d "$playlistDir" ]] && [[ "$playlistDir" != "../$parent" ]]; then + # playlist filename needed for mpd + playlist=`echo "$playlistDir" | sed "s/^\.\.\///g"` + # escaped version of filename needed for bash + escaped=`printf '%q\n' "$playlist"` + + # echo "playlist=$playlist" + # echo "escaped=$escaped" + + # touch file + > "$playlist.gen.m3u" + + # write all files with newlines + > .track-names + + for EXT in ${EXTENSIONS[@]}; do + # echo `find "../$playlist" -mindepth 1 -type f -name "*.$EXT" -printf x | wc -c` + if [[ `find "../$playlist" -mindepth 1 -type f -name "*.$EXT" -printf x | wc -c` != 0 ]]; then + ls -1 ../$escaped/*.$EXT >> .track-names 2> /dev/null + # echo `ls -1 ../$playlist/*.$EXT >> 2> /dev/null` + fi + done + + # echo `cat .track-names` + cat .track-names | while IFS="" read -r song || [ -n "$song" ] ; do + unprefixed=`echo "$song" | sed "s/^\.\.\///g"` + # echo "$PREFIX/$unprefixed" + echo "$PREFIX/$unprefixed" >> "$playlist.gen.m3u" + done < .track-names + + if [[ -f ".track-names" ]]; then + rm .track-names + fi +fi +done + + +# Use mpc to update mpd database +update-mpd > /dev/null +restart-music +IFS=$SAVEIFS diff --git a/home/default/scripts/git_log_alias b/home/default/scripts/git_log_alias new file mode 100755 index 0000000..a5e5e26 --- /dev/null +++ b/home/default/scripts/git_log_alias @@ -0,0 +1 @@ +git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative -n 20 \ No newline at end of file diff --git a/home/default/scripts/hash-filenames b/home/default/scripts/hash-filenames new file mode 100755 index 0000000..b40614e --- /dev/null +++ b/home/default/scripts/hash-filenames @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -eou pipefail + +read -rep $'Do you want to rename all files in this dir to their hash? [Y/n] \n> ' -n 1 REPLY +REPLY=${REPLY:-Y} +if [[ $REPLY =~ ^[Yy]$ ]] +then + for file in *; do + if [[ -f "./$file" ]]; then + sum=$(echo -n "$file" | md5sum) + echo "$file --> ${sum%% *}.${file##*.}" + mv "$file" "${sum%% *}.${file##*.}" + fi + done +fi diff --git a/home/default/scripts/list-packages b/home/default/scripts/list-packages new file mode 100755 index 0000000..1e1e327 --- /dev/null +++ b/home/default/scripts/list-packages @@ -0,0 +1,6 @@ +#!/bin/bash +set -eou pipefail + +echo $(pacman -Qqn) $(pacman -Qqm) | \ + tr " " "\n" | \ + sort diff --git a/home/default/scripts/mp3-to-opus b/home/default/scripts/mp3-to-opus new file mode 100755 index 0000000..b4e5db3 --- /dev/null +++ b/home/default/scripts/mp3-to-opus @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail + +for i in *.mp3; do ffmpeg -i "$i" -c:a libopus "${i%.*}.opus"; done +trash *.mp3 diff --git a/home/default/scripts/package-list b/home/default/scripts/package-list new file mode 100755 index 0000000..363fab3 --- /dev/null +++ b/home/default/scripts/package-list @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -eou pipefail + +echo $(pacman -Qqn) $(pacman -Qqm) | \ + tr " " "\n" | \ + sort diff --git a/home/default/scripts/phoenix b/home/default/scripts/phoenix new file mode 100755 index 0000000..92e4413 --- /dev/null +++ b/home/default/scripts/phoenix @@ -0,0 +1,12 @@ +#!/bin/sh + +while [ 1 ] +do + ping -c5 https://google.com + if [ $? -eq 0]; then + echo Ping check ok, waiting... + else + poweroff + fi +done + diff --git a/home/default/scripts/proverb b/home/default/scripts/proverb new file mode 100755 index 0000000..a2d1f27 --- /dev/null +++ b/home/default/scripts/proverb @@ -0,0 +1,3 @@ +#!/bin/sh +clear +fortune | cowsay -W 70 diff --git a/home/default/scripts/remove-exif b/home/default/scripts/remove-exif new file mode 100755 index 0000000..82b08a6 --- /dev/null +++ b/home/default/scripts/remove-exif @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +# rename .JPG -> .jpg +count=`ls -1 *.JPG 2>/dev/null | wc -l` +if [ $count != 0 ]; then + rename JPG jpg *.JPG +fi + +# remove exif except orientation from .jpg +count=`ls -1 *.jpg 2>/dev/null | wc -l` +if [ $count != 0 ]; then + for i in *.jpg; do + exiftool -all= -overwrite_original -tagsfromfile @ -Orientation "$i" + done +fi + +# rename .PNG -> .png +count=`ls -1 *.PNG 2>/dev/null | wc -l` +if [ $count != 0 ]; then + rename PNG png *.PNG +fi + +# remove exif except orientation from .png +count=`ls -1 *.png 2>/dev/null | wc -l` +if [ $count != 0 ]; then + for i in *.png; do + exiftool -all= -overwrite_original -tagsfromfile @ -Orientation "$i" + done +fi + diff --git a/home/default/scripts/restart-music b/home/default/scripts/restart-music new file mode 100755 index 0000000..9cdeeec --- /dev/null +++ b/home/default/scripts/restart-music @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +set -euo pipefail + +CANTATA_RUNNING=0 + +if pgrep -f cantata &>/dev/null 2>&1; then + echo killing cantata... + CANTATA_RUNNING=1 + pkill -f cantata +fi + +# echo stopping pipewire-media-session... +# systemctl --user stop pipewire-media-session +echo stopping pipewire... +systemctl --user stop pipewire +echo starting pipewire... +systemctl --user start pipewire +# echo starting pipewire-media-session... +# systemctl --user start pipewire-media-session + +echo stopping mpDris2... +systemctl --user stop mpd-mpris +echo stopping mpd... +systemctl --user stop mpd +echo starting mpd... +systemctl --user start mpd +echo starting mpDris2... +systemctl --user start mpd-mpris + +if [[ $CANTATA_RUNNING == 1 ]]; then + echo starting cantata... + cantata& &>/dev/null +fi diff --git a/home/default/scripts/screenshot b/home/default/scripts/screenshot new file mode 100755 index 0000000..312e2de --- /dev/null +++ b/home/default/scripts/screenshot @@ -0,0 +1,6 @@ +#!/bin/sh + +# Take a screenshot +dir=~/Downloads/temp +(cd $dir && grim -g "$(slurp)") +xdg-open $dir diff --git a/home/default/scripts/scrub-ufw b/home/default/scripts/scrub-ufw new file mode 100755 index 0000000..6d33230 --- /dev/null +++ b/home/default/scripts/scrub-ufw @@ -0,0 +1,16 @@ +#!/bin/sh +echo "Stopping firewall and allowing everyone..." +ipt="/usr/bin/iptables" +## Failsafe - die if /sbin/iptables not found +[ ! -x "$ipt" ] && { echo "$0: \"${ipt}\" command not found."; exit 1; } +$ipt -P INPUT ACCEPT +$ipt -P FORWARD ACCEPT +$ipt -P OUTPUT ACCEPT +$ipt -F +$ipt -X +$ipt -t nat -F +$ipt -t nat -X +$ipt -t mangle -F +$ipt -t mangle -X +$ipt iptables -t raw -F +$ipt -t raw -X diff --git a/home/default/scripts/sort-by-length b/home/default/scripts/sort-by-length new file mode 100755 index 0000000..daf12d6 --- /dev/null +++ b/home/default/scripts/sort-by-length @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail + +cat input.txt | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- diff --git a/home/default/scripts/tag b/home/default/scripts/tag new file mode 100755 index 0000000..c23be4e --- /dev/null +++ b/home/default/scripts/tag @@ -0,0 +1,59 @@ +#!/bin/sh + +err() { echo "Usage: + tag [OPTIONS] file +Options: + -a: artist/author + -t: song/chapter title + -A: album/book title + -n: track/chapter number + -N: total number of tracks/chapters + -d: year of publication + -g: genre + -c: comment +You will be prompted for title, artist, album and track if not given." && exit 1 ;} + +while getopts "a:t:A:n:N:d:g:c:f:" o; do case "${o}" in + a) artist="${OPTARG}" ;; + t) title="${OPTARG}" ;; + A) album="${OPTARG}" ;; + n) track="${OPTARG}" ;; + N) total="${OPTARG}" ;; + d) date="${OPTARG}" ;; + g) genre="${OPTARG}" ;; + c) comment="${OPTARG}" ;; + f) file="${OPTARG}" ;; + *) printf "Invalid option: -%s\\n" "$OPTARG" && err ;; +esac done + +shift $((OPTIND - 1)) + +file="$1" + +[ ! -f "$file" ] && echo "Provide file to tag." && err + +[ -z "$title" ] && echo "Enter a title." && read -r title +[ -z "$artist" ] && echo "Enter an artist." && read -r artist +[ -z "$album" ] && echo "Enter an album." && read -r album +[ -z "$track" ] && echo "Enter a track number." && read -r track + +case "$file" in + *.ogg) echo "Title=$title +Artist=$artist +Album=$album +Track=$track +Total=$total +Date=$date +Genre=$genre +Comment=$comment" | vorbiscomment -w "$file" ;; + *.opus) echo "Title=$title +Artist=$artist +Album=$album +Track=$track +Total=$total +Date=$date +Genre=$genre +Comment=$comment" | opustags -i -S "$file" ;; + *.mp3) eyeD3 -Q --remove-all -a "$artist" -A "$album" -t "$title" -n "$track" -N "$total" -Y "$date" "$file" ;; + *) echo "File type not implemented yet." ;; +esac diff --git a/home/default/scripts/titles-to-youtube-playlist b/home/default/scripts/titles-to-youtube-playlist new file mode 100755 index 0000000..1bb7a7f --- /dev/null +++ b/home/default/scripts/titles-to-youtube-playlist @@ -0,0 +1,37 @@ +#!/bin/python + +# From https://webapps.stackexchange.com/questions/72787/how-to-create-a-youtube-playlist-from-a-list-of-links +# Only adds youtube links! + +import os, io +import webbrowser +import urllib.request, urllib.error, urllib.parse + +inputFileName = 'titles.txt' + +def ReadMultipleDataFrom(thisTextFile, thisPattern): + inputData = [] + file = open(thisTextFile, "r") + for iLine in file: + if iLine.startswith(thisPattern): + iLine = iLine.rstrip() + # print(iLine) + if ('v=') in iLine: # https://www.youtube.com/watch?v=aBcDeFGH + iLink = iLine.split('v=')[1] + iLink = iLink.split('&')[0] + inputData.append(iLink) + # print(iLink) + if ('be/') in iLine: # https://youtu.be/aBcDeFGH + iLink = iLine.split('be/')[1] + iLink = iLink.split('&')[0] + inputData.append(iLink) + # print(iLink) + return inputData + +videoLinks = ReadMultipleDataFrom(inputFileName, "https") +listOfVideos = "http://www.youtube.com/watch_videos?video_ids=" + ','.join(videoLinks) +response = urllib.request.urlopen(listOfVideos) +playListLink = response.geturl() +playListLink = playListLink.split('list=')[1] +playListURL = "https://www.youtube.com/playlist?list="+playListLink+"&disable_polymer=true" +webbrowser.open(playListURL) diff --git a/home/default/scripts/update-mirrors b/home/default/scripts/update-mirrors new file mode 100755 index 0000000..6f82b48 --- /dev/null +++ b/home/default/scripts/update-mirrors @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -eoux pipefail + +cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup +sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup +rankmirrors -n 20 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist diff --git a/home/default/scripts/update-mpd b/home/default/scripts/update-mpd new file mode 100755 index 0000000..02db23e --- /dev/null +++ b/home/default/scripts/update-mpd @@ -0,0 +1,5 @@ +#!/bin/sh +set -eoux pipefail + +# uses mpc to manually trigger a mpd update +mpc -h localhost -p 6600 --password update diff --git a/home/default/scripts/update-nonsystem b/home/default/scripts/update-nonsystem new file mode 100755 index 0000000..ee3542d --- /dev/null +++ b/home/default/scripts/update-nonsystem @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -eoux pipefail + +yay -Syu \ + --ignore=linux \ + --ignore=linux-headers \ + --ignore=nvidia \ + --ignore=nvidia-utils diff --git a/home/default/scripts/wget-titles-from-urls b/home/default/scripts/wget-titles-from-urls new file mode 100755 index 0000000..2b826dc --- /dev/null +++ b/home/default/scripts/wget-titles-from-urls @@ -0,0 +1,8 @@ +#!/bin/bash + +# Appends the title of a URL in the format of +# "# Title\nURL\n\n" +while read -r URL; do + TITLE=`curl -L "$URL" | grep -o ".*" | sed -E "s/(.*)<\/title>/\1/"` + printf "# $TITLE\n$URL\n\n" +done diff --git a/home/default/scripts/youtube-archive b/home/default/scripts/youtube-archive new file mode 100755 index 0000000..93e9ee2 --- /dev/null +++ b/home/default/scripts/youtube-archive @@ -0,0 +1,17 @@ +#!/usr/bin/env sh +set -eou pipefail + +# --write-description \ +# --write-info-json \ +# --write-annotations \ +# --write-all-thumbnails \ +# --write-auto-sub \ +youtube-dl \ + --ignore-errors \ + --geo-bypass \ + --sub-lang en --embed-subs \ + --output "%(title)s.%(ext)s" \ + --add-metadata \ + --embed-thumbnail \ + --download-archive downloaded.txt \ + -a - diff --git a/home/default/scripts/youtube-archive-audio b/home/default/scripts/youtube-archive-audio new file mode 100755 index 0000000..4bfc595 --- /dev/null +++ b/home/default/scripts/youtube-archive-audio @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -eou pipefail + +# --write-description \ +# --write-info-json \ +# --write-annotations \ +# --write-all-thumbnails \ +# --embed-thumbnail \ +# --write-auto-sub \ +# --audio-format opus \ +youtube-dl \ + --ignore-errors \ + --geo-bypass \ + --sub-lang en --embed-subs \ + --extract-audio \ + --no-post-overwrites \ + --output "%(title)s.%(ext)s" \ + --add-metadata \ + --download-archive downloaded.txt \ + -a - diff --git a/home/default/scripts/youtube-audio b/home/default/scripts/youtube-audio new file mode 100755 index 0000000..ba66ee9 --- /dev/null +++ b/home/default/scripts/youtube-audio @@ -0,0 +1,12 @@ +#!/bin/sh + +# --embed-thumbnail \ +# --audio-format opus \ +youtube-dl \ + --ignore-errors \ + -f bestaudio \ + --rm-cache-dir \ + --extract-audio \ + --output "%(title)s.%(ext)s" --add-metadata \ + --download-archive downloaded.txt \ + -a -