add scripts

This commit is contained in:
Crispy 2022-05-08 22:09:16 +02:00
parent 3ed377af16
commit 36c1bfed25
11 changed files with 135 additions and 1 deletions

View file

@ -4,3 +4,4 @@ end
set fish_greeting
alias l "ls -hAGg"
fish_add_path /home/crispypin/bin/scripts

View file

@ -30,3 +30,4 @@ SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr
SETUVAR fish_user_paths:/home/crispypin/bin/scripts

View file

@ -21,6 +21,7 @@
~/.config/kitty/kitty.conf: kitty.conf
~/.config/btop/btop.conf: btop.conf
~/.config/mpv: mpv
~/bin/scripts: scripts
- create:
- ~/downloads

4
scripts/GPU_VR.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
echo 4 > /sys/class/drm/card0/device/pp_power_profile_mode
echo "Set GPU to VR power profile mode"

4
scripts/GPU_VR_off.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
echo 0 > /sys/class/drm/card0/device/pp_power_profile_mode
echo "Set GPU to DEFAULT power profile mode"

51
scripts/arch_setup.sh Executable file
View file

@ -0,0 +1,51 @@
#!/bin/sh
# installs most of the stuff I need in arch, may make it more flexible in the future
cd ~
sudo pacman -S --needed git neovim base-devel
git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin
makepkg -si
cd ~
yay
yay -S --needed xorg-server xf86-video-amdgpu awesome picom xcape numlockx polkit-gnome \
lxappearance dracula-gtk-theme ly \
noto-fonts-emoji ttf-comic-mono-git wqy-zenhei \
lshw sshfs xdg-user-dirs xdg-utils fuse \
fish fastfetch pfetch cpupower \
pulseaudio ncpamixer alsa-utils \
pcmanfm vscodium-bin ffmpeg alacritty kitty meld cloc \
maim xclip slop xdotool \
firefox discord spotify
mkdir -p .config
git clone https://github.com/crispypin/awesomewm-config .config/awesome
mkdir -p archive bin documents downloads music pictures proj temp uni videos .templates .desktop
cd proj
git clone https://github.com/crispypin/crispypin
cp -f crispypin/config/user-dirs.dirs ~/.config/
xdg-user-dirs-update
rmdir Desktop/ Downloads/ Documents/ Pictures/ Music/ Videos/ Templates/ Public/
yay -S --needed \
steam obs-studio-git linux-headers v4l2loopback-dkms \
blender btop godot gimp \
mpv feh yt-dlp file-roller \
redshift element-desktop gnome-keyring trash-cli \
gvfs-gphoto2 gvfs-mtp jmtpfs
# for building apriltags
yay -S --needed gst-plugins-good
sudo ln -s /usr/bin/make /usr/bin/gmake
sudo ln -s /usr/lib/glib-2.0/include/glibconfig.h /usr/include/glib-2.0/glibconfig.h
timedatectl set-ntp true

13
scripts/camera_mode_normal.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
v4l2-ctl -c exposure_auto=3
v4l2-ctl -c brightness=127
v4l2-ctl -c contrast=5
#does this make a difference?
v4l2-ctl -c sharpness=25

15
scripts/camera_mode_track.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
v4l2-ctl -c auto_exposure=1
v4l2-ctl -c exposure_time_absolute=39
v4l2-ctl -c brightness=255
v4l2-ctl -c contrast=10
#does this make a difference?
#v4l2-ctl -c sharpness=50

6
scripts/ffgif.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
echo making gif from $1
echo
ffmpeg -i $1 -filter_complex "[0:v] palettegen" $1.palette.png
ffmpeg -i $1 -i $1.palette.png -filter_complex "[0:v][1:v] paletteuse" $1.gif
rm $1.palette.png

37
scripts/vrc-compressor.py Executable file
View file

@ -0,0 +1,37 @@
#!/bin/env python3
import time
import datetime
import os
from subprocess import call
ROOT_DIR = "/home/crispypin/pictures/VRChat/"
MAX_SIZE = 8 * 1024 * 1024
PROCESSED = []
def delay(seconds=30):
# delay that can be keyboard interrupted
for _ in range(10*seconds):
time.sleep(0.1)
def scan():
print("scanning")
date = datetime.datetime.now()
month = f"{date.year}-{date.month:02d}/"
path = ROOT_DIR + month
print(f"checking {path}")
items = os.listdir(path)
# print(items)
for f in items:
if os.path.isfile(path + f):
if os.path.getsize(path + f) > MAX_SIZE and f not in PROCESSED:
# input(f)
call(f"convert {f} temp.{f}", cwd=path, shell=True)
call(f"mv temp.{f} {f}", cwd=path, shell=True)
PROCESSED.append(f)
while True:
scan()
delay(60)

View file

@ -39,5 +39,6 @@
"C_Cpp.renameRequiresIdentifier": false,
"window.zoomLevel": 1,
"editor.renderWhitespace": "all",
"terminal.integrated.fontFamily": "monospace"
"terminal.integrated.fontFamily": "monospace",
"markdown.preview.fontFamily": "sans"
}