YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAH~
This commit is contained in:
parent
96fbeb821a
commit
0c9b0016c6
4 changed files with 61 additions and 1 deletions
|
@ -21,6 +21,7 @@ LC_TELEPHONE="en_US.UTF-8"
|
||||||
LC_TIME="en_US.UTF-8"
|
LC_TIME="en_US.UTF-8"
|
||||||
|
|
||||||
# default configs
|
# default configs
|
||||||
|
ANDROID_HOME="${HOME}/.local/share/android"
|
||||||
EDITOR="/usr/bin/nvim"
|
EDITOR="/usr/bin/nvim"
|
||||||
GNUPGHOME='~/.local/share/gnupg'
|
GNUPGHOME='~/.local/share/gnupg'
|
||||||
GOPATH="${HOME}/.local/share/go"
|
GOPATH="${HOME}/.local/share/go"
|
||||||
|
|
|
@ -122,6 +122,7 @@ alias grb="git rebase"
|
||||||
alias grs="git restore --staged"
|
alias grs="git restore --staged"
|
||||||
alias grt="git reset"
|
alias grt="git reset"
|
||||||
alias gs="git status"
|
alias gs="git status"
|
||||||
|
alias gswc="git switch -c"
|
||||||
|
|
||||||
# docker aliases
|
# docker aliases
|
||||||
alias dc="docker compose"
|
alias dc="docker compose"
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
API_ENDPOINT="http://ip-api.com/json/$1"'?fields='
|
API_ENDPOINT="http://ip-api.com/json/$1"'?fields='
|
||||||
FIELDS_FULL='7876383'
|
FIELDS_FULL='7876383'
|
||||||
FIELDS_SHORT='8192'
|
FIELDS_SHORT='8192'
|
||||||
|
@ -20,8 +22,14 @@ if [ -t 0 ] && [ -t 1 ]; then
|
||||||
get_stats
|
get_stats
|
||||||
elif [ -t 1 ]; then
|
elif [ -t 1 ]; then
|
||||||
notify-send -i /dev/null "IP Info" "$(get_stats)"
|
notify-send -i /dev/null "IP Info" "$(get_stats)"
|
||||||
|
else
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
resp="$(dig +short "$1" | tr -d $'\n')"
|
||||||
|
[ -n "$resp" ] && printf "%s" "$resp" || { echo 'Not found!' >&2; exit 1; }
|
||||||
else
|
else
|
||||||
curl "${API_ENDPOINT}${FIELDS_SHORT}" 2>/dev/null | jq -r .query | tr -d $'\n'
|
curl "${API_ENDPOINT}${FIELDS_SHORT}" 2>/dev/null | jq -r .query | tr -d $'\n'
|
||||||
fi
|
fi
|
||||||
|
# curl "${API_ENDPOINT}${FIELDS_SHORT}" 2>/dev/null | jq -r .query | tr -d $'\n'
|
||||||
|
fi
|
||||||
|
|
||||||
# vim: ft=bash
|
# vim: ft=bash
|
||||||
|
|
50
.local/bin/scripts/vid
Executable file
50
.local/bin/scripts/vid
Executable 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
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue