Updates
This commit is contained in:
parent
e94f3a189c
commit
3967e285b6
27 changed files with 63 additions and 0 deletions
22
linux/screenrec.sh
Executable file
22
linux/screenrec.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# We need to decide if we're already screen recording or not
|
||||||
|
pid=$(pgrep wf-recorder)
|
||||||
|
|
||||||
|
if [[ "$pid" ]]; then
|
||||||
|
# Just killing the wf-recorder task frees up the rest of the script to do the rest
|
||||||
|
kill -9 "$pid"
|
||||||
|
else
|
||||||
|
filename="/home/jose/Pictures/Screenshots/$(date '+%Y-%m-%d_%I:%M:%S%p')"
|
||||||
|
notify-send -t 2000 -a Screen Recording 'Starting Screen Recording..'
|
||||||
|
# Start the screen recording in the region defined by Slurp
|
||||||
|
wf-recorder -g "$(slurp -b '#00000090')" -f "$filename.mkv"
|
||||||
|
# Convert to MP4 - mp4 breaks if you kill-9 it, but mkv doesn't. Keep benefits of both
|
||||||
|
ffmpeg -i "$filename.mkv" -codec copy "$filename.mp4" && rm "$filename.mkv"
|
||||||
|
# Copy the output file to the clipboard
|
||||||
|
wl-copy file://"$filename.mp4" -t text/uri-list
|
||||||
|
# Now we can say the recording is done
|
||||||
|
notify-send -t 2000 -a Screen Recording 'Screen Recording Saved!'
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
41
linux/update-readmes.py
Normal file
41
linux/update-readmes.py
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
from subprocess import run, Popen, PIPE
|
||||||
|
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
NEW_REPO_BASE_NAME="https://git.oitsjustjose.com/me"
|
||||||
|
|
||||||
|
# Grab each github repo's URL and Name
|
||||||
|
proc = Popen(["gh", "repo", "list", "--no-archived", "-L", "500", "--json", "url,name"], stdout=PIPE, stderr=PIPE)
|
||||||
|
# Parse into JSON
|
||||||
|
stdout, stderr = proc.communicate()
|
||||||
|
repo_data = json.loads(stdout)
|
||||||
|
|
||||||
|
# Iterate over all repos, cloning, updating the README, committing, pushing, then deleting the clone
|
||||||
|
for repo in repo_data:
|
||||||
|
url = repo["url"]
|
||||||
|
dirname = repo["name"]
|
||||||
|
|
||||||
|
# clone the repo
|
||||||
|
run(f"git clone {url}", shell=True, check=True)
|
||||||
|
|
||||||
|
readme_filenm = "README.md"
|
||||||
|
for file in os.listdir(dirname):
|
||||||
|
if file.lower() == "readme.md":
|
||||||
|
readme_filenm = file
|
||||||
|
break
|
||||||
|
|
||||||
|
print(f"Found readme file at ./{dirname}/{readme_filenm}")
|
||||||
|
|
||||||
|
new_loc = f"{NEW_REPO_BASE_NAME}/{dirname}"
|
||||||
|
with open(f"./{dirname}/{readme_filenm}", "w", encoding="utf-8") as fh:
|
||||||
|
fh.write(f"# This Repo has Moved!\n\nThis repository has been moved to a [new location!]({new_loc})")
|
||||||
|
|
||||||
|
run(f"git -C {dirname} add {readme_filenm}", shell=True)
|
||||||
|
run(f"git -C {dirname} commit -m '[AUTOMATED] Updated README to redirect to {new_loc}'", shell=True)
|
||||||
|
run(f"git -C {dirname} push", shell=True)
|
||||||
|
|
||||||
|
shutil.rmtree(dirname)
|
||||||
|
print(f"Successfully pushed the new redirected repo for {dirname}")
|
||||||
|
|
||||||
Loading…
Reference in a new issue