From c2b706ff2f3aa42d58a03febad1d1b8f8d5a1142 Mon Sep 17 00:00:00 2001 From: bdunahu Date: Sun, 4 Jan 2026 13:13:39 -0700 Subject: remove unnecessary nested guix dir --- .../home/bdunahu/files/.local/bin/bkup-home | 6 -- .../home/bdunahu/files/.local/bin/fetch-album | 38 -------- .../kolwynia/home/bdunahu/files/.local/bin/guix-gc | 7 -- .../home/bdunahu/files/.local/bin/mail-string | 4 - .../home/bdunahu/files/.local/bin/sort-music | 101 --------------------- .../home/bdunahu/files/.local/bin/string-weather | 3 - .../home/bdunahu/files/.local/bin/t1-string | 17 ---- .../home/bdunahu/files/.local/bin/tag-media | 44 --------- .../bdunahu/files/.local/bin/touchpad-defaults | 6 -- .../home/bdunahu/files/.local/bin/unfreeze | 8 -- guix/kolwynia/home/bdunahu/files/.local/bin/upload | 43 --------- .../home/bdunahu/files/.local/bin/xkeyboard-auto | 12 --- .../home/bdunahu/files/.local/bin/xkeyboard-layout | 12 --- .../home/bdunahu/files/.local/bin/xkeyboard-toggle | 5 - .../home/bdunahu/files/.local/bin/xrandr-refresh | 10 -- .../home/bdunahu/files/.local/bin/xrandr-toggle | 15 --- guix/kolwynia/home/bdunahu/files/.local/bin/xxinit | 6 -- 17 files changed, 337 deletions(-) delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/bkup-home delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/fetch-album delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/guix-gc delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/mail-string delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/sort-music delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/string-weather delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/t1-string delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/tag-media delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/touchpad-defaults delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/unfreeze delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/upload delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-auto delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-layout delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-toggle delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/xrandr-refresh delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/xrandr-toggle delete mode 100755 guix/kolwynia/home/bdunahu/files/.local/bin/xxinit (limited to 'guix/kolwynia/home/bdunahu/files/.local') diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/bkup-home b/guix/kolwynia/home/bdunahu/files/.local/bin/bkup-home deleted file mode 100755 index b2d31b6..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/bkup-home +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -cryptsetup open /dev/sdb1 bkup -mount /dev/mapper/bkup /mnt - -rsync -aPHAXSu --inplace --delete /home/ /mnt/ diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/fetch-album b/guix/kolwynia/home/bdunahu/files/.local/bin/fetch-album deleted file mode 100755 index 3885f88..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/fetch-album +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -err() { echo "Usage: - rename [OPTIONS] -Options: - -d: delimiter - -a: artist/author - -A: album/book title - -y: year of publication -You will be prompted for these fields if not given." && exit 1 ;} - -[ "$PWD" = "${HOME}/ik/tmp" ] || { echo "Unsafe directory!" && exit 1 ;} - -while getopts "d:a:A:y:" o; do case "${o}" in - d) delimiter="${OPTARG}" ;; - a) artist="${OPTARG}" ;; - A) album="${OPTARG}" ;; - y) year="${OPTARG}" ;; - *) printf "Invalid option: -%s\\n" "$OPTARG" && err ;; - esac done -files=(*) -echo "Reference: ${files[0]}" -[ -z "$delimiter" ] && echo "What are the delimiters for these files?" && read -r delimiter -echo "Which index contains the track title? (Starting from 1)" && read -r index - -[ -z "$artist" ] && echo 'Enter an artist.' && read -r artist -[ -z "$album" ] && echo 'Enter an album.' && read -r album -[ -z "$year" ] && echo 'Enter a year.' && read -r year - -for file in *; -do - extension=$(echo $file | awk -F "." '{print $NF}') - title=$(echo $file | awk -F "${delimiter}" "{print \$${index}}" | - sed -re 's/^[[:blank:]]+|[[:blank:]]+$//g' -e 's/[[:blank:]]+/ /g') - new_file="${title}_${artist}_${album}_${year}.${extension}" - mv "./$file" "./$new_file" - tag-media -a "${artist}" -t "${title}" -A "${album}" -d "${year}" "${new_file}" -done diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/guix-gc b/guix/kolwynia/home/bdunahu/files/.local/bin/guix-gc deleted file mode 100755 index 23a423b..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/guix-gc +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -sudo guix system delete-generations 2w -guix home delete-generations 2w -guix package --delete-generations=2w -guix pull --delete-generations=2w -guix gc diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/mail-string b/guix/kolwynia/home/bdunahu/files/.local/bin/mail-string deleted file mode 100755 index e4f1d20..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/mail-string +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -mail="$(find /home/bdunahu/.ml/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f 2>/dev/null | wc -l)" -echo -n "${mail}M" diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/sort-music b/guix/kolwynia/home/bdunahu/files/.local/bin/sort-music deleted file mode 100755 index 013f194..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/sort-music +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env -S guix shell python -- python3 - -''' Imports ''' -import argparse -import logging -import sys -import glob -import os - -''' Global variables ''' -logger = logging.getLogger('sort_music.py') - -'''-----------------------------------------''' - -def parse_arguments(): - ''' Parse command line arguments ''' - parser = argparse.ArgumentParser() - parser.add_argument('-a', '--album', help='EXACT album name shared across designated files.', - required=True) - parser.add_argument('-f', '--format', help='ncmpcpp format of files. Default is %t_%a_%b_%y. Read the documentation for that program for more information. It MUST include an artist name (%a) and year (%y).', - default="%t_%a_%b_%y") - parser.add_argument('-v', '--verbose', help='Enable full debug output.', - action='store_true') - return parser.parse_args() - - - -def configure_logs(verbose): - ''' Configure program logging level ''' - level = logging.DEBUG if verbose else logging.INFO - - ''' Configure stream handler ''' - stream_handler = logging.StreamHandler(sys.stdout) - stream_handler.setFormatter(logging.Formatter('%(name)s - %(levelname)s - %(message)s')) - - ''' For main logger ''' - logger.addHandler(stream_handler) - logger.setLevel(level) - -'''-----------------------------------------''' - -class SortMusic(): - def __init__(self, logger, args): - self.logger = logger - self.album = args.album - self.delimiter = args.format[2] - self.artist_index = args.format.split(self.delimiter).index('%a') - self.year_index = args.format.split(self.delimiter).index('%y') - - logger.info(f'Starting rename with file extension {self.album} and artist_index {self.artist_index}') - - self.files = None # list of relevant files in specified directory - self.artist = None - self.year = None - - - def run(self): - self._find_files() - self._prompt() - self._organize() - - - def _find_files(self): - self.files = list(glob.glob(f"*{self.album}*")) - if len(self.files) == 0: - self.logger.error(f'Files in this album NOT found!') - exit(1) - - self.artist = self.files[0].split(self.delimiter).pop(self.artist_index).rsplit(".",1)[0] # remove file extension (sometimes occurs) - self.year = self.files[0].split(self.delimiter).pop(self.year_index).rsplit(".",1)[0] - - def _prompt(self): - self.logger.info(f'Found {len(self.files)} files written by {self.artist} in {self.year}.') - quit = input(f'Files will now be organized (y/n)\t').lower() - - if not quit.startswith('y'): - exit(1) - - def _organize(self): - path = f'./{self.artist}/({self.year}) {self.album}' - if not os.path.exists(path): - logger.info(f'Creating previously missing path {path}') - os.makedirs(path) - for file in self.files: - os.rename(f'./{file}', f'{path}/{file}') - -'''-----------------------------------------''' - -def main(): - ''' This is the main function ''' - args = parse_arguments() - configure_logs(args.verbose) - - ''' Initialize and run ''' - sorter = SortMusic(logger, args) - sorter.run() - - - -if __name__ == '__main__': - main() diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/string-weather b/guix/kolwynia/home/bdunahu/files/.local/bin/string-weather deleted file mode 100755 index 01ece24..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/string-weather +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -curl wttr.in/Amherst?format="%x+%t+%m\n" diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/t1-string b/guix/kolwynia/home/bdunahu/files/.local/bin/t1-string deleted file mode 100755 index ffdd61a..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/t1-string +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -loop=$(cat /tmp/t1 | jq .stat | tr -d '"') -[ -n "$loop" ] && echo -n "${loop} " -bg=$(cat /tmp/t1 | jq .bg) -[ -n "$bg" ] && echo -n "${bg}B " -iob=$(cat /tmp/t1 | jq .iob) -[ -n "$iob" ] && echo -n " ${iob}U" -rbat=$(cat /tmp/t1 | jq .rbat) -[ -n "$rbat" ] && [ "$rbat" -lt 25 ] && echo -n " RB" -res=$(echo "$(cat /tmp/t1 | jq .res) * 100 / 1" | bc) -[ -n "$res" ] && [ "$res" -lt 2500 ] && echo -n " PR" -pbat=$(echo "$(cat /tmp/t1 | jq .pbat) * 100 / 1" | bc) -[ -n "$pbat" ] && [ "$pbat" -lt 136 ] && echo -n " PB" -cage=$(cat /tmp/t1 | jq .cage) -[ -n "$cage" ] && [ 14 -lt "$cage" ] && echo -n " CA" -echo -n diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/tag-media b/guix/kolwynia/home/bdunahu/files/.local/bin/tag-media deleted file mode 100755 index 64b4586..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/tag-media +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -err() { echo "Usage: - tag [OPTIONS] file -Options: - -a: artist/author - -t: song/chapter title - -A: album/book title - -d: year of publication - -g: genre - -c: comment -You will be prompted for title, artist, album and date if not given." && exit 1 ;} - -while getopts "a:t:A:d:g:c:" o; do case "${o}" in - a) artist="${OPTARG}" ;; - t) title="${OPTARG}" ;; - A) album="${OPTARG}" ;; - d) date="${OPTARG}" ;; - g) genre="${OPTARG}" ;; - c) comment="${OPTARG}" ;; - *) printf "Invalid option: -%s\\n" "$OPTARG" && err ;; - esac done - -shift $((OPTIND - 1)) - -file="$1" - -temp="$(mktemp -p "$(dirname "$file")")" -trap 'rm -f $temp' HUP INT QUIT TERM PWR EXIT - -[ ! -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 "$date" ] && echo 'Enter a date.' && read -r date - -cp -f "$file" "$temp" && ffmpeg -i "$temp" -map 0 -y -codec copy \ - -metadata title="$title" \ - -metadata album="$album" \ - -metadata artist="$artist" \ - -metadata date="$date" \ - ${genre:+-metadata genre="$genre"} \ - ${comment:+-metadata comment="$comment"} "$file" diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/touchpad-defaults b/guix/kolwynia/home/bdunahu/files/.local/bin/touchpad-defaults deleted file mode 100755 index 6c07797..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/touchpad-defaults +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# see: -# xinput --list -# xinput --list-props 'ELAN0412:00 04F3:311D Touchpad' -[[ $HOSTNAME == "garmr" ]] && xinput --set-prop "ELAN0412:00 04F3:311D Touchpad" "libinput Tapping Enabled" 1 diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/unfreeze b/guix/kolwynia/home/bdunahu/files/.local/bin/unfreeze deleted file mode 100755 index 072473d..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/unfreeze +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -epid=$(pidof emacs) - -kill -USR2 "$epid" -kill -USR1 "$epid" - -echo "Done." diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/upload b/guix/kolwynia/home/bdunahu/files/.local/bin/upload deleted file mode 100755 index a2db9b5..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/upload +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - - -err() { echo "Usage: - upload [OPTIONS] -Options: - -t: time from now to expire in hours (default: 48) - file: a path to a file. If this is not given, receives input from stdin." && exit 1 ;} - -hours=48 - -while getopts ":t:" opt; do - case $opt in - t) - hours=$OPTARG - if [[ $OPTARG =~ ^-?[0-9]+$ ]]; then - hours=$OPTARG - else - err - fi - ;; - *) - err - ;; - esac -done - -shift $((OPTIND -1)) - -if [ -n "$1" ] && [ -f "$1" ]; then - source="$1" - ext="${1##*.}" -else - source=$(mktemp) - ext="txt" - cat > "$source" - chmod a+r "$source" -fi - -dest="$(cat /dev/random | tr -dc 'a-zA-Z0-9' | fold -w 4 | head -n 1)-$(date -d "+$hours hours" +%s).$ext" - -scp "$source" "root@operationnull.com:/var/www/operationnull/paste/$dest" && - echo "https://operationnull.com/paste/$dest" diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-auto b/guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-auto deleted file mode 100755 index b81ced4..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-auto +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -/home/bdunahu/.local/bin/xkeyboard-toggle -while true; -do - if [ -f /tmp/keyboard_plugged ]; then - rm /tmp/keyboard_plugged - sleep 2 - /home/bdunahu/.local/bin/xkeyboard-toggle - fi - sleep 1 -done diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-layout b/guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-layout deleted file mode 100755 index de6f7a2..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-layout +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -WORKMAN=$(setxkbmap -print | grep "workman") -echo $WORKMAN - -if [ -z WORKMAN ]; then - xkbcomp -I$HOME/.xkb ~/.xkb/keymap/standard $DISPLAY && - echo 'Switched to standard layout.' -else - test -f ~/.xkb/symbols/rocket && xkbcomp -I$HOME/.xkb ~/.xkb/keymap/rocket $DISPLAY && - echo 'Switched to workman layout.' -fi diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-toggle b/guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-toggle deleted file mode 100755 index 70f9516..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/xkeyboard-toggle +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -xset r rate 250 70 -xset s 600 -xkbcomp -I$HOME/.xkb ~/.xkb/keymap/standard $DISPLAY diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/xrandr-refresh b/guix/kolwynia/home/bdunahu/files/.local/bin/xrandr-refresh deleted file mode 100755 index c9d55c5..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/xrandr-refresh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -declare -i count=2 -declare -i seconds=1 - -while ((count)); do - xrandr >/dev/null - sleep $seconds - ((count--)) -done \ No newline at end of file diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/xrandr-toggle b/guix/kolwynia/home/bdunahu/files/.local/bin/xrandr-toggle deleted file mode 100755 index 6acff6d..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/xrandr-toggle +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -intern=eDP-1 -extern=DP-1 -extern2=HDMI-1 - -if xrandr | grep "$extern disconnected" >/dev/null; then - xrandr --output "$extern" --off --output "$intern" --mode 1920x1080 --auto -# usually, HDMI-1 is a 2560x1440 screen, so cannot be duplicated well -elif xrandr | grep "$extern2 connected" >/dev/null; then - xrandr --output "$extern2" --primary --mode 1920x1080 --auto --same-as "$intern" -else - xrandr --output "$extern" --primary --mode 1920x1080 --auto --same-as "$intern" -fi - -echo "xrandr done!" diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/xxinit b/guix/kolwynia/home/bdunahu/files/.local/bin/xxinit deleted file mode 100755 index 1ec9a82..0000000 --- a/guix/kolwynia/home/bdunahu/files/.local/bin/xxinit +++ /dev/null @@ -1,6 +0,0 @@ - #!/bin/sh - -DIR=/home/bdunahu/.guix-home/profile/ -$DIR/bin/xinit -- $DIR/bin/Xorg :0 vt1 -keeptty \ - -configdir $DIR/share/X11/xorg.conf.d \ - -modulepath $DIR/lib/xorg/modules -- cgit v1.2.3