Compare commits
	
		
			2 Commits
		
	
	
		
			main
			...
			9d6d3c62b3
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					9d6d3c62b3 | ||
| 
						 | 
					7a6cd133be | 
							
								
								
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,5 +1,7 @@
 | 
				
			|||||||
 | 
					autostart.sh.save
 | 
				
			||||||
bootloadHID
 | 
					bootloadHID
 | 
				
			||||||
compileTimer
 | 
					compileTimer
 | 
				
			||||||
 | 
					delayed-suspend-slock.old
 | 
				
			||||||
dmenu
 | 
					dmenu
 | 
				
			||||||
dmenu_path
 | 
					dmenu_path
 | 
				
			||||||
dmenu_run
 | 
					dmenu_run
 | 
				
			||||||
@@ -8,6 +10,7 @@ ec
 | 
				
			|||||||
ethminer
 | 
					ethminer
 | 
				
			||||||
gsearch
 | 
					gsearch
 | 
				
			||||||
mpcInsert
 | 
					mpcInsert
 | 
				
			||||||
 | 
					powersettings.old
 | 
				
			||||||
rofi-network-manager.sh
 | 
					rofi-network-manager.sh
 | 
				
			||||||
slock
 | 
					slock
 | 
				
			||||||
slock-suspend
 | 
					slock-suspend
 | 
				
			||||||
@@ -16,5 +19,4 @@ st
 | 
				
			|||||||
start_dwm
 | 
					start_dwm
 | 
				
			||||||
steam-fix.sh
 | 
					steam-fix.sh
 | 
				
			||||||
stest
 | 
					stest
 | 
				
			||||||
switchcontrol
 | 
					 | 
				
			||||||
vis
 | 
					vis
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8
									
								
								WindowsRenameFix.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										8
									
								
								WindowsRenameFix.sh
									
									
									
									
									
										Executable file
									
								
							@@ -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
 | 
				
			||||||
@@ -3,7 +3,11 @@
 | 
				
			|||||||
export DISPLAY=:0
 | 
					export DISPLAY=:0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#Added some programs here since emptty had issues
 | 
					#Added some programs here since emptty had issues
 | 
				
			||||||
 | 
					<<<<<<< HEAD
 | 
				
			||||||
polybar-restart &
 | 
					polybar-restart &
 | 
				
			||||||
 | 
					=======
 | 
				
			||||||
 | 
					polybar &
 | 
				
			||||||
 | 
					>>>>>>> 87ac7b206297330f25c4ce049614d23647387d46
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# --- Music Workspace Start ---
 | 
					# --- Music Workspace Start ---
 | 
				
			||||||
#Note: So alacritty specifically (I believe kitty fixed this) has a scaling issue because L/R monitor diff resolutions
 | 
					#Note: So alacritty specifically (I believe kitty fixed this) has a scaling issue because L/R monitor diff resolutions
 | 
				
			||||||
@@ -29,7 +33,11 @@ xset dpms 300 &
 | 
				
			|||||||
xautolock -locker "slock" -nowlocker "slock -f" -time 5 &
 | 
					xautolock -locker "slock" -nowlocker "slock -f" -time 5 &
 | 
				
			||||||
picom --experimental-backends -b &
 | 
					picom --experimental-backends -b &
 | 
				
			||||||
feh --bg-fill $(/public/wallpapers/mon1.cfg) --bg-fill $(/public/wallpapers/mon2.cfg) &
 | 
					feh --bg-fill $(/public/wallpapers/mon1.cfg) --bg-fill $(/public/wallpapers/mon2.cfg) &
 | 
				
			||||||
 | 
					<<<<<<< HEAD
 | 
				
			||||||
# /usr/local/bin/trayer-restart # Launch from polybar-restart launcher now
 | 
					# /usr/local/bin/trayer-restart # Launch from polybar-restart launcher now
 | 
				
			||||||
 | 
					=======
 | 
				
			||||||
 | 
					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 &
 | 
				
			||||||
 | 
					>>>>>>> 87ac7b206297330f25c4ce049614d23647387d46
 | 
				
			||||||
conky -q -c /home/allen/.config/conky-0.conf &
 | 
					conky -q -c /home/allen/.config/conky-0.conf &
 | 
				
			||||||
conky -q -c /home/allen/.config/conky-1.conf &
 | 
					conky -q -c /home/allen/.config/conky-1.conf &
 | 
				
			||||||
mpDris2 &
 | 
					mpDris2 &
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,19 +14,30 @@ echo ''
 | 
				
			|||||||
echo -e $GREEN"================================================================="
 | 
					echo -e $GREEN"================================================================="
 | 
				
			||||||
echo -e "UPDATE COMPLETED!\n"$NC
 | 
					echo -e "UPDATE COMPLETED!\n"$NC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Not necessary, see https://wiki.archlinux.org/title/xmonad for pacman hook
 | 
					<<<<<<< HEAD
 | 
				
			||||||
