From 428458e50a2ace60a58ebf6494d6435b735ab25c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Dom=C3=ADnguez?= Date: Mon, 24 Mar 2025 12:47:13 -0400 Subject: [PATCH] add scripts --- .bin/sh/aur.sh | 2 + .bin/sh/bd.sh | 2 + .bin/sh/build.sh | 13 +++ .bin/sh/buildgames.sh | 68 ++++++++++++++ .bin/sh/catacombgl-compile.sh | 31 ++++++ .bin/sh/checkupdates.sh | 37 ++++++++ .bin/sh/crispy-doom-compile.sh | 44 +++++++++ .bin/sh/debianbox.sh | 13 +++ .bin/sh/devilutionx-compile.sh | 31 ++++++ .bin/sh/dferun.sh | 1 + .bin/sh/dhewm3-compile.sh | 36 +++++++ .bin/sh/doom64-compile.sh | 29 ++++++ .bin/sh/ecwolf-compile.sh | 34 +++++++ .bin/sh/ionfury-compile.sh | 32 +++++++ .bin/sh/iortcw-compile.sh | 30 ++++++ .bin/sh/kap.sh | 2 + .bin/sh/lap.sh | 2 + .bin/sh/nblood-compile.sh | 32 +++++++ .bin/sh/nmtui.sh | 4 + .bin/sh/openjkdf2-compile.sh | 25 +++++ .bin/sh/orphans.sh | 19 ++++ .bin/sh/pkgb.sh | 13 +++ .bin/sh/quakespasm-compile.sh | 32 +++++++ .bin/sh/reboot.sh | 12 +++ .bin/sh/rednukem-compile.sh | 32 +++++++ .bin/sh/server.sh | 2 + .bin/sh/shutdown.sh | 12 +++ .bin/sh/songdetail.sh | 5 + .bin/sh/steamskin.sh | 10 ++ .bin/sh/swaylock.sh | 2 + .bin/sh/tfe-compile.sh | 26 ++++++ .bin/sh/tv_rename.sh | 166 +++++++++++++++++++++++++++++++++ .bin/sh/update.sh | 37 ++++++++ .bin/sh/updatenew.sh | 49 ++++++++++ .bin/sh/voidsw-compile.sh | 30 ++++++ .bin/sh/weather.sh | 19 ++++ 36 files changed, 934 insertions(+) create mode 100755 .bin/sh/aur.sh create mode 100755 .bin/sh/bd.sh create mode 100755 .bin/sh/build.sh create mode 100755 .bin/sh/buildgames.sh create mode 100755 .bin/sh/catacombgl-compile.sh create mode 100755 .bin/sh/checkupdates.sh create mode 100755 .bin/sh/crispy-doom-compile.sh create mode 100755 .bin/sh/debianbox.sh create mode 100755 .bin/sh/devilutionx-compile.sh create mode 100755 .bin/sh/dferun.sh create mode 100755 .bin/sh/dhewm3-compile.sh create mode 100755 .bin/sh/doom64-compile.sh create mode 100755 .bin/sh/ecwolf-compile.sh create mode 100755 .bin/sh/ionfury-compile.sh create mode 100755 .bin/sh/iortcw-compile.sh create mode 100755 .bin/sh/kap.sh create mode 100755 .bin/sh/lap.sh create mode 100755 .bin/sh/nblood-compile.sh create mode 100755 .bin/sh/nmtui.sh create mode 100755 .bin/sh/openjkdf2-compile.sh create mode 100755 .bin/sh/orphans.sh create mode 100755 .bin/sh/pkgb.sh create mode 100755 .bin/sh/quakespasm-compile.sh create mode 100755 .bin/sh/reboot.sh create mode 100755 .bin/sh/rednukem-compile.sh create mode 100755 .bin/sh/server.sh create mode 100755 .bin/sh/shutdown.sh create mode 100755 .bin/sh/songdetail.sh create mode 100755 .bin/sh/steamskin.sh create mode 100755 .bin/sh/swaylock.sh create mode 100755 .bin/sh/tfe-compile.sh create mode 100755 .bin/sh/tv_rename.sh create mode 100755 .bin/sh/update.sh create mode 100755 .bin/sh/updatenew.sh create mode 100755 .bin/sh/voidsw-compile.sh create mode 100755 .bin/sh/weather.sh diff --git a/.bin/sh/aur.sh b/.bin/sh/aur.sh new file mode 100755 index 0000000..adb2e76 --- /dev/null +++ b/.bin/sh/aur.sh @@ -0,0 +1,2 @@ +#!/bin/sh +auracle search --quiet --searchby=name $1 | fzf --color="border:magenta,info:green,header:green,info:yellow,hl:blue,label:magenta" --multi --preview "auracle info {1}" --preview-window=up | xargs -ro auracle clone -C ~/Downloads/AUR diff --git a/.bin/sh/bd.sh b/.bin/sh/bd.sh new file mode 100755 index 0000000..163cad8 --- /dev/null +++ b/.bin/sh/bd.sh @@ -0,0 +1,2 @@ +#!/bin/sh +stat / | grep "Birth" | sed 's/Birth: //g' | cut -b 2-11 diff --git a/.bin/sh/build.sh b/.bin/sh/build.sh new file mode 100755 index 0000000..49f7bac --- /dev/null +++ b/.bin/sh/build.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Build package and prompt for cleaning + +{ +makepkg -si; +read -p "Clean leftover files? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + git clean -dxfi +fi +} diff --git a/.bin/sh/buildgames.sh b/.bin/sh/buildgames.sh new file mode 100755 index 0000000..78a55ee --- /dev/null +++ b/.bin/sh/buildgames.sh @@ -0,0 +1,68 @@ +#!/bin/sh + +# Ask for confirmation to build nblood + +{ +read -p "Build nblood? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + ~/.bin/sh/nblood-compile.sh +fi +} + +# Ask for confirmation to build rednukem + +{ +read -p "Build rednukem? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + ~/.bin/sh/rednukem-compile.sh +fi +} + + +# Ask for confirmation to build voidsw + +{ +read -p "Build voidsw? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + ~/.bin/sh/voidsw-compile.sh +fi +} + +# Ask for confirmation to build eduke32 + +{ +read -p "Build eduke32? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + ~/.bin/sh/ionfury-compile.sh +fi +} + +# Ask for confirmation to build vkquake + +{ +read -p "Build Quakespasm-spiked? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + ~/.bin/sh/quakespasm-compile.sh +fi +} + +# Ask for confirmation to build crispy-doom + +{ +read -p "Build crispy-doom? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + ~/.bin/sh/crispy-doom-compile.sh +fi +} diff --git a/.bin/sh/catacombgl-compile.sh b/.bin/sh/catacombgl-compile.sh new file mode 100755 index 0000000..6958305 --- /dev/null +++ b/.bin/sh/catacombgl-compile.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://github.com/ArnoAnsems/CatacombGL; +} + +# Build binary + +{ +cd CatacombGL; +mkdir build; +} + +# Install executable @ ~/.bin + +{ +cd build; +mv /home/peter/.bin/catacombgl/CatacombGL /home/peter/.bin/catacombgl/.old; +cmake ..; +make -j12; +cp /home/peter/Downloads/git/CatacombGL/build/CatacombGL /home/peter/.bin/catacombgl; +chmod 755 /home/peter/.bin/catacombgl/CatacombGL; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/CatacombGL; +} diff --git a/.bin/sh/checkupdates.sh b/.bin/sh/checkupdates.sh new file mode 100755 index 0000000..eaf9a42 --- /dev/null +++ b/.bin/sh/checkupdates.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# Check for system updates + +{ +echo -e "\e[94mChecking Official packages updates... +\e[39m------------------------------------- +" +checkupdates +echo -e "\e[91m +Checking AUR packages updates... +\e[39m-------------------------------- +" +auracle outdated +} + +# Perform system check + +{ +read -p "Check for errors and failed services? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + systemctl --failed && journalctl -p 3 -b --since today +fi +} + +# Perform update + +{ +read -p "Perform system update? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + ~/.bin/sh/update.sh +fi +} diff --git a/.bin/sh/crispy-doom-compile.sh b/.bin/sh/crispy-doom-compile.sh new file mode 100755 index 0000000..a786c73 --- /dev/null +++ b/.bin/sh/crispy-doom-compile.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://github.com/fabiangreffrath/crispy-doom.git; +} + +# Build binary + +{ +cd crispy-doom; +autoreconf -fiv; +./configure; +make; +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/crispy-doom; +mv /home/peter/.bin/crispy-doom/crispy-doom /home/peter/.bin/crispy-doom/.old; +mv /home/peter/.bin/crispy-heretic/crispy-heretic /home/peter/.bin/crispy-heretic/.old; +mv /home/peter/.bin/crispy-hexen/crispy-hexen /home/peter/.bin/crispy-hexen/.old; +mv /home/peter/.bin/crispy-doom/crispy-doom-setup /home/peter/.bin/crispy-doom/.old; +mv /home/peter/.bin/crispy-heretic/crispy-heretic-setup /home/peter/.bin/crispy-heretic/.old; +mv /home/peter/.bin/crispy-hexen/crispy-hexen-setup /home/peter/.bin/crispy-hexen/.old; +cd /home/peter/Downloads/git/crispy-doom; +cp /home/peter/Downloads/git/crispy-doom/src/crispy-doom /home/peter/.bin/crispy-doom; +cp /home/peter/Downloads/git/crispy-doom/src/crispy-heretic /home/peter/.bin/crispy-heretic; +cp /home/peter/Downloads/git/crispy-doom/src/crispy-hexen /home/peter/.bin/crispy-hexen; +cp /home/peter/Downloads/git/crispy-doom/src/crispy-doom-setup /home/peter/.bin/crispy-doom; +cp /home/peter/Downloads/git/crispy-doom/src/crispy-heretic-setup /home/peter/.bin/crispy-heretic; +cp /home/peter/Downloads/git/crispy-doom/src/crispy-hexen-setup /home/peter/.bin/crispy-hexen; +chmod 755 /home/peter/.bin/crispy-doom/crispy-doom; +chmod 755 /home/peter/.bin/crispy-heretic/crispy-heretic; +chmod 755 /home/peter/.bin/crispy-hexen/crispy-hexen; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/crispy-doom; +} diff --git a/.bin/sh/debianbox.sh b/.bin/sh/debianbox.sh new file mode 100755 index 0000000..bca505c --- /dev/null +++ b/.bin/sh/debianbox.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Ask to connect to server via SSH + +{ +read -p "Connect to server via SSH? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + ssh kitty +kitten ssh debianbox +fi +} + diff --git a/.bin/sh/devilutionx-compile.sh b/.bin/sh/devilutionx-compile.sh new file mode 100755 index 0000000..634c8cc --- /dev/null +++ b/.bin/sh/devilutionx-compile.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://github.com/diasurgical/devilutionX.git; +} + +# Build binary + +{ +cd devilutionX; +cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DDEVILUTIONX_SYSTEM_LIBSODIUM=OFF -DDEVILUTIONX_STATIC_LIBSODIUM=ON; +cmake --build build -j $(getconf _NPROCESSORS_ONLN); +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/devilutionx; +mv /home/peter/.bin/devilutionx/devilutionx /home/peter/.bin/devilutionx/.old; +cp -r /home/peter/Downloads/git/devilutionX/build/devilutionx /home/peter/.bin/devilutionx; +cp -r /mnt/M2/Downloads/git/devilutionX/assets /home/peter/.bin/devilutionx; +chmod 755 /home/peter/.bin/devilutionx/devilutionx; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/devilutionX; +} diff --git a/.bin/sh/dferun.sh b/.bin/sh/dferun.sh new file mode 100755 index 0000000..fdbd3fa --- /dev/null +++ b/.bin/sh/dferun.sh @@ -0,0 +1 @@ +cd /home/peter/.bin/tfe && ./theforceengine diff --git a/.bin/sh/dhewm3-compile.sh b/.bin/sh/dhewm3-compile.sh new file mode 100755 index 0000000..4626b7c --- /dev/null +++ b/.bin/sh/dhewm3-compile.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://github.com/dhewm/dhewm3.git; +} + +# Build binary + +{ +mkdir /home/peter/Downloads/git/dhewm3/build; +cd /home/peter/Downloads/git/dhewm3/build; +cmake ../neo/; +make -j12; +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/dhewm3; +mv /home/peter/.bin/dhewm3/dhewm3 /home/peter/.bin/dhewm3/.old; +mv /home/peter/.bin/dhewm3/base.so /home/peter/.bin/dhewm3/.old; +mv /home/peter/.bin/dhewm3/d3xp.so /home/peter/.bin/dhewm3/.old; +cp /home/peter/Downloads/git/dhewm3/build/dhewm3 /home/peter/.bin/dhewm3; +cp /home/peter/Downloads/git/dhewm3/build/base.so /home/peter/.bin/dhewm3; +cp /home/peter/Downloads/git/dhewm3/build/d3xp.so /home/peter/.bin/dhewm3; +cd /home/peter/.bin/dhewm3; +chmod 755 /home/peter/.bin/dhewm3/dhewm3; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/dhewm3; +} diff --git a/.bin/sh/doom64-compile.sh b/.bin/sh/doom64-compile.sh new file mode 100755 index 0000000..9a20143 --- /dev/null +++ b/.bin/sh/doom64-compile.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://github.com/atsb/Doom64EX-Plus.git; +} + +# Build binary + +{ +cd /home/peter/Downloads/git/Doom64EX-Plus/src/engine; +bash /home/peter/Downloads/git/Doom64EX-Plus/src/engine/build.sh; +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/Doom64EX-Plus; +mv /home/peter/.bin/Doom64EX-Plus/DOOM64EX-Plus /home/peter/.bin/Doom64EX-Plus/.old; +cp /home/peter/Downloads/git/Doom64EX-Plus/src/engine/DOOM64EX-Plus /home/peter/.bin/Doom64EX-Plus; +chmod 755 /home/peter/.bin/Doom64EX-Plus/DOOM64EX-Plus; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/Doom64EX-Plus; +} diff --git a/.bin/sh/ecwolf-compile.sh b/.bin/sh/ecwolf-compile.sh new file mode 100755 index 0000000..ca72a56 --- /dev/null +++ b/.bin/sh/ecwolf-compile.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://bitbucket.org/ecwolf/ecwolf.git; +} + +# Build binary + +{ +mkdir -pv /home/peter/Downloads/git/ecwolf/build; +cd /home/peter/Downloads/git/ecwolf/build; +cmake .. -DCMAKE_BUILD_TYPE=Release -DGPL=ON; +make; +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/ecwolf; +mv /home/peter/.bin/ecwolf/ecwolf /home/peter/.bin/ecwolf/.old; +mv /home/peter/.bin/ecwolf/ecwolf.pk3 /home/peter/.bin/ecwolf/.old; +cp /home/peter/Downloads/git/ecwolf/build/ecwolf /home/peter/.bin/ecwolf; +cp /home/peter/Downloads/git/ecwolf/build/ecwolf.pk3 /home/peter/.bin/ecwolf; +cd /home/peter/.bin/ecwolf; +chmod 755 /home/peter/.bin/ecwolf/ecwolf; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/ecwolf; +} diff --git a/.bin/sh/ionfury-compile.sh b/.bin/sh/ionfury-compile.sh new file mode 100755 index 0000000..08aaa89 --- /dev/null +++ b/.bin/sh/ionfury-compile.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://voidpoint.io/terminx/eduke32.git; +} + +# Build binary + +{ +cd eduke32; +make; +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/eduke32; +mv /home/peter/.bin/eduke32/eduke32 /home/peter/.bin/eduke32/.old; +mv /home/peter/.bin/eduke32/mapster32 /home/peter/.bin/eduke32/.old; +cd /home/peter/Downloads/git/eduke32; +cp /home/peter/Downloads/git/eduke32/eduke32 /home/peter/.bin/eduke32; +cp /home/peter/Downloads/git/eduke32/mapster32 /home/peter/.bin/eduke32; +chmod 755 /home/peter/.bin/eduke32/eduke32; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/eduke32; +} diff --git a/.bin/sh/iortcw-compile.sh b/.bin/sh/iortcw-compile.sh new file mode 100755 index 0000000..8fb4833 --- /dev/null +++ b/.bin/sh/iortcw-compile.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://github.com/iortcw/iortcw.git; +} + +# Build binary + +{ +cd /home/peter/Downloads/git/iortcw/SP; +make -j12; +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/iortcw; +mv /home/peter/.bin/iortcw/* /home/peter/.bin/iortcw/.old; +cp -r /home/peter/Downloads/git/iortcw/SP/build/*/* /home/peter/.bin/iortcw; +cd /home/peter/.bin/iortcw; +chmod 755 /home/peter/.bin/iortcw/iowolfsp.x86_64; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/iortcw; +} diff --git a/.bin/sh/kap.sh b/.bin/sh/kap.sh new file mode 100755 index 0000000..f77e386 --- /dev/null +++ b/.bin/sh/kap.sh @@ -0,0 +1,2 @@ +#!/bin/sh +pacman -Qq | fzf --color="border:magenta,info:green,header:green,info:yellow,hl:blue,label:magenta" --multi --preview "pacman -Qi {1}" --preview-window=up | xargs -ro sudo pacman -R diff --git a/.bin/sh/lap.sh b/.bin/sh/lap.sh new file mode 100755 index 0000000..48508de --- /dev/null +++ b/.bin/sh/lap.sh @@ -0,0 +1,2 @@ +#!/bin/sh +pacman -Slq | fzf --color="border:magenta,info:green,header:green,info:yellow,hl:blue,label:magenta" --multi --preview "pacman -Si {1}" --preview-window=up | xargs -ro sudo pacman -S diff --git a/.bin/sh/nblood-compile.sh b/.bin/sh/nblood-compile.sh new file mode 100755 index 0000000..98aea77 --- /dev/null +++ b/.bin/sh/nblood-compile.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://github.com/nukeykt/NBlood.git; +} + +# Build binary + +{ +cd NBlood; +make blood; +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/NBlood; +mv /home/peter/.bin/NBlood/nblood /home/peter/.bin/NBlood/.old; +mv /home/peter/.bin/NBlood/nblood.pk3 /home/peter/.bin/NBlood/.old; +cd /home/peter/Downloads/git/NBlood; +cp /home/peter/Downloads/git/NBlood/nblood /home/peter/.bin/NBlood; +cp /home/peter/Downloads/git/NBlood/nblood.pk3 /home/peter/.bin/NBlood; +chmod 755 /home/peter/.bin/NBlood/nblood; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/NBlood; +} diff --git a/.bin/sh/nmtui.sh b/.bin/sh/nmtui.sh new file mode 100755 index 0000000..27ccbab --- /dev/null +++ b/.bin/sh/nmtui.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Execute kitty with nmtui +exec kitty --single-instance -e nmtui diff --git a/.bin/sh/openjkdf2-compile.sh b/.bin/sh/openjkdf2-compile.sh new file mode 100755 index 0000000..54bc24c --- /dev/null +++ b/.bin/sh/openjkdf2-compile.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +mv /home/peter/.bin/openjkdf2/OpenJKDF2 /home/peter/.bin/openjkdf2/.old; +cd /home/peter/.bin/openjkdf2; +git clone https://github.com/shinyquagsire23/OpenJKDF2.git; +cd OpenJKDF2; +} + +# Build binary + +{ +git submodule update --init +export CC=clang; +export CXX=clang++; +chmod +x build_linux64.sh; +./build_linux64.sh; +} + +# Install executable @ ~/.bin + +{ +chmod 755 /home/peter/.bin/openjkdf2/OpenJKDF2/build_linux64/openjkdf2; +} diff --git a/.bin/sh/orphans.sh b/.bin/sh/orphans.sh new file mode 100755 index 0000000..1b5d35b --- /dev/null +++ b/.bin/sh/orphans.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Check for orphans then asks for removal + +{ +while [[ $(pacman -Qtdq) ]]; + do + pacman -Qtdq; + read -p "Remove orphaned packages? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + sudo pacman -R $(pacman -Qtdq) +elif [[ -n $(pacman -Qtdq) ]]; + then + exit +fi +done +} diff --git a/.bin/sh/pkgb.sh b/.bin/sh/pkgb.sh new file mode 100755 index 0000000..afc6774 --- /dev/null +++ b/.bin/sh/pkgb.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +#Check PKGBUILD file + +{ +less PKGBUILD; +read -p "Build package? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + ~/.bin/sh/build.sh +fi +} diff --git a/.bin/sh/quakespasm-compile.sh b/.bin/sh/quakespasm-compile.sh new file mode 100755 index 0000000..e20811a --- /dev/null +++ b/.bin/sh/quakespasm-compile.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://github.com/Shpoike/Quakespasm.git; +} + +# Build binary + +{ +cd /home/peter/Downloads/git/Quakespasm/Quake; +make; +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/Quakespasm; +mv /home/peter/.bin/Quakespasm/quakespasm /home/peter/.bin/Quakespasm/.old; +mv /home/peter/.bin/Quakespasm/quakespasm.pak /home/peter/.bin/Quakespasm/.old; +cd /home/peter/Downloads/git/Quakespasm/Quake; +cp /home/peter/Downloads/git/Quakespasm/Quake/quakespasm /home/peter/.bin/Quakespasm; +cp /home/peter/Downloads/git/Quakespasm/Quake/quakespasm.pak /home/peter/.bin/Quakespasm; +chmod 755 /home/peter/.bin/Quakespasm; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/Quakespasm; +} diff --git a/.bin/sh/reboot.sh b/.bin/sh/reboot.sh new file mode 100755 index 0000000..4d40b4d --- /dev/null +++ b/.bin/sh/reboot.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Prompt Reboot + +{ +read -p "Reboot now? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + command shutdown -r now +fi +} diff --git a/.bin/sh/rednukem-compile.sh b/.bin/sh/rednukem-compile.sh new file mode 100755 index 0000000..e5b5e22 --- /dev/null +++ b/.bin/sh/rednukem-compile.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://github.com/nukeykt/NBlood.git; +} + +# Build binary + +{ +cd NBlood; +make rednukem; +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/Rednukem; +mv /home/peter/.bin/Rednukem/rednukem /home/peter/.bin/Rednukem/.old; +mv /home/peter/.bin/Rednukem/dn64widescreen.pk3 /home/peter/.bin/Rednukem/.old; +cd /home/peter/Downloads/git/NBlood; +cp /home/peter/Downloads/git/NBlood/rednukem /home/peter/.bin/Rednukem; +cp /home/peter/Downloads/git/NBlood/dn64widescreen.pk3 /home/peter/.bin/Rednukem; +chmod 755 /home/peter/.bin/Rednukem/rednukem; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/NBlood; +} diff --git a/.bin/sh/server.sh b/.bin/sh/server.sh new file mode 100755 index 0000000..a3e0e8c --- /dev/null +++ b/.bin/sh/server.sh @@ -0,0 +1,2 @@ +#!/bin/sh +kitty --session ~/.config/kitty/session --listen-on=unix:@mykitty diff --git a/.bin/sh/shutdown.sh b/.bin/sh/shutdown.sh new file mode 100755 index 0000000..97548e9 --- /dev/null +++ b/.bin/sh/shutdown.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Prompt Reboot + +{ +read -p "Shutdown now? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + command shutdown -h now +fi +} diff --git a/.bin/sh/songdetail.sh b/.bin/sh/songdetail.sh new file mode 100755 index 0000000..eb592e9 --- /dev/null +++ b/.bin/sh/songdetail.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +song_info=$(playerctl metadata --format '󰎆 {{title}} - {{artist}}') + +echo "$song_info" diff --git a/.bin/sh/steamskin.sh b/.bin/sh/steamskin.sh new file mode 100755 index 0000000..186f82d --- /dev/null +++ b/.bin/sh/steamskin.sh @@ -0,0 +1,10 @@ +#!/bin/sh +#https://wiki.archlinux.org/title/steam#Changing_the_Steam_notification_position +mkdir -p ~/.steam/root/skins +cd ~/.steam/root/skins +mkdir -p StopAnimations/resource +cp -r ~/.steam/root/resource/styles StopAnimations/resource +sed -i '/Notifications.SlideDirection/ s/"[A-Za-z]*"/"None"/' StopAnimations/resource/styles/* #no animation sliding +sed -i '/Notifications.FadeInTime/ s/"0.[0-9+]*"/"0.0"/' StopAnimations/resource/styles/* #no fade in time for notifications +sed -i '/Notifications.FadeOutTime/ s/"0.[0-9+]*"/"0.0"/' StopAnimations/resource/styles/* #no fade out time for notifications +sed -i '/Notifications.StackSize/ s/"[0-9]*"/"5"/' StopAnimations/resource/styles/* #show max 5 notifications instead of max 3 at the same time diff --git a/.bin/sh/swaylock.sh b/.bin/sh/swaylock.sh new file mode 100755 index 0000000..8d127f0 --- /dev/null +++ b/.bin/sh/swaylock.sh @@ -0,0 +1,2 @@ +#!/bin/sh +swaylock -f -i DP-1:~/.wallpapers/castlevania.png -i DP-2:~/.wallpapers/castlevania2.png --inside-color "#44475a" --inside-clear-color "#50fa7b" --ring-color "#ff79c6" --text-caps-lock-color "#f8f8f2" --ring-caps-lock-color "#f8f8f2" --key-hl-color "#50fa7b" diff --git a/.bin/sh/tfe-compile.sh b/.bin/sh/tfe-compile.sh new file mode 100755 index 0000000..4ab9b5e --- /dev/null +++ b/.bin/sh/tfe-compile.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +rm -rf /home/peter/.bin/tfe/TheForceEngine +mv /home/peter/.bin/tfe/* /home/peter/.bin/tfe/.old; +cd /home/peter/.bin/tfe; +git clone https://github.com/luciusDXL/TheForceEngine.git; +mkdir TheForceEngine/tfe-build; cd TheForceEngine/tfe-build; +} + +# Build binary + +{ +cmake -S /home/peter/.bin/tfe/TheForceEngine; +make -j12; +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/tfe; +cp -r /home/peter/.bin/tfe/TheForceEngine/tfe-build/* /home/peter/.bin/tfe; +chmod 755 /home/peter/.bin/tfe/TheForceEngine/tfe-build/theforceengine; +} + diff --git a/.bin/sh/tv_rename.sh b/.bin/sh/tv_rename.sh new file mode 100755 index 0000000..3419928 --- /dev/null +++ b/.bin/sh/tv_rename.sh @@ -0,0 +1,166 @@ +#!/bin/env bash +# +# Written by Anthony Lobianco, 01/23/2014 +# +# A simple script to batch rename television files +# +# USAGE +# ----- +# chmod a+x tv_rename.sh +# ./tv_rename.sh -d /path/to/show/S01 +# +# CHANGELOG +# --------- +# +# 1.0.0 +# ----- +# initial commit +# +# 1.0.1 +# ----- +# check to make sure input directory exists +# +# 1.0.2 +# ----- +# handle file types other than .mkv +# make sure new format has same extension as old file +# make sure new format includes the SXXEYY placeholder +# +# 1.0.3 +# ----- +# if SXXEYY pattern is not present, automatically determine it from filename +# + +VRS=1.0.3 + +bold=`tput bold` # bold characters in echo +normal=`tput sgr0` # normal characters in echo + +echo " " +echo "BATCH RENAME SCRIPT v$VRS" +echo -n "server: " +echo $SSH_CONNECTION | awk '{print $3}' +echo " " + +DIR="" + +while getopts ":d:" OPTION +do + case $OPTION in + d) + if [ "$OPTARG" = "." ]; then + DIR=`pwd` + else + DIR="$OPTARG" + fi + ;; + esac +done + +if [ "$DIR" = "" ]; then + echo "no directory specified (use -d /path/to/directory/)" + echo "EXIT" + exit 1 +elif [ ! -d "$DIR" ]; then + echo "$DIR does not exist" + echo "EXIT" + exit 1 +fi + +echo -e "renaming files in:\t ${bold}${DIR}${normal}" + +LAST_FILE=`ls -l "$DIR" | tail -1 | awk '{print $NF}'` +FILE_TYPE=`basename $LAST_FILE | awk -F . '{print $NF}'` + +echo -e "last file looks like:\t ${bold}${LAST_FILE}${normal}\n" + +rename_files() { + local format=$1 + local dry_run=$2 + + # find SXXEYY pattern + REGEX="([sS]([0-9]{2,}|[X]{2,})[eE]([0-9]{2,}|[Y]{2,}))" + if [[ ! $format =~ $REGEX ]]; then + echo "could not find SXXEYY pattern in new format" + echo " " + continue + else + MATCH="${BASH_REMATCH[1]}" + fi + + # needed if directory name has whitespace (e.g. /media/Family Guy/) + SAVEIFS=$IFS + IFS=$(echo -en "\n\b") + + SEASON=`basename "$DIR"` + EPISODE=1 + for ITEM in $(find "$DIR" -type f -name "*.${FILE_TYPE}" | sort); do + if (( $EPISODE < 10 )); then + SE="${SEASON}E0${EPISODE}" + else + SE="${SEASON}E${EPISODE}" + fi + + if [[ $MATCH != $SE ]]; then + FILE="${format/$MATCH/$SE}" + else + FILE=$format + fi + + # list the files during dry run, rename them otherwise + if $dry_run; then + echo -e " mv `basename $ITEM` \n -> $FILE" + else + if [[ `basename $ITEM` == $FILE ]]; then + echo "rename not needed for `basename $ITEM`" + else + echo -e "renaming $ITEM \n to -> \t $DIR/$FILE" + mv $ITEM "$DIR/$FILE" + fi + fi + + echo " " + + EPISODE=$((EPISODE + 1)) + done + + IFS=$SAVEIFS +} + +echo "what format do you want to use to rename files?" +echo -e "(ex: Breaking.Bad.SXXEYY.1080p.BluRay.DTS.x264-rovers.mkv)\n" + +while read -ep "[format]: " FORMAT +do + echo " " + + # do some error checks + if [[ $FORMAT != *.${FILE_TYPE} ]]; then + echo "make sure new format has same file type extension (.${FILE_TYPE})" + echo " " + continue + fi + + rename_files $FORMAT true + + echo " " + + while read -ep "[continue? y/n]: " CONTINUE + do + if [[ $CONTINUE = y ]]; then + break + else + continue 2 + fi + done + + echo " " + + rename_files $FORMAT false + + break +done + +echo " " +echo "DONE" +exit 0 diff --git a/.bin/sh/update.sh b/.bin/sh/update.sh new file mode 100755 index 0000000..f7d80f8 --- /dev/null +++ b/.bin/sh/update.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# Perform update + +sudo pacman -Syu + +# Check pacdiff + +{ +read -p "Execute pacdiff? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + pacdiff -s +fi +} +# Check for orphans +{ +read -p "Check for orphan packages? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + sudo bash /home/peter/.bin/sh/orphans.sh +fi +} +# Update the Ollama model + +read -p "Would you like to update your ollama model? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + echo "Updating ollama model..." + ollama pull llama3.1 +fi +# Prompt reboot + +~/.bin/sh/reboot.sh diff --git a/.bin/sh/updatenew.sh b/.bin/sh/updatenew.sh new file mode 100755 index 0000000..079f112 --- /dev/null +++ b/.bin/sh/updatenew.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +# Check for updates + +{ +read -p "Check for updates? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + ~/.bin/sh/checkupdates.sh +fi +} + +# Perform system check + +{ +read -p "Check for errors and failed services? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + systemctl --failed && journalctl -p 3 -b +fi +} + +# Perform update + +{ +read -p "Perform system update? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + sudo pacman -Syu; +fi +} + +# Check pacdiff + +{ +read -p "Execute pacdiff? [y/n]:" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + sudo pacdiff +fi +} + +# Prompt reboot + +~/.bin/sh/reboot.sh diff --git a/.bin/sh/voidsw-compile.sh b/.bin/sh/voidsw-compile.sh new file mode 100755 index 0000000..9c99eae --- /dev/null +++ b/.bin/sh/voidsw-compile.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +# Switch to git directory and clone source +{ +cd /home/peter/Downloads/git; +git clone https://voidpoint.io/terminx/eduke32.git; +} + +# Build binary + +{ +cd eduke32; +make voidsw; +} + +# Install executable @ ~/.bin + +{ +cd /home/peter/.bin/voidsw; +mv /home/peter/.bin/voidsw/voidsw /home/peter/.bin/voidsw/.old; +cd /home/peter/Downloads/git/eduke32; +cp /home/peter/Downloads/git/eduke32/voidsw /home/peter/.bin/voidsw; +chmod 755 /home/peter/.bin/voidsw/voidsw; +} + +# Cleanup + +{ +rm -rf /home/peter/Downloads/git/eduke32; +} diff --git a/.bin/sh/weather.sh b/.bin/sh/weather.sh new file mode 100755 index 0000000..47c5d19 --- /dev/null +++ b/.bin/sh/weather.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# weather.sh +for i in {1..5} +do + text=$(curl -s "https://v2.wttr.in/$1?format=1&m") + if [[ $? == 0 ]] + then + text=$(echo "$text" | sed -E "s/\s+/ /g") + tooltip=$(echo -ne "Santo Domingo, Dominican Republic:";curl -s "https://wttr.in/$1?format=2&m") + if [[ $? == 0 ]] + then + tooltip=$(echo "$tooltip" | sed -E "s/\s+/ /g") + echo "{\"text\":\"$text\", \"tooltip\":\"$tooltip\"}" + exit + fi + fi + sleep 2 +done +echo "{\"text\":\"error\", \"tooltip\":\"error\"}"