summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/extra/compress_discord4
-rwxr-xr-xbin/extra/last_replay9
-rwxr-xr-xbin/extra/phone_cam15
-rwxr-xr-xbin/extra/replay.sh13
-rw-r--r--config/essentials/zsh/.zshrc2
-rwxr-xr-xconfig/home/.xprofile18
-rw-r--r--config/home/.zshenv13
-rwxr-xr-xutils/gpgidentity2
-rwxr-xr-xutils/post-commit3
-rwxr-xr-xutils/post-merge3
10 files changed, 62 insertions, 20 deletions
diff --git a/bin/extra/compress_discord b/bin/extra/compress_discord
index 5e026b0..776888c 100755
--- a/bin/extra/compress_discord
+++ b/bin/extra/compress_discord
@@ -16,6 +16,8 @@ MEGABIT="10000"
# Main
input="$1"
+inputDir="$(dirname "$1")"
+inputName="$(basename "$1")"
if [ -z "$input" ]
then
>&2 printf 'Usage: discord_compress <input>\n'
@@ -32,6 +34,6 @@ common_args="-hide_banner -v quiet -stats -y -hwaccel auto -i $input -c:v $video
set -ex
ffmpeg $common_args -pass 1 -an -f null /dev/null
-ffmpeg $common_args -pass 2 -c:a "$audio_codec" -b:a "${audio_bitrate}K" compressed_"${input%.*}".mp4
+ffmpeg $common_args -pass 2 -c:a "$audio_codec" -b:a "${audio_bitrate}K" "$inputDir"/compressed_"${inputName%.*}".mp4
rm -f ffmpeg2pass*.log*
diff --git a/bin/extra/last_replay b/bin/extra/last_replay
new file mode 100755
index 0000000..5cc0dba
--- /dev/null
+++ b/bin/extra/last_replay
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+File="$(find ~/vids/replays -type f -printf '%Ts %p\n' |
+ grep -E '\.(mp4|mkv|webm)' |
+ sort -n -r |
+ head -n 1 |
+ cut -f 2- -d' ' | tr -d '\n')"
+
+printf '%s' "$File"
diff --git a/bin/extra/phone_cam b/bin/extra/phone_cam
new file mode 100755
index 0000000..df76305
--- /dev/null
+++ b/bin/extra/phone_cam
@@ -0,0 +1,15 @@
+#!/bin/sh
+which v4l2-ctl scrcpy > /dev/null || exit 1
+
+V4L2_Sink="$(v4l2-ctl --list-devices | grep 'Virtual Webcam' -A 1 | tail -n 1 | awk '{print $1}')"
+
+scrcpy --video-source=camera \
+ --no-audio \
+ --no-window \
+ --camera-facing=front \
+ --v4l2-sink="$V4L2_Sink" \
+ --camera-fps=60 \
+ --video-codec=h265 \
+ --camera-ar=4:3 \
+ -m1920 \
+ --capture-orientation=flip90
diff --git a/bin/extra/replay.sh b/bin/extra/replay.sh
new file mode 100755
index 0000000..2a18352
--- /dev/null
+++ b/bin/extra/replay.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+File="$1"
+OutputDir="$(dirname "$File")"
+OutputFile="$(basename "$File")"
+ActiveWindowName="$(xprop -id "$(xdotool getactivewindow)" WM_CLASS | awk -F '"' '{print $(NF-1)}')"
+
+if [ "$ActiveWindowName" ]
+then
+ OutputFileName="${ActiveWindowName}_${OutputFile#Replay_}"
+ mv "$File" "$OutputDir"/"$OutputFileName"
+ notify-send '*replay.sh' "saved: $OutputFileName"
+fi
diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc
index 6b8a910..2558ee2 100644
--- a/config/essentials/zsh/.zshrc
+++ b/config/essentials/zsh/.zshrc
@@ -8,7 +8,7 @@ if { [ "$TTY" = "/dev/tty1" ] || [ "$TTY" = "/dev/tty8" ]; } && [ "$(id -u)" -ne
eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents ssh,gpg)"
if [ "$(hostname)" = "spring" ]
then
- keychain --dir "$XDG_CONFIG_HOME/keychain" --quiet --agents gpg 3A626DD20A32EB2E5DD9CE71CFD9ABC97158CD5D #FILTERED
+ keychain --dir "$XDG_CONFIG_HOME/keychain" --quiet --agents gpg 3A626DD20A32EB2E5DD9CE71CFD9ABC97158CD5D
fi
exec startx > /dev/null 2>&1
exit
diff --git a/config/home/.xprofile b/config/home/.xprofile
index 4bf2cfe..044c483 100755
--- a/config/home/.xprofile
+++ b/config/home/.xprofile
@@ -31,5 +31,19 @@ slstatus &
unclutter --timeout 3 --jitter 50 -b &
202020 &
-keyadd autumn &
-keyadd spacehb.net &
+if [ "$(hostname)" = "spring" ]
+then
+ keyadd autumn &
+ keyadd spacehb.net &
+fi
+
+gpu-screen-recorder \
+ -w screen \
+ -f 60 \
+ -c mkv \
+ -a "default_output|default_input" \
+ -r 60 \
+ -replay-storage ram \
+ -restart-replay-on-save yes \
+ -o ~/vids/replays \
+ -sc "$(which replay.sh)" &
diff --git a/config/home/.zshenv b/config/home/.zshenv
index fc87589..ffe8cde 100644
--- a/config/home/.zshenv
+++ b/config/home/.zshenv
@@ -1,14 +1,9 @@
#!/bin/zsh
-export EDITOR="vis"
-export VISUAL="vis"
-
-if [ "$(hostname)" = "winter" ]; then
- export BROWSER="zen-browser"
-else
- export BROWSER="firefox"
-fi
+export EDITOR="nvim"
+export VISUAL="nvim"
+export BROWSER="firefox"
export VIEWER="zathura"
export PLAYER="mpv"
export MENUCMD="dmenu"
@@ -109,6 +104,8 @@ export PATH="$PATH:$PLAN9/bin"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":/usr/local/lib/
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":.
+CPATH="$CPATH:$HOME/proj/std_lr"
+
export MAKEFLAGS="-j$(nproc)"
export VAKKEN="$HOME/docs/school/2024-2025"
diff --git a/utils/gpgidentity b/utils/gpgidentity
deleted file mode 100755
index 5a958b2..0000000
--- a/utils/gpgidentity
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-sed '/#FILTERED$/s/[^ ]\+ #FILTERED$/IDENTITY #FILTERED/g'
diff --git a/utils/post-commit b/utils/post-commit
deleted file mode 100755
index a6b419d..0000000
--- a/utils/post-commit
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-rm ~/bin/keyboards.txt ~/.config/user-dirs.dirs ~/bin/wd
-stowdots d \ No newline at end of file
diff --git a/utils/post-merge b/utils/post-merge
deleted file mode 100755
index a6b419d..0000000
--- a/utils/post-merge
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-rm ~/bin/keyboards.txt ~/.config/user-dirs.dirs ~/bin/wd
-stowdots d \ No newline at end of file