aboutsummaryrefslogtreecommitdiff
path: root/.local/share/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/share/bin')
-rwxr-xr-x.local/share/bin/bootloader6
-rwxr-xr-x.local/share/bin/lock2
-rwxr-xr-x.local/share/bin/now2
-rwxr-xr-x.local/share/bin/qrclip2
-rwxr-xr-x.local/share/bin/screenrecord3
-rwxr-xr-x.local/share/bin/subrename54
6 files changed, 66 insertions, 3 deletions
diff --git a/.local/share/bin/bootloader b/.local/share/bin/bootloader
index f6f6917..c310d4f 100755
--- a/.local/share/bin/bootloader
+++ b/.local/share/bin/bootloader
@@ -7,7 +7,7 @@ bye () {
[ $(id -g) -ne 0 ] && bye
-mount /boot
-pacman --noconfirm -S linux
-grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
+# mount /boot
+# pacman --noconfirm -S linux
+grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB # --removable
grub-mkconfig -o /boot/grub/grub.cfg
diff --git a/.local/share/bin/lock b/.local/share/bin/lock
new file mode 100755
index 0000000..e25ea04
--- /dev/null
+++ b/.local/share/bin/lock
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec slock
diff --git a/.local/share/bin/now b/.local/share/bin/now
new file mode 100755
index 0000000..8fca44f
--- /dev/null
+++ b/.local/share/bin/now
@@ -0,0 +1,2 @@
+#!/bin/sh
+printf '%s\n' "$(khal --color list now 1h --notstarted --day-format '' --format '({start-time}) {calendar-color}{title}{reset}')"
diff --git a/.local/share/bin/qrclip b/.local/share/bin/qrclip
new file mode 100755
index 0000000..d232dbe
--- /dev/null
+++ b/.local/share/bin/qrclip
@@ -0,0 +1,2 @@
+#!/bin/sh
+maim -usb 4 -c 0,0,0 | zbarimg -q -
diff --git a/.local/share/bin/screenrecord b/.local/share/bin/screenrecord
new file mode 100755
index 0000000..52c6e5b
--- /dev/null
+++ b/.local/share/bin/screenrecord
@@ -0,0 +1,3 @@
+#!/bin/sh
+giph -f 60 -s -b 4 -c 255,255,255 "$(date +'%Y-%m-%d_%H-%M-%S.mp4')"
+
diff --git a/.local/share/bin/subrename b/.local/share/bin/subrename
new file mode 100755
index 0000000..16d913f
--- /dev/null
+++ b/.local/share/bin/subrename
@@ -0,0 +1,54 @@
+#!/bin/sh
+file_extension=".srt"
+season=1
+episode=1
+
+PROGNAME="$(basename "$0")"
+USAGE="$( cat << EOF
+usage: $PROGNAME [-h] [-s season] [-e episode] [-x extension] file1 [file2 ...]
+
+rename files to s01e01.srt, s01e02.srt, etc.
+
+options:
+ -s set season number (default: $season)
+ -e set episode number of first file (default: $episode)
+ -x set file extension for output files (default: $file_extension)
+ -h show help
+
+example:
+ subrename -x .ja.srt *.srt
+EOF
+)"
+usage() {
+ echo "$USAGE"
+ exit 0
+}
+stupid() {
+ echo "use $PROGNAME -h for help"
+ exit 1
+}
+
+ARGC=0
+while getopts e:s:x:h OPT; do
+ [ $OPTIND -gt $ARGC ] && ARGC=$OPTIND
+ case "$OPT" in
+ e) episode="$OPTARG" ;;
+ h) usage ;;
+ s) season="$OPTARG" ;;
+ x) file_extension="$OPTARG" ;;
+ \?|*) stupid ;;
+ esac
+done
+shift "$(( $OPTIND - 1 ))"
+
+if [ $# -eq 0 ] ; then
+ echo "error: no files provided"
+ stupid
+fi
+
+for file in "$@" ; do
+ new_filename="$(printf 's%02de%02d%s\n' "$season" "$episode" "$file_extension")"
+ mv --verbose "$file" "$new_filename"
+ episode=$(( $episode + 1 ))
+done
+