diff --git a/README.md b/README.md index e69de29..1ee6812 100644 --- a/README.md +++ b/README.md @@ -0,0 +1 @@ +My Linux Scripts in /usr/local/bin diff --git a/WindowsRenameFix.sh b/WindowsRenameFix.sh new file mode 100755 index 0000000..bcc903d --- /dev/null +++ b/WindowsRenameFix.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +echo read the comments in this file see a fix +# for f in ./*'('*')'*; do mv -i "$f" "${f/ (*)/}"; done +# for f in ./*/*'('*')'*; do mv -i "$f" "${f/ (*)/}"; done +# for f in ./*/*'('*')'*; do mv -i "$f" "${f/ (*)/}"; done +# etc, for the directory you're in that you want to fix. +# I know this is a garbage implementation, but not the best at bash scripting, so don't know how to recurse through each individual directory diff --git a/autostart.sh b/autostart.sh new file mode 100755 index 0000000..84f6a86 --- /dev/null +++ b/autostart.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +export DISPLAY=:0 + +#Added some programs here since emptty had issues +polybar & + +# --- Music Workspace Start --- +#Note: So alacritty specifically (I believe kitty fixed this) has a scaling issue because L/R monitor diff resolutions +#so, as a result terminal apps spawned on LMON and moved to RMON resulting in too large text font so setting to 9.5 +#as this is like 97% scaled correctly in most circumstances as a botchy hack for now, just bc I like alacritty default colors +#Update: switched back to kitty using a custom theme that's better looking, alacritty with -o=font.size=9.5 was removed btw +#TERM=alacritty +TERM=kitty +THEMES=include=kitty-themes/themes +THEME=$THEMES/Hybrid.conf +SETTINGS=$THEME +$TERM --class Lyrics -o=$SETTINGS -e "lyrics" & +(sleep 1; $TERM --class Miniplayer -o=$SETTINGS -e "miniplayer") & +# --- Music Workspace End --- + + +easyeffects --gapplication-service & +lxsession & +/usr/bin/emacs --daemon & +xbindkeys & +xset dpms 300 & +#xss-lock -- slock & +xautolock -locker "slock" -nowlocker "slock -f" -time 5 & +picom --experimental-backends -b & +feh --bg-fill $(/public/wallpapers/mon1.cfg) --bg-fill $(/public/wallpapers/mon2.cfg) & +trayer --edge bottom --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 --tint 0x555E70 --height 22 & +conky -q -c /home/allen/.config/conky-0.conf & +conky -q -c /home/allen/.config/conky-1.conf & +mpDris2 & +playerctld & +copyq & + +# --- Start dolphin daemon for desktop portal so you can open files with dolphin without it being open beforehand --- +dolphin --daemon & + +# Try to fix gui program issues, couldn't find a working fix outside of xmonad. WMName might be working though, not sure. +#xprop -id "$WINDOWID" -f _NET_WM_NAME 8u -set _NET_WM_NAME LG3D & +#xsetroot -name LG3D & +wmname "LG3D" & + + +# Start lxappearance to load settings, then close it as we don't need to keep window open +lxappearance & +sleep 1 +killall lxappearance diff --git a/clipboardprint.sh b/clipboardprint.sh new file mode 100755 index 0000000..1ec0289 --- /dev/null +++ b/clipboardprint.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +sh -c 'sleep 0.5; xdotool type "$(xclip -o -selection clipboard)"' diff --git a/csgoAutoAccepter.sh b/csgoAutoAccepter.sh new file mode 100755 index 0000000..29dbd09 --- /dev/null +++ b/csgoAutoAccepter.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# For monitor 1 2560x1440 btw... (1287, 1055) +center1=$(echo "1300 850") +center2=$(echo "1250 800") + +# move to proper spot +xdotool mousemove $center1 +echo "Program will exit on mouse move..." + +sleep .5 + +while [ 1 ]; do + xdotool click 1 & + sleep 5 + + mouseLoc=$(xdotool getmouselocation 2>&1 | sed -rn '${s/x:([0-9]+) y:([0-9]+) .*/\1 \2/p}') + + if [ "$center1" != "$mouseLoc" ] && [ "$center2" != "$mouseLoc" ]; then + echo "Mouse moved. Exiting." + exit + fi + + # This is messy as hell... but it works, can refine this in the future to make less repetitive... + + xdotool mousemove $center2 + xdotool click 1 & + + sleep 5 + + mouseLoc=$(xdotool getmouselocation 2>&1 | sed -rn '${s/x:([0-9]+) y:([0-9]+) .*/\1 \2/p}') + + if [ "$center1" != "$mouseLoc" ] && [ "$center2" != "$mouseLoc" ]; then + echo "Mouse moved. Exiting." + exit + fi + + xdotool mousemove $center1 + +done + diff --git a/lockand b/lockand new file mode 100755 index 0000000..c77cdac --- /dev/null +++ b/lockand @@ -0,0 +1,16 @@ +#!/bin/bash + +xset dpms force off + +#Locker seems to die or be not responsive sometimes (not sure why...) so will just use slock -f as an alternative + +locker=xautolock +#if [[ $(ps -ef | grep $locker | grep -v grep | wc -l) != 0 ]]; then +#xautolock -locknow +#else +#echo no +slock -f & +#fi + +sleep 3 +systemctl $1 diff --git a/mount-phone b/mount-phone new file mode 100755 index 0000000..c8b5edd --- /dev/null +++ b/mount-phone @@ -0,0 +1,16 @@ +#!/bin/bash + +umount /mnt/mtp + +echo "Make sure all gvfs, gio, kio, kde, mtp dolphin app that may interfere are closed, automate this in the future" +killall dolphin +killall gvfsd +killall gvfsd-fuse +killall kded5 + +aft-mtp-mount /mnt/mtp & + +#echo "once, the phone is connected, can run: rsync -r -t -v --progress -s --ignore-existing '/mnt/ntfs/samsung-1tb/Users/Allen/Music/' '/mnt/mtp/SD card/Documents/Music'" + +echo "Using mtp and rsync is slow as fuck, only do this for when all songs are basically already downloaded" +/usr/local/bin/music-backup-to-phone diff --git a/music-backup-to-phone b/music-backup-to-phone new file mode 100755 index 0000000..0e949a0 --- /dev/null +++ b/music-backup-to-phone @@ -0,0 +1,5 @@ +#!/bin/bash + +echo "The configured transfer is quite slow, to use the faster option, use adb push." +echo "Example working for Pixel 7 Pro: adb push '/mnt/ntfs/samsung-1tb/Users/Allen/Music' '/sdcard/Documents/'" +rsync -r -t -v --progress -s --ignore-existing '/mnt/ntfs/samsung-1tb/Users/Allen/Music/' '/mnt/mtp/Internal shared storage/Documents/Music' diff --git a/patch-playlists-mpd-to-navidrome b/patch-playlists-mpd-to-navidrome new file mode 100755 index 0000000..2d4caaa --- /dev/null +++ b/patch-playlists-mpd-to-navidrome @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "run: awk '\$0=\"/music/\"\$0' ~/.config/mpd/playlists/GOAT.m3u > ~/Downloads/GOAT.patch.m3u" +echo "Documents/Music/ can change based on the location on the SD Drive, GOAT.m3u can change based on the playlist being imported" diff --git a/patch-playlists-mpd-to-phone b/patch-playlists-mpd-to-phone new file mode 100755 index 0000000..16965a9 --- /dev/null +++ b/patch-playlists-mpd-to-phone @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "run: awk '\$0=\"Documents/Music/\"\$0' ~/.config/mpd/playlists/GOAT.m3u > ~/Downloads/GOAT.patch.m3u" +echo "Documents/Music/ can change based on the location on the SD Drive, GOAT.m3u can change based on the playlist being imported" diff --git a/picom-restart b/picom-restart new file mode 100755 index 0000000..6f3466c --- /dev/null +++ b/picom-restart @@ -0,0 +1,8 @@ +#!/bin/bash + +killall picom + +#Wait 0.25 seconds so the process can close +sleep 0.25 + +picom --experimental-backends -b diff --git a/reinstall-grub b/reinstall-grub new file mode 100755 index 0000000..38aa943 --- /dev/null +++ b/reinstall-grub @@ -0,0 +1,6 @@ +#!/bin/bash +echo "Run the following commands:" +echo +echo "0. Make sure you have the proper drive and EFI partition mounted under /efi (Ex: sudo mount /dev/sda1 /efi)" +echo "1. sudo grub-install --target=x86_64-efi --efi-directory=/efi/ --bootloader-id=GRUB" +echo "2. sudo grub-mkconfig -o /boot/grub/grub.cfg" diff --git a/reload-ethernet.sh b/reload-ethernet.sh new file mode 100755 index 0000000..442efe5 --- /dev/null +++ b/reload-ethernet.sh @@ -0,0 +1,16 @@ +echo "Shutting Down Ethernet Connection..." +nmcli c d "Wired connection 1" +sleep 2 + +echo "Shutting Down Ethernet Device..." +nmcli d d "enp0s31f6" +sleep 2 + +echo "Starting Up Ethernet Device..." +nmcli d u "enp0s31f6" +sleep 2 + +echo "Starting up Ethernet Connection..." +nmcli c u "Wired connection 1" + +echo Done. diff --git a/rocksmith.sh b/rocksmith.sh new file mode 100755 index 0000000..4e8ae6d --- /dev/null +++ b/rocksmith.sh @@ -0,0 +1,25 @@ +STEAMLIBRARY=/home/allen/.local/share/Steam +PROTON=/usr/share/steam/compatibilitytools.d/proton-ge-custom/files + +#echo "Note: CLDC doesn't seem to be working sadly and was only able to get this working via 'previous_version' beta" +#echo "To enable the hidden beta, type in 'JustInCaseWeNeedIt'" +#echo "Previous Version Beta must be set in Steam -> Rocksmith 2014 -> Settings -> Betas" +#echo "Also check this note: https://www.reddit.com/r/rocksmith/comments/xa49mq/important_update_coming_to_rocksmith_2014/" +#echo "Also note that if outputs/inputs are incorrect, disable all but Speakers and Audio Adapter in pavucontrol" +#echo +#echo "'cd'ing into the steam game directory solves the missing CDLC issue!" +#echo "Only remaining problem really is that you cannot purchases CLDCs from this launch method, so must start game through steam" +#echo +echo "Note: look into a way to use predefined audio devices so I don't have to disable everything in pavucontrol" +echo "View all commented out notes in this shell file" + +/usr/local/bin/rocksmith_updateCDLC.sh + +echo +echo "Waiting 5 seconds..." +echo + +sleep 5 +#Important that all last 3 variables lines ran at same time (PIPEWIRE_LATENCY + WINEPREFIX + wine executable) +cd /home/allen/.local/share/Steam/steamapps/common/Rocksmith2014 +PIPEWIRE_LATENCY=256/48000 WINEPREFIX=$STEAMLIBRARY/steamapps/compatdata/221680/pfx "$PROTON/bin/wine" $STEAMLIBRARY/steamapps/common/Rocksmith2014/Rocksmith2014.exe diff --git a/rocksmith_updateCDLC.sh b/rocksmith_updateCDLC.sh new file mode 100755 index 0000000..4fb6ea0 --- /dev/null +++ b/rocksmith_updateCDLC.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo "Running this while the game is open works, but you must exit to the title screen for the songs to appear" +echo +echo "Moving all game DLCs from Downloads to DLC Folder" +# First move to "RocksmithCLDC" to chmod +cp /home/allen/Downloads/*.psarc /home/allen/Downloads/RSCDLCBackup/ +mv /home/allen/Downloads/*.psarc /home/allen/Downloads/RocksmithCDLC/ +chmod -R 755 /home/allen/Downloads/RocksmithCDLC/ +mv /home/allen/Downloads/RocksmithCDLC/* /home/allen/.local/share/Steam/steamapps/common/Rocksmith2014/dlc diff --git a/update_mirrors b/update_mirrors new file mode 100755 index 0000000..1e8980c --- /dev/null +++ b/update_mirrors @@ -0,0 +1,3 @@ +#!/bin/bash + +reflector --save /etc/pacman.d/mirrorlist --country "United States,Canada" --protocol https --latest 10