summaryrefslogtreecommitdiff
path: root/dotfiles/common
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/common')
-rw-r--r--dotfiles/common/.bashrc.d/media.sh8
-rwxr-xr-xdotfiles/common/.local/bin/dotfiles_pushall6
-rwxr-xr-xdotfiles/common/.local/bin/lsbak1
-rwxr-xr-xdotfiles/common/.local/bin/project100
-rwxr-xr-xdotfiles/common/.local/bin/protonvpn3
-rwxr-xr-xdotfiles/common/.local/bin/steam2
-rwxr-xr-xdotfiles/common/.local/bin/sudo-update-grub1
-rwxr-xr-xdotfiles/common/.local/bin/sysupdate5
-rwxr-xr-xdotfiles/common/.local/bin/transadd9
-rwxr-xr-xdotfiles/common/.local/bin/update-backup-repositories56
-rwxr-xr-xdotfiles/common/.local/bin/virtstart8
-rwxr-xr-xdotfiles/common/.local/bin/ytp1
-rw-r--r--dotfiles/common/.zshrc.d/media.sh8
13 files changed, 8 insertions, 200 deletions
diff --git a/dotfiles/common/.bashrc.d/media.sh b/dotfiles/common/.bashrc.d/media.sh
index 92fe2ce..a5d54f1 100644
--- a/dotfiles/common/.bashrc.d/media.sh
+++ b/dotfiles/common/.bashrc.d/media.sh
@@ -18,12 +18,12 @@ alias ttdl="tsp tidal-dl -l"
# YouTube (yt-dlp)
# =============================================================================
# Video - single
-alias yt="yt-dlp --ignore-config --no-playlist --add-metadata -i -o '%(channel)s-%(title)s.%(ext)s'"
-alias tyt="tsp yt-dlp --ignore-config --no-playlist --add-metadata -i -o '%(channel)s-%(title)s.%(ext)s'"
+alias yt="yt-dlp --ignore-config --no-playlist --embed-metadata -i -o '%(channel)s-%(title)s.%(ext)s'"
+alias tyt="tsp yt-dlp --ignore-config --no-playlist --embed-metadata -i -o '%(channel)s-%(title)s.%(ext)s'"
# Video - playlist
-alias ytp="yt-dlp --ignore-config --yes-playlist --add-metadata -i -o '%(channel)s-%(playlist_title)s-%(playlist_index)s-%(title)s.%(ext)s'"
-alias tytp="tsp yt-dlp --ignore-config --yes-playlist --add-metadata -i -o '%(channel)s-%(playlist_title)s-%(playlist_index)s-%(title)s.%(ext)s'"
+alias ytp="yt-dlp --ignore-config --yes-playlist --embed-metadata -i -o '%(channel)s-%(playlist_title)s-%(playlist_index)s-%(title)s.%(ext)s'"
+alias tytp="tsp yt-dlp --ignore-config --yes-playlist --embed-metadata -i -o '%(channel)s-%(playlist_title)s-%(playlist_index)s-%(title)s.%(ext)s'"
# Audio - single
alias yta="yt-dlp --ignore-config --no-playlist -x -f bestaudio/best -o '%(artist)s-%(title)s.%(ext)s'"
diff --git a/dotfiles/common/.local/bin/dotfiles_pushall b/dotfiles/common/.local/bin/dotfiles_pushall
deleted file mode 100755
index 3eef2c6..0000000
--- a/dotfiles/common/.local/bin/dotfiles_pushall
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-# Craig Jennings <craigmartinjennings@gmail.com>
-# tired of pushing to multiple locations with multiple commands
-/usr/bin/git --git-dir="$HOME"/.dotfiles/ --work-tree="$HOME" push origin main && \
-/usr/bin/git --git-dir="$HOME"/.dotfiles/ --work-tree="$HOME" push source main && \
-/usr/bin/git --git-dir="$HOME"/.dotfiles/ --work-tree="$HOME" push github main
diff --git a/dotfiles/common/.local/bin/lsbak b/dotfiles/common/.local/bin/lsbak
deleted file mode 100755
index 7803135..0000000
--- a/dotfiles/common/.local/bin/lsbak
+++ /dev/null
@@ -1 +0,0 @@
-ls -laF /media/backup/renovo
diff --git a/dotfiles/common/.local/bin/project b/dotfiles/common/.local/bin/project
deleted file mode 100755
index cf5918d..0000000
--- a/dotfiles/common/.local/bin/project
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env bash
-
-echo ""
-
-# Check parameter
-if [ "$#" -ne 1 ] || [ "$1" != "start" ] && [ "$1" != "end" ]; then
- echo "This script must be called with either 'start' or 'end' as a parameter."
- exit 1
-fi
-
-CHECK_MARK="\033[0;32m\xE2\x9C\x94\033[0m"
-CLEAR_LINE="\033[1K"
-
-# Define directories to process
-project_dirs="$HOME/projects"
-code_dirs="$HOME/code"
-sync_dirs="$HOME/sync"
-
-
-# Git pull quietly unless there's an error
-git_maybe_pull() {
- git fetch --quiet
- if ! git diff --quiet HEAD FETCH_HEAD; then
- git pull --quiet
-
- # clear line and message
- echo -ne "\033[1K"
- echo -e "\\rpulled remote changes into $1"
- fi
-}
-
-# Git stash quietly unless there's an error
-git_stash () {
- git stash > /dev/null 2>&1 || \
- echo "git stash error in $1: $? "
-}
-
-# Git stash pop quietly unless there's an error
-git_stash_pop () {
- git stash pop > /dev/null 2>&1 || \
- echo "git stash error in $1: $? "
-}
-
-# Function to process a directory
-process_directory() {
- if [ -d "$1/.git" ]; then
- # Check remote repository
- cd "$1"
-
- # skip URLs with http/s URLS as they're directories cloned for reference only
- # skip git directories with no remote repository associated as well
- remote_url=$(git config --get remote.origin.url)
- if [ -n "$remote_url" ]; then
- # if remote URL is http or https or empty, skip the directory
- if [ -z "$remote_url" ] || echo "$remote_url" | grep -E -q "^(http|https)://"; then
- return
- fi
-
- # clear line and update directory
- echo -ne "$CLEAR_LINE"
- echo -ne "\\rchecking: $1 "
-
- if [ "$2" = "start" ]; then
- if [ -n "$(git status --porcelain)" ]; then
- # notify user of uncommitted work
- echo ""; echo ">>>> uncommitted work found in $1";
-
- # git stash, pull latest files, then pop uncommitted work
- git_stash "$1"
- git_maybe_pull "$1"
- git_stash_pop "$1"
- else
- # retrieve any latest changes
- git_maybe_pull "$1"
- fi
- elif [ "$2" = "end" ]; then
- # Check for uncommitted work
- if [ -n "$(git status --porcelain)" ]; then
- echo ""; echo ">>>> Uncommitted work found in $1. <<<<"; echo ""
- fi
- return # Skip pulling changes
- fi
- fi
- fi
-}
-
-# Process directories
-for directory in "$project_dirs"/*; do
- process_directory "$directory" "$1"
-done
-for directory in "$sync_dirs"/*; do
- process_directory "$directory" "$1"
-done
-for directory in "$code_dirs"/*; do
- process_directory "$directory" "$1"
-done
-
-# clear line and message finished
-echo -ne "\033[1K"
-echo -ne "\\rfinished.\n"
diff --git a/dotfiles/common/.local/bin/protonvpn b/dotfiles/common/.local/bin/protonvpn
deleted file mode 100755
index 0f24068..0000000
--- a/dotfiles/common/.local/bin/protonvpn
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env bash
-
-flatpak run com.protonvpn.www \ No newline at end of file
diff --git a/dotfiles/common/.local/bin/steam b/dotfiles/common/.local/bin/steam
deleted file mode 100755
index 3d30238..0000000
--- a/dotfiles/common/.local/bin/steam
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-flatpak run com.valvesoftware.Steam >> "$HOME/.local/var/logs/steam.log" 2>&1
diff --git a/dotfiles/common/.local/bin/sudo-update-grub b/dotfiles/common/.local/bin/sudo-update-grub
deleted file mode 100755
index 5d67823..0000000
--- a/dotfiles/common/.local/bin/sudo-update-grub
+++ /dev/null
@@ -1 +0,0 @@
-sudo grub-mkconfig -o /boot/grub/grub.cfg
diff --git a/dotfiles/common/.local/bin/sysupdate b/dotfiles/common/.local/bin/sysupdate
deleted file mode 100755
index 357348d..0000000
--- a/dotfiles/common/.local/bin/sysupdate
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# Craig Jennings <c@cjennings.net>
-
-
-yay -Syu --noconfirm \ No newline at end of file
diff --git a/dotfiles/common/.local/bin/transadd b/dotfiles/common/.local/bin/transadd
deleted file mode 100755
index a598fad..0000000
--- a/dotfiles/common/.local/bin/transadd
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-# Mimeapp script for adding torrent to transmission-daemon, but will also start the daemon first if not running.
-
-# transmission-daemon sometimes fails to take remote requests in its first moments, hence the sleep.
-
-pidof transmission-daemon >/dev/null || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}")
-
-transmission-remote -a "$@" && notify-send "🔽 Torrent added."
diff --git a/dotfiles/common/.local/bin/update-backup-repositories b/dotfiles/common/.local/bin/update-backup-repositories
deleted file mode 100755
index a91b438..0000000
--- a/dotfiles/common/.local/bin/update-backup-repositories
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-# Craig Jennings <c@cjennings.net>
-# updates or clones repositories for backup
-
-REPOS_HOME="/media/backup/repositories/"
-
-# Create REPOS_HOME dir if not exists
-if [ ! -d "$REPOS_HOME" ]; then
- mkdir -p "$REPOS_HOME"
-fi
-
-# Make sure REPOS_HOME dir is writable
-if [ ! -w "$REPOS_HOME" ]; then
- echo "Directory $REPOS_HOME is not writable."
- exit 1
-fi
-
-# Make sure git is available
-if ! command -v git >/dev/null 2>&1; then
- echo "Git command does not exist. Please install git."
- exit 1
-fi
-
-cd "$REPOS_HOME"
-
-repos="
-git@cjennings.net:archsetup.git
-git@cjennings.net:dmenu.git
-git@cjennings.net:dotemacs.git
-git@cjennings.net:dotfiles.git
-git@cjennings.net:dwm.git
-git@cjennings.net:pinentry-dmenu.git
-git@cjennings.net:rsyncshot.git
-git@cjennings.net:st.git
-git@github.com:cjennings/emacs-wttrin.git
-https://github.com/d12frosted/elpa-mirror.git
-https://github.com/mirrors/emacs.git
-"
-
-for repo in $repos; do
- dir=$(echo "$repo" | awk -F'[/:]' '{gsub(/.git/, "", $NF); print $NF}')
- # Note on the above awk command:
- # awk -F'[/:]': uses awk with a regex field delimiter that matches both : and /
- # which will work with both ssh and http style URLs.
- # '{gsub(/.git/, "", $NF); print $NF}: This removes the ".git" postfixes from the last field ($NF)
- # which leaves only the repo name.
-
- fullpath="$REPOS_HOME$dir"
- if [ -d "$fullpath" ]; then
- echo "Repository $dir exists at $fullpath, pulling..."
- (cd "$fullpath" && git pull)
- else
- echo "Repository $dir doesn't exist at $fullpath, cloning..."
- cd "$REPOS_HOME" && git clone --depth 1 "$repo" "$fullpath"
- fi
-done
diff --git a/dotfiles/common/.local/bin/virtstart b/dotfiles/common/.local/bin/virtstart
deleted file mode 100755
index f9a326f..0000000
--- a/dotfiles/common/.local/bin/virtstart
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-# launch a virtual machine in fullscreen.
-# the argument is the machine name
-
-export LIBVIRT_DEFAULT_URI="qemu:///system"
-
-/usr/bin/virsh start $1
-/usr/bin/virt-viewer -f -w -a $1
diff --git a/dotfiles/common/.local/bin/ytp b/dotfiles/common/.local/bin/ytp
deleted file mode 100755
index c24d50f..0000000
--- a/dotfiles/common/.local/bin/ytp
+++ /dev/null
@@ -1 +0,0 @@
-yt-dlp --ignore-config --yes-playlist --embed-metadata -i -o '%(channel)s-%(playlist_title)s-%(playlist_index)s-%(title)s.%(ext)s' $1 $2 $3 $4
diff --git a/dotfiles/common/.zshrc.d/media.sh b/dotfiles/common/.zshrc.d/media.sh
index 92fe2ce..a5d54f1 100644
--- a/dotfiles/common/.zshrc.d/media.sh
+++ b/dotfiles/common/.zshrc.d/media.sh
@@ -18,12 +18,12 @@ alias ttdl="tsp tidal-dl -l"
# YouTube (yt-dlp)
# =============================================================================
# Video - single
-alias yt="yt-dlp --ignore-config --no-playlist --add-metadata -i -o '%(channel)s-%(title)s.%(ext)s'"
-alias tyt="tsp yt-dlp --ignore-config --no-playlist --add-metadata -i -o '%(channel)s-%(title)s.%(ext)s'"
+alias yt="yt-dlp --ignore-config --no-playlist --embed-metadata -i -o '%(channel)s-%(title)s.%(ext)s'"
+alias tyt="tsp yt-dlp --ignore-config --no-playlist --embed-metadata -i -o '%(channel)s-%(title)s.%(ext)s'"
# Video - playlist
-alias ytp="yt-dlp --ignore-config --yes-playlist --add-metadata -i -o '%(channel)s-%(playlist_title)s-%(playlist_index)s-%(title)s.%(ext)s'"
-alias tytp="tsp yt-dlp --ignore-config --yes-playlist --add-metadata -i -o '%(channel)s-%(playlist_title)s-%(playlist_index)s-%(title)s.%(ext)s'"
+alias ytp="yt-dlp --ignore-config --yes-playlist --embed-metadata -i -o '%(channel)s-%(playlist_title)s-%(playlist_index)s-%(title)s.%(ext)s'"
+alias tytp="tsp yt-dlp --ignore-config --yes-playlist --embed-metadata -i -o '%(channel)s-%(playlist_title)s-%(playlist_index)s-%(title)s.%(ext)s'"
# Audio - single
alias yta="yt-dlp --ignore-config --no-playlist -x -f bestaudio/best -o '%(artist)s-%(title)s.%(ext)s'"