commit 82d89c7e1cbbcc4a52412bdc2833e8f9f1359b99
parent c012d25658ea40f6a6efe1acbb21a6d9349d41c1
Author: Ryan Jeffrey <pwishie@gmail.com>
Date: Fri, 20 Mar 2020 03:00:32 -0700
scripts
Diffstat:
9 files changed, 198 insertions(+), 0 deletions(-)
diff --git a/scripts/.gitignore b/scripts/.gitignore
@@ -0,0 +1,79 @@
+
+# Created by https://www.gitignore.io/api/cmake,emacs
+# Edit at https://www.gitignore.io/?templates=cmake,emacs
+
+### CMake ###
+CMakeLists.txt.user
+CMakeCache.txt
+CMakeFiles
+CMakeScripts
+Testing
+Makefile
+cmake_install.cmake
+install_manifest.txt
+compile_commands.json
+CTestTestfile.cmake
+_deps
+
+### CMake Patch ###
+# External projects
+*-prefix/
+
+### Emacs ###
+# -*- mode: gitignore; -*-
+*~
+\#*\#
+/.emacs.desktop
+/.emacs.desktop.lock
+*.elc
+auto-save-list
+tramp
+.\#*
+
+# Org-mode
+.org-id-locations
+*_archive
+
+# flymake-mode
+*_flymake.*
+
+# eshell files
+/eshell/history
+/eshell/lastdir
+
+# elpa packages
+/elpa/
+
+# reftex files
+*.rel
+
+# AUCTeX auto folder
+/auto/
+
+# cask packages
+.cask/
+dist/
+
+# Flycheck
+flycheck_*.el
+
+# server auth directory
+/server/
+
+# projectiles files
+.projectile
+
+# directory configuration
+.dir-locals.el
+
+# network security
+/network-security.data
+
+
+# End of https://www.gitignore.io/api/cmake,emacs
+
+bin/
+
+dw
+
+build/+
\ No newline at end of file
diff --git a/scripts/albart b/scripts/albart
@@ -0,0 +1,10 @@
+#/usr/bin/env zsh
+
+OIFS="$IFS"
+IFS=$'\n'
+for i in `find $1 -type f -name "*.mp3"`; do
+ file=`echo "$i" | sed 's/ /\\ /g'`
+ ffmpeg -i $file -i $2 -b 192k -map_metadata 0 -map 0 -map 1 output.mp3
+ mv output.mp3 $file
+ exit
+done
diff --git a/scripts/faw b/scripts/faw
@@ -0,0 +1,11 @@
+#!/usr/bin/env zsh
+
+default="C:"
+search=$default
+
+[ $ARGC -eq 1 ] && search=$1
+
+for file in ./**/*(.); do
+ grep $search -Hin $file
+done
+
diff --git a/scripts/ffe b/scripts/ffe
@@ -0,0 +1,10 @@
+#/usr/bin/env zsh
+
+default=".c"
+search=$default
+
+[ $ARGC -eq 1 ] && search=$1
+
+for file in ./**/*(.); do
+ echo $file | grep $search -i
+done
diff --git a/scripts/gmdx b/scripts/gmdx
@@ -0,0 +1,9 @@
+#!/usr/bin/env sh
+
+# Sets up GMDX mod for Deus Ex on Linux
+
+xgamma -gamma 1.5
+
+STEAM_COMPAT_DATA_PATH=~/.proton/ ~/.local/share/Steam/steamapps/common/Proton\ 4.2/proton run /home/ryan/.local/share/Steam/steamapps/common/Deus\ Ex/System/GMDXv10.exe
+
+xgamma -gamma 1.0
diff --git a/scripts/init-polybar.sh b/scripts/init-polybar.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env sh
+
+# Terminate already running bar instances
+killall -q polybar
+
+# Wait until the processes have been shut down
+while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
+
+# Launch Polybar, using default config location ~/.config/polybar/config
+polybar main &
+
+echo "Polybar launched..."
diff --git a/scripts/monset.zsh b/scripts/monset.zsh
@@ -0,0 +1,12 @@
+#!/usr/bin/env zsh
+
+# Sets up my monitors
+
+xrandr --output HDMI-A-2 --auto --left-of DisplayPort-2 --output DisplayPort-2 \
+ --rate 144 --primary --mode 2560x1440
+
+xrandr --output DisplayPort-1 --mode 1920x1080 --same-as HDMI-A-2
+
+sleep 3
+
+nitrogen --restore
diff --git a/scripts/shuf.zsh b/scripts/shuf.zsh
@@ -0,0 +1,46 @@
+#!/usr/bin/env zsh
+
+# This scripts shuffles the inputs and runs them in as music files.
+
+# Echo to stderr
+echoerr() {
+ echo "$@" 1>&2
+}
+
+# Alter these values as necessary
+# Takes the file extension of the file and returns the music player associated with it
+getplayer() {
+ case $1 in
+ "mp3")
+ echo "cvlc"
+ ;;
+ "m4a")
+ echo "cvlc"
+ ;;
+ "modPlayer")
+ echo "cvlc"
+ ;;
+ "webm")
+ echo "cvlc"
+ ;;
+ *)
+ echoerr "The music file type $1 is not supported."
+ return -1
+ ;;
+ esac
+}
+
+songs=( $(echo "$@" | sed -r 's/(.[^;]*;)/ \1 /g' | tr " " "\n" | shuf | tr -d " " ) )
+
+for song in $songs; do
+ filename=`basename -- "$song"`
+ extension="${filename##*.}"
+
+ player=$(getplayer "$extension")
+
+ # If getting the type did not failed then play the song
+ [[ $? == 0 ]] && echo "Now playing $song" && $player "$song"
+done
+
+
+
diff --git a/scripts/sinit b/scripts/sinit
@@ -0,0 +1,8 @@
+#!/usr/bin/env zsh
+
+
+# Starts a Sven coop dedicated server
+
+cd ~/.local/share/Steam/steamapps/common/Sven\ Co-op\ Dedicated\ Server
+./svends_run +ip 25.17.249.130 +port 27015
+