YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAH~

This commit is contained in:
Arthur K. 2024-12-22 19:10:54 +03:00
parent 96fbeb821a
commit 0c9b0016c6
Signed by: wzray
GPG key ID: B97F30FDC4636357
4 changed files with 61 additions and 1 deletions

View file

@ -21,6 +21,7 @@ LC_TELEPHONE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
# default configs
ANDROID_HOME="${HOME}/.local/share/android"
EDITOR="/usr/bin/nvim"
GNUPGHOME='~/.local/share/gnupg'
GOPATH="${HOME}/.local/share/go"

View file

@ -122,6 +122,7 @@ alias grb="git rebase"
alias grs="git restore --staged"
alias grt="git reset"
alias gs="git status"
alias gswc="git switch -c"
# docker aliases
alias dc="docker compose"

View file

@ -1,5 +1,7 @@
#!/bin/bash -e
set -o pipefail
API_ENDPOINT="http://ip-api.com/json/$1"'?fields='
FIELDS_FULL='7876383'
FIELDS_SHORT='8192'
@ -21,7 +23,13 @@ if [ -t 0 ] && [ -t 1 ]; then
elif [ -t 1 ]; then
notify-send -i /dev/null "IP Info" "$(get_stats)"
else
curl "${API_ENDPOINT}${FIELDS_SHORT}" 2>/dev/null | jq -r .query | tr -d $'\n'
if [ -n "$1" ]; then
resp="$(dig +short "$1" | tr -d $'\n')"
[ -n "$resp" ] && printf "%s" "$resp" || { echo 'Not found!' >&2; exit 1; }
else
curl "${API_ENDPOINT}${FIELDS_SHORT}" 2>/dev/null | jq -r .query | tr -d $'\n'
fi
# curl "${API_ENDPOINT}${FIELDS_SHORT}" 2>/dev/null | jq -r .query | tr -d $'\n'
fi
# vim: ft=bash

50
.local/bin/scripts/vid Executable file
View file

@ -0,0 +1,50 @@
#!/bin/sh
# thx https://github.com/mrsobakin
VIDEO_DIR="$HOME/Videos/Screencap"
FRAMERATE=60
error() {
echo "$@"
exit 1
}
if [ "$1" = "--background" ]; then
[ -z "$XDG_RUNTIME_DIR" ] && error "XDG_RUNTIME_DIR is not set"
LOCK_FILE="$XDG_RUNTIME_DIR/screencap.pid"
if [ -f "$LOCK_FILE" ]; then
echo "Stopping recording..."
kill "$(cat "$LOCK_FILE")"
rm -f "$LOCK_FILE"
exit 0
fi
fi
slop -f "%wx%h :0.0+%x,%y" | {
read -r size pos
[ "$size" = "" ] && error "Interrupted area selection"
echo "Starting recording..."
record() {
exec ffmpeg \
-video_size "$size" \
-framerate "$FRAMERATE" \
-thread_queue_size 4096 \
-f x11grab -i "$pos" -c:v h264 \
-f pulse -ac 2 -i default \
"$VIDEO_DIR/$(date +%s%N).mp4"
}
if [ "$1" != "--background" ]; then
record
else
record &
pid=$!
echo "$pid" > "$LOCK_FILE"
fi
}