aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_local
diff options
context:
space:
mode:
Diffstat (limited to 'dot_local')
-rwxr-xr-xdot_local/bin/executable_create-efi19
-rwxr-xr-xdot_local/bin/executable_doasedit58
-rwxr-xr-xdot_local/bin/executable_linkhandler76
-rwxr-xr-xdot_local/bin/executable_record104
-rwxr-xr-xdot_local/bin/executable_togreta6
-rwxr-xr-xdot_local/bin/executable_tokodi18
-rwxr-xr-xdot_local/bin/executable_wqr6
7 files changed, 143 insertions, 144 deletions
diff --git a/dot_local/bin/executable_create-efi b/dot_local/bin/executable_create-efi
index 9a72263..70cf1cc 100755
--- a/dot_local/bin/executable_create-efi
+++ b/dot_local/bin/executable_create-efi
@@ -5,49 +5,48 @@ lsblk
printf "Boot disk [sda]: " && read -r boot_disk
if [ -z "$boot_disk" ]; then
- boot_disk='sda'
+ boot_disk='sda'
fi
printf "Boot partition number [1]: " && read -r boot_partition_number
if [ -z "$boot_partition_number" ]; then
- boot_partition_number='1'
+ boot_partition_number='1'
fi
printf "Root partition [sda2]: " && read -r root_partition
if [ -z "$root_partition" ]; then
- root_partition='sda2'
+ root_partition='sda2'
fi
root_uuid="UUID=$(blkid -s UUID -o value /dev/"$root_partition")"
printf "Kernel name [linux]: " && read -r kernel_name
if [ -z "$kernel_name" ]; then
- kernel_name='linux'
+ kernel_name='linux'
fi
printf "CPU vendor (intel/amd) [intel]: " && read -r cpu_vendor
if [ -z "$cpu_vendor" ]; then
- cpu_vendor='intel'
+ cpu_vendor='intel'
fi
printf "ESP (boot/efi) [boot]: " && read -r esp
if [ -z "$esp" ]; then
- esp='boot'
+ esp='boot'
fi
printf "extra kernel parameters (e.g. mitigations=off): " && read -r extra_kernel_params
printf "label [archlinux]: " && read -r label
if [ -z "$label" ]; then
- label='archlinux'
+ label='archlinux'
fi
rel_path=""
rel_path2=""
if [ "$esp" = "efi" ]; then
- rel_path="\\EFI\\arch"
- rel_path2="/EFI/arch"
+ rel_path='\EFI\arch'
+ rel_path2="/EFI/arch"
fi
-
unicode_arg="cryptdevice=$root_uuid:root root=/dev/mapper/root rw initrd=$rel_path\\$cpu_vendor-ucode.img initrd=$rel_path\\initramfs-$kernel_name.img quiet $extra_kernel_params"
set -x
diff --git a/dot_local/bin/executable_doasedit b/dot_local/bin/executable_doasedit
index a3bdb2d..e58b9f2 100755
--- a/dot_local/bin/executable_doasedit
+++ b/dot_local/bin/executable_doasedit
@@ -41,15 +41,15 @@ check_doas_conf() {
printf '(E)dit again, (O)verwrite anyway, (A)bort: [E/o/a]? '
read -r choice
case "$choice" in
- o | O)
- return 0
- ;;
- a | A)
- return 1
- ;;
- e | E | *)
- "$editor_cmd" "$tmpfile"
- ;;
+ o | O)
+ return 0
+ ;;
+ a | A)
+ return 1
+ ;;
+ e | E | *)
+ "$editor_cmd" "$tmpfile"
+ ;;
esac
done
fi
@@ -71,26 +71,26 @@ _exit() {
while [ "${#}" -ne 0 ]; do
case "${1}" in
- --)
- shift
- break
- ;;
- --help | -h)
- help
- exit 0
- ;;
- --version | -V)
- printf 'doasedit version 1.0.7\n'
- exit 0
- ;;
- -*)
- printf "doasedit: invalid option: '%s'\n" "${1}"
- help
- exit 1
- ;;
- *)
- break
- ;;
+ --)
+ shift
+ break
+ ;;
+ --help | -h)
+ help
+ exit 0
+ ;;
+ --version | -V)
+ printf 'doasedit version 1.0.7\n'
+ exit 0
+ ;;
+ -*)
+ printf "doasedit: invalid option: '%s'\n" "${1}"
+ help
+ exit 1
+ ;;
+ *)
+ break
+ ;;
esac
done
diff --git a/dot_local/bin/executable_linkhandler b/dot_local/bin/executable_linkhandler
index e91da50..ee63eed 100755
--- a/dot_local/bin/executable_linkhandler
+++ b/dot_local/bin/executable_linkhandler
@@ -1,49 +1,49 @@
#!/usr/bin/env sh
resolve_url() {
- if [ -f "$1" ]; then
- local_url="$1"
- else
- local_url="/tmp/$(echo "$1" | sed "s/.*\///")"
- curl -sL "$1" >"$local_url"
- fi
- printf "%s" "$local_url"
+ if [ -f "$1" ]; then
+ local_url="$1"
+ else
+ local_url="/tmp/$(echo "$1" | sed "s/.*\///")"
+ curl -sL "$1" >"$local_url"
+ fi
+ printf "%s" "$local_url"
}
if [ -z "$1" ]; then
- url=$(wl-paste)
+ url=$(wl-paste)
else
- url="$1"
+ url="$1"
fi
case "$url" in
-*.mkv* | *.webm* | *.mp4* | *.mp3* | *.ogg* | *.mov* | *.ts* | *.m3u8* | *.gif* | *.m4a* | *youtube.com/watch* | *youtube.com/playlist* | *youtu.be* | *twitch.tv* | *invidio.us* | *lbry* | *streamye.com* | *streamvi.com* | *streamwo.com* | *videos.lukesmith.xyz*)
- setsid mpv -quiet "$url" >/dev/null 2>&1 &
- ;;
-acestream://*)
- setsid acestream-launcher "$url" >/dev/null 2>&1 &
- ;;
-*.png | *.jpg | *.jpe | *.jpeg | *.PNG | *.JPG | *.JPE | *.JPEG)
- local_url="$(resolve_url "$url")"
- setsid imv "$local_url" >/dev/null 2>&1 &
- ;;
-*.pdf | *.ps | *.epub)
- local_url="$(resolve_url "$url")"
- setsid zathura "$local_url" >/dev/null 2>&1 &
- ;;
-*rss* | *feed* | http*.xml | http*.atom)
- setsid rssadd "$url" >/dev/null 2>&1 &
- ;;
-mailto:*)
- setsid aerc "$url" >/dev/null 2>&1 &
- ;;
-*.dot)
- setsid xdot "$url" >/dev/null 2>&1 &
- ;;
-http*)
- librewolf "$url" >/dev/null 2>&1 &
- ;;
-*)
- $TERMINAL -e "$EDITOR" "$1"
- ;;
+ *.mkv* | *.webm* | *.mp4* | *.mp3* | *.ogg* | *.mov* | *.ts* | *.m3u8* | *.gif* | *.m4a* | *youtube.com/watch* | *youtube.com/playlist* | *youtu.be* | *twitch.tv* | *invidio.us* | *lbry* | *streamye.com* | *streamvi.com* | *streamwo.com* | *videos.lukesmith.xyz*)
+ setsid mpv -quiet "$url" >/dev/null 2>&1 &
+ ;;
+ acestream://*)
+ setsid acestream-launcher "$url" >/dev/null 2>&1 &
+ ;;
+ *.png | *.jpg | *.jpe | *.jpeg | *.PNG | *.JPG | *.JPE | *.JPEG)
+ local_url="$(resolve_url "$url")"
+ setsid imv "$local_url" >/dev/null 2>&1 &
+ ;;
+ *.pdf | *.ps | *.epub)
+ local_url="$(resolve_url "$url")"
+ setsid zathura "$local_url" >/dev/null 2>&1 &
+ ;;
+ *rss* | *feed* | http*.xml | http*.atom)
+ setsid rssadd "$url" >/dev/null 2>&1 &
+ ;;
+ mailto:*)
+ setsid aerc "$url" >/dev/null 2>&1 &
+ ;;
+ *.dot)
+ setsid xdot "$url" >/dev/null 2>&1 &
+ ;;
+ http*)
+ librewolf "$url" >/dev/null 2>&1 &
+ ;;
+ *)
+ $TERMINAL -e "$EDITOR" "$1"
+ ;;
esac
diff --git a/dot_local/bin/executable_record b/dot_local/bin/executable_record
index 00ac367..ff57758 100755
--- a/dot_local/bin/executable_record
+++ b/dot_local/bin/executable_record
@@ -4,74 +4,74 @@ pid_file="/tmp/recordpid"
log_file="/tmp/record.log"
pid_exists() {
- test -r "$pid_file"
+ test -r "$pid_file"
}
is_running() {
- if pid_exists; then
- ps "$(cat "$pid_file")" >/dev/null 2>&1 || return 1
- else
- return 1
- fi
+ if pid_exists; then
+ ps "$(cat "$pid_file")" >/dev/null 2>&1 || return 1
+ else
+ return 1
+ fi
}
start() {
- notify-send -t 500 "Record started!" &
- sleep 0.5
+ notify-send -t 500 "Record started!" &
+ sleep 0.5
- wf-recorder -f "$HOME/vids/$(date '+%y%m%d-%H%M-%S').mkv" >"$log_file" 2>&1 &
- echo "$!" >"$pid_file"
+ wf-recorder -f "$HOME/vids/$(date '+%y%m%d-%H%M-%S').mkv" >"$log_file" 2>&1 &
+ echo "$!" >"$pid_file"
}
stop() {
- pid_exists || exit 1
- pid="$(cat "$pid_file")"
- # kill with SIGTERM, allowing finishing touches.
- kill "$pid"
- # even after SIGTERM, ffmpeg may still run, so SIGKILL it.
- sleep 3
- is_running && kill -9 "$pid"
- rm -f "$pid_file"
- notify-send "Record stopped!"
+ pid_exists || exit 1
+ pid="$(cat "$pid_file")"
+ # kill with SIGTERM, allowing finishing touches.
+ kill "$pid"
+ # even after SIGTERM, ffmpeg may still run, so SIGKILL it.
+ sleep 3
+ is_running && kill -9 "$pid"
+ rm -f "$pid_file"
+ notify-send "Record stopped!"
}
toggle() {
- if is_running; then
- echo "Stopping record"
- stop
- else
- echo "Starting record"
- start
- fi
- echo
- status
+ if is_running; then
+ echo "Stopping record"
+ stop
+ else
+ echo "Starting record"
+ start
+ fi
+ echo
+ status
}
status() {
- if is_running; then
- echo "Recording with PID $(cat "$pid_file")"
- echo "Check the logs at"
- echo
- echo "$log_file"
- echo
- else
- echo "Record inactive"
- fi
+ if is_running; then
+ echo "Recording with PID $(cat "$pid_file")"
+ echo "Check the logs at"
+ echo
+ echo "$log_file"
+ echo
+ else
+ echo "Record inactive"
+ fi
}
case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- toggle)
- toggle
- ;;
- status)
- status
- ;;
- *)
- toggle
- ;;
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ toggle)
+ toggle
+ ;;
+ status)
+ status
+ ;;
+ *)
+ toggle
+ ;;
esac
diff --git a/dot_local/bin/executable_togreta b/dot_local/bin/executable_togreta
index d452a2e..9a189f9 100755
--- a/dot_local/bin/executable_togreta
+++ b/dot_local/bin/executable_togreta
@@ -1,11 +1,11 @@
#!/usr/bin/env sh
if [ -z "$1" ]; then
- url=$(wl-paste)
+ url=$(wl-paste)
elif [ "$1" = "-" ]; then
- read -r url
+ read -r url
else
- url="$1"
+ url="$1"
fi
# shellcheck disable=SC2029
diff --git a/dot_local/bin/executable_tokodi b/dot_local/bin/executable_tokodi
index ce945de..aec226c 100755
--- a/dot_local/bin/executable_tokodi
+++ b/dot_local/bin/executable_tokodi
@@ -1,20 +1,20 @@
#!/usr/bin/env sh
if [ -z "$1" ]; then
- url=$(wl-paste)
+ url=$(wl-paste)
elif [ "$1" = "-" ]; then
- read -r url
+ read -r url
else
- url="$1"
+ url="$1"
fi
case "$url" in
-*.m3u8*)
- prefix=''
- ;;
-*)
- prefix='plugin://plugin.video.sendtokodi/?'
- ;;
+ *.m3u8*)
+ prefix=''
+ ;;
+ *)
+ prefix='plugin://plugin.video.sendtokodi/?'
+ ;;
esac
payload="$(printf '{"jsonrpc":"2.0", "id": 1, "method":"Player.Open","params": {"item": {"file":"%s%s"}}}' "$prefix" "$url")"
diff --git a/dot_local/bin/executable_wqr b/dot_local/bin/executable_wqr
index 254f992..f878fdf 100755
--- a/dot_local/bin/executable_wqr
+++ b/dot_local/bin/executable_wqr
@@ -1,11 +1,11 @@
#!/usr/bin/env sh
if [ -z "$1" ]; then
- text=$(wl-paste)
+ text=$(wl-paste)
elif [ "$1" = "-" ]; then
- read -r text
+ read -r text
else
- text="$1"
+ text="$1"
fi
printf '%s' "$text" | qrencode -t PNG -o - | imv -