#read -p "Do you want to recompile xmonad? (y/N): " -i "y" XMONAD_UPDATE
 | 
					=======
 | 
				
			||||||
 | 
					read -p "Do you want to recompile xmonad? (y/N): " -i "y" XMONAD_UPDATE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if [ "$XMONAD_UPDATE" == "y" ]; then
 | 
					if [ "$XMONAD_UPDATE" == "y" ]; then
 | 
				
			||||||
#  xmonad --recompile
 | 
					  xmonad --recompile
 | 
				
			||||||
#fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					>>>>>>> 87ac7b206297330f25c4ce049614d23647387d46
 | 
				
			||||||
echo $(cat /etc/pacman.conf | grep "IgnorePkg   =")
 | 
					echo $(cat /etc/pacman.conf | grep "IgnorePkg   =")
 | 
				
			||||||
read -p "DO YOU WANT TO UPDATE DANGEROUS PACKAGES TOO? 
 | 
					read -p "DO YOU WANT TO UPDATE DANGEROUS PACKAGES TOO? 
 | 
				
			||||||
RECOMMENDED EVERY 3 MONTHS (y/N): " -i "y" USER_AGREEMENT
 | 
					RECOMMENDED EVERY 3 MONTHS (y/N): " -i "y" USER_AGREEMENT
 | 
				
			||||||
if [ "$USER_AGREEMENT" == "y" ]; then
 | 
					if [ "$USER_AGREEMENT" == "y" ]; then
 | 
				
			||||||
  # Install packages bypassing IgnorePgk
 | 
					  # Install packages bypassing IgnorePgk
 | 
				
			||||||
  sed '/^IgnorePkg/d' /etc/pacman.conf > /tmp/432143214; paru -Syu --config /tmp/432143214; rm /tmp/432143214 
 | 
					  sed '/^IgnorePkg/d' /etc/pacman.conf > /tmp/432143214 | paru -Syu --config /tmp/432143214; rm /tmp/432143214 
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<<<<<<< HEAD
 | 
				
			||||||
 | 
					read -p "Do you want to recompile xmonad? (y/N): " -i "y" XMONAD_UPDATE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ "$XMONAD_UPDATE" == "y" ]; then
 | 
				
			||||||
 | 
					  xmonad --recompile
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=======
 | 
				
			||||||
 | 
					>>>>>>> 87ac7b206297330f25c4ce049614d23647387d46
 | 
				
			||||||
echo -e "\nUPDATE COMPLETED!"$NC
 | 
					echo -e "\nUPDATE COMPLETED!"$NC
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,7 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
killall polybar > /dev/null 2>&1
 | 
					killall polybar > /dev/null 2>&1
 | 
				
			||||||
 | 
					<<<<<<< HEAD
 | 
				
			||||||
nohup /usr/local/bin/polybar-launcher.sh > /dev/null 2>&1 &
 | 
					nohup /usr/local/bin/polybar-launcher.sh > /dev/null 2>&1 &
 | 
				
			||||||
 | 
					=======
 | 
				
			||||||
 | 
					nohup polybar > /dev/null 2>&1 &
 | 
				
			||||||
 | 
					>>>>>>> 87ac7b206297330f25c4ce049614d23647387d46
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +0,0 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Would produce x2 the length provided
 | 
					 | 
				
			||||||
# openssl rand -hex $1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
LENGTH=$1
 | 
					 | 
				
			||||||
tr -cd '[:alnum:]' < /dev/urandom | fold -w "${LENGTH}" | head -n 1 | tr -d '\n' ; echo
 | 
					 | 
				
			||||||
@@ -1,6 +1,11 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
echo "Run the following commands:"
 | 
					echo "Run the following commands:"
 | 
				
			||||||
echo
 | 
					echo
 | 
				
			||||||
 | 
					<<<<<<< HEAD
 | 
				
			||||||
 | 
					echo "0. Make sure you have the proper drive and EFI partition mounted under /boot/efi (Ex: sudo mount /dev/sda1 /boot/efi)"
 | 
				
			||||||
 | 
					echo "1. sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB"
 | 
				
			||||||
 | 
					=======
 | 
				
			||||||
echo "0. Make sure you have the proper drive and EFI partition mounted under /efi (Ex: sudo mount /dev/sda1 /efi)"
 | 
					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 "1. sudo grub-install --target=x86_64-efi --efi-directory=/efi/ --bootloader-id=GRUB"
 | 
				
			||||||
 | 
					>>>>>>> 87ac7b206297330f25c4ce049614d23647387d46
 | 
				
			||||||
echo "2. sudo grub-mkconfig -o /boot/grub/grub.cfg"
 | 
					echo "2. sudo grub-mkconfig -o /boot/grub/grub.cfg"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +0,0 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
docker run --net=host --device /dev/dri/ -e DISPLAY=$DISPLAY -v $HOME/.Xauthority:/root/.Xauthority:ro -it osrf/ros:humble-desktop
 | 
					 | 
				
			||||||
