toyotacorolla

vroom
git clone https://git.davidvoz.net/toyotacorolla.git
Log | Files | Refs

commit 85e8f20525fec93a51300c9793bca6378e99b5c0
parent 38cca2d06a2f4b3f46e2ce5a3a85b79af7f6cca1
Author: David Voznyarskiy <31452046-davidvoz@users.noreply.gitlab.com>
Date:   Tue, 23 Dec 2025 23:14:27 -0800

added rest of .local/bin

Diffstat:
Achangemacaddress | 7+++++++
Agivefilesextensions | 25+++++++++++++++++++++++++
Akeyboardlayouts | 16++++++++++++++++
Anote | 25+++++++++++++++++++++++++
Arand | 118+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aweather | 10++++++++++
Axel | 5+++++
7 files changed, 206 insertions(+), 0 deletions(-)

diff --git a/changemacaddress b/changemacaddress @@ -0,0 +1,7 @@ +#!/bin/sh +# changes a mac address +# simply call the script + +sudo ip link set dev wlp1s0 down +sudo macchanger -r wlp1s0 +sudo ip link set dev wlp1s0 up diff --git a/givefilesextensions b/givefilesextensions @@ -0,0 +1,25 @@ +#!/bin/sh + +if [ "$#" -ne 1 ]; then + echo "Usage $0 /path/to/dir" + exit 1 +fi + +target_dir="$1" + +if [ ! -d "$target_dir" ]; then + echo "ERROR '$target_dir' is not valid" + exit 1 +fi + +for file in "$target_dir"/*; do + [ -d "$file" ] && continue + mime_type=$(file --mime-type -b "$file") + extension=$(echo "$mime_type" | awk -F'/' '{print $2}') + + if [[ ! "$file" == *".$extension" && -n "$extension" ]]; then + new_file="$file.$extension" + echo "$file -> $new_file" + mv "$file" "$new_file" + fi +done diff --git a/keyboardlayouts b/keyboardlayouts @@ -0,0 +1,16 @@ +#!/bin/sh + +layout=$(setxkbmap -query | grep layout | awk '{print $2}') + +if [ $layout == "ru" ]; then + setxkbmap -layout us -variant colemak + herbe "current layout: colemak" + exit 0 +elif [ $layout == "us" ]; then + setxkbmap -layout ru + herbe "current layout: russian" + exit 0 +else + setxkbmap -layout us -variant colemak + exit 1 +fi diff --git a/note b/note @@ -0,0 +1,25 @@ +#!/bin/sh +# this is a modified version of swindlesmccoop's note program + +NOTES_FILE=$HOME/misc/notes + +if [ "$*" = "-p" ]; then + cat "$NOTES_FILE" + exit 0 +fi + +if [ "$#" -ge 1 ]; then + echo "[$(date)]" >> "$NOTES_FILE" + echo "$*" >> "$NOTES_FILE" + echo "" >> "$NOTES_FILE" + exit 0 +fi + +nvim +startinsert /tmp/note_temp + +if [ -s /tmp/note_temp ]; then + echo "[$(date)]" >> "$NOTES_FILE" + cat /tmp/note_temp >> "$NOTES_FILE" + echo "" >> "$NOTES_FILE" + rm /tmp/note_temp +fi diff --git a/rand b/rand @@ -0,0 +1,118 @@ +#!/bin/sh + +generate_string_azAZ09Symb() { + local length=$1 + < /dev/urandom tr -dc 'A-Za-z0-9`~!@# $%^&*()-_=+[]{}|;:,.<>?/ ' | head -c "$length" +} + +generate_string_azAZ09() { + local length=$1 + < /dev/urandom tr -dc 'A-Za-z0-9' | head -c "$length" +} + +print_help() { + echo "Usage: rand [OPTION]... [LENGTH]... [FILE]..." + echo "-n, --name [INT LENGTH] [FILE] renames a file with a random name" + echo "-c, --clip [INT LENGTH] copies a random string of specified length to clipboard" + echo "-h, --help display this help message" +} + +clip() { + echo "$(generate_string_azAZ09Symb)" +} + +name(){ + local length=$1 + local file=$2 + + if [[ -z "$file" || ! -f "$file" ]]; then + echo "ERROR file not found" + exit 1 + fi + + random_name=$(generate_string_azAZ09 "$length") + mv "$file" "$random_name" + echo "renamed '$file' to '$random_name'" +} + +naming_option=0 +clip_option=0 +num_chars=0 +target_file="" + +while [[ "$1" =~ ^- ]]; do + case "$1" in + -n|--name) + naming_option=1 + shift + if [[ -n "$1" && "$1" =~ ^[0-9]+$ ]]; then + num_chars=$1 + shift + if [[ -n "$1" ]]; then + target_file=$1 + shift + else + echo "no file provided" + exit 1 + fi + else + echo "invalid or missing length for -n option" + echo "select -h option for help" + print_help + exit 1 + fi + ;; + -c|--clip) + clip_option=1 + shift + if [[ -n "$1" && "$1" =~ ^[0-9]+$ ]]; then + num_chars=$1 + shift + else + echo "invalid or missing argument for -c option" + echo "select -h option for help" + print_help + exit 1 + fi + ;; + -h|--help) + print_help + exit 0 + ;; + *) + echo "ERROR invalid option: $1" + exit 1 + ;; + esac +done + +if [ $naming_option -eq 1 ]; then + if [[ -n "$num_chars" && -n "$target_file" ]]; then + name "$num_chars" "$target_file" + exit 0 + else + echo "invalid or missing length for renaming" + print_help + exit 1 + fi +elif [ $clip_option -eq 1 ]; then + if [[ -n "$num_chars" ]]; then + random_string=$(generate_string_azAZ09Symb "$num_chars") + echo "$random_string" | xclip -selection clipboard + echo "copied" + exit 0 + else + print_help + exit 1 + fi +fi + +if [[ $# -gt 0 && "$1" =~ ^[0-9]+$ ]]; then + num_chars=$1 + random_string=$(generate_string_azAZ09Symb "$num_chars") + echo "$random_string" + exit 0 +fi + +print_help +exit 1 diff --git a/weather b/weather @@ -0,0 +1,10 @@ +#!/bin/sh +# view the weather in terminal + +curl -s 'https://forecast.weather.gov/meteograms/Plotter.php?' > /tmp/weather_chart # fill in the rest with your address + +nsxiv -z 156 -b /tmp/weather_chart & sleep 0.1 +xdotool search --onlyvisible --class nsxiv windowactivate --sync key f +wait +rm /tmp/weather_chart +exit 0 diff --git a/xel b/xel @@ -0,0 +1,5 @@ +#!/bin/sh +filename="${1%.tex}" + +xelatex "${filename}.tex" +rm -f "${filename}".log "${filename}".aux "${filename}".out "${filename}".toc