# -v /tmp/.X11-unix:/tmp/.X11-unix
 | 
					 | 
				
			||||||
							
								
								
									
										27
									
								
								switchcontrol
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										27
									
								
								switchcontrol
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,27 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# A program that maps the paramaters [1 -> length - 1] to a variable P[1 -> length - 1] and then sends it in a HTTP post requset to HomeAssistant web hook automation.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WEBHOOK_ID="3Rvdb4qZDgcKD2EiZgV328xdhWLVkjn8dVgSKr13JkIb5eP0RFNPQjgYDey16R64"
 | 
				
			||||||
 | 
					WEBHOOK_URL="http://0.hassio.local/api/webhook/$WEBHOOK_ID"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CURL_REQ="curl -X POST $WEBHOOK_URL"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#CURL_REQ=("curl" "-X" "POST" "$WEBHOOK_URL")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					declare -a params_array
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					i=0
 | 
				
			||||||
 | 
					j=0
 | 
				
			||||||
 | 
					for var in "$@"
 | 
				
			||||||
 | 
					do
 | 
				
			||||||
 | 
					    params_array[$i]='-d'
 | 
				
			||||||
 | 
					    ((i++))
 | 
				
			||||||
 | 
					    params_array[$((i))]="P$((i-1+j))=$var"
 | 
				
			||||||
 | 
					    ((i++))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ((j-=1))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$CURL_REQ "${params_array[@]}"
 | 
				
			||||||
@@ -1,67 +0,0 @@
 | 
				
			|||||||
#!/usr/bin/python3
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Solution inspired by: https://gist.github.com/kmorcinek/2710267
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# This script will convert the date between the parentehsis and get the oldest date
 | 
					 | 
				
			||||||
# It will delete the older files and search all sub directories
 | 
					 | 
				
			||||||
# This definitely isn't the most efficient, but can process tens of thousands of files in less than a second
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import re
 | 
					 | 
				
			||||||
from os.path import join
 | 
					 | 
				
			||||||
import os.path
 | 
					 | 
				
			||||||
from os import walk, rename, remove
 | 
					 | 
				
			||||||
import os
 | 
					 | 
				
			||||||
import sys
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from datetime import datetime
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
FOLDER_PATH = os.getcwd()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
processed = []
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
for path, subdirs, files in walk(FOLDER_PATH):
 | 
					 | 
				
			||||||
    for i, name in enumerate(files):  # Iterate over the original list
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if name in processed:
 | 
					 | 
				
			||||||
            continue
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        print('{} / {}'.format(i + 1, len(files)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        # Extract the date from the parentheses using regex
 | 
					 | 
				
			||||||
        match = re.search(r'\((\d{4}_\d{2}_\d{2} \d{2}_\d{2}_\d{2} UTC)\)', name)
 | 
					 | 
				
			||||||
        if match:
 | 
					 | 
				
			||||||
            date_in_parentheses = match.group(1)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            # Convert the date to a datetime object for comparison
 | 
					 | 
				
			||||||
            formatted_date = datetime.strptime(date_in_parentheses, "%Y_%m_%d %H_%M_%S %Z")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            # Find all files that match regex
 | 
					 | 
				
			||||||
            duplicates = [f for f in files if re.sub(r' \(.+\)', '', f) == re.sub(r' \(.+\)', '', name)]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            # Find the newest file among duplicates
 | 
					 | 
				
			||||||
            newest_file = max(duplicates, key=lambda f: datetime.strptime(re.search(r'\((\d{4}_\d{2}_\d{2} \d{2}_\d{2}_\d{2} UTC)\)', f).group(1), "%Y_%m_%d %H_%M_%S %Z"))
 | 
					 | 
				
			||||||
            print("Newest file found:", newest_file)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            # Rename the current file if needed
 | 
					 | 
				
			||||||
            new_name = re.sub(r' \(.+\)', '', newest_file)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            # Move older duplicates to the fixed directory
 | 
					 | 
				
			||||||
            for duplicate in duplicates:
 | 
					 | 
				
			||||||
                duplicate_path = join(path, duplicate)
 | 
					 | 
				
			||||||
                if duplicate != newest_file:
 | 
					 | 
				
			||||||
                    # Check if file exists because it can be deleted already
 | 
					 | 
				
			||||||
                    if os.path.isfile(duplicate_path):
 | 
					 | 
				
			||||||
                        remove(duplicate_path)
 | 
					 | 
				
			||||||
                        print(f"Removed older duplicate: {duplicate_path}")
 | 
					 | 
				
			||||||
                else:
 | 
					 | 
				
			||||||
                    if os.path.isfile(duplicate_path):
 | 
					 | 
				
			||||||
                        rename(join(path, newest_file), join(path, new_name))
 | 
					 | 
				
			||||||
                        print(f"Renamed: {duplicate_path} to {join(path, new_name)}")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                processed.append(duplicate_path)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        else:
 | 
					 | 
				
			||||||
            print(f"Skipping {join(path, name)}")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
print(f"Processed {len(processed)} files.")
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user