diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/common/ytclipo | 4 | ||||
-rwxr-xr-x | bin/extra/mariadb-adduser | 25 | ||||
-rwxr-xr-x | bin/extra/oclipp | 2 | ||||
-rwxr-xr-x | bin/guiscripts/sturl | 6 | ||||
-rwxr-xr-x | bin/menuscripts/memoji | 2 | ||||
-rwxr-xr-x | bin/menuscripts/mpower | 2 | ||||
-rwxr-xr-x | bin/menuscripts/mpwgen | 4 |
7 files changed, 36 insertions, 9 deletions
diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 6416a15..1a82df2 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -2,7 +2,7 @@ inp="$(ytlink)" >&2 printf "inp: %s\n" "$inp" -# notify-send "ytclipo" "downloading <i>$inp</i>" || : +notify-send "ytclipo" "downloading <i>$inp</i>" || : yt-dlp "$inp" \ --restrict-filenames \ @@ -11,4 +11,4 @@ yt-dlp "$inp" \ -S "res:1080" \ -P "$HOME/vids/youtube/" \ -o "%(channel)s/%(title)s.%(ext)s" -# notify-send "ytclipo" "finished downloading." || : +notify-send "ytclipo" "finished downloading." || : diff --git a/bin/extra/mariadb-adduser b/bin/extra/mariadb-adduser new file mode 100755 index 0000000..d4e1b45 --- /dev/null +++ b/bin/extra/mariadb-adduser @@ -0,0 +1,25 @@ +#!/bin/sh +if [ "$(id -u)" -ne 0 ] +then + >&2 printf "Not root.\n" + exit 1 +fi + +printf 'name? ' +name="$(head -n 1)" +printf 'password? ' +password="$(head -n 1)" +printf 'database? ' +database="$(head -n 1)" + +( + cat <<EOF + CREATE USER '$name'@'%' IDENTIFIED BY '$password'; +EOF + [ "$database" ] && cat <<EOF + GRANT ALL PRIVILEGES ON `$database`.* TO '$name'@'%' WITH GRANT OPTION; + CREATE DATABASE `$database`; + FLUSH PRIVILEGES; +EOF + +) | mariadb diff --git a/bin/extra/oclipp b/bin/extra/oclipp new file mode 100755 index 0000000..b711385 --- /dev/null +++ b/bin/extra/oclipp @@ -0,0 +1,2 @@ +#!/bin/sh +printf "\033]52;c;%s\a" "$(cat | base64)" diff --git a/bin/guiscripts/sturl b/bin/guiscripts/sturl index 5b8b1e7..d261e32 100755 --- a/bin/guiscripts/sturl +++ b/bin/guiscripts/sturl @@ -1,11 +1,11 @@ #!/bin/sh -regex='(((file|https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)' -url="$(tr -d '\n' | grep -Eo "$regex" | tac | commander -cl)" +regex='(((file|https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;!a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)' +url="$(tr -d '\n' | grep -Eo "$regex" | commander -cl)" [ -z "$url" ] && exit 1 case $1 in - 'c') printf '%s' "$url" | xclip -sel c -r ;; + 'c') printf '%s' "$url" | clipp ;; 'o') linkhandler "$url" ;; *) echo "no option" ;; esac diff --git a/bin/menuscripts/memoji b/bin/menuscripts/memoji index 45a74f1..5766238 100755 --- a/bin/menuscripts/memoji +++ b/bin/menuscripts/memoji @@ -17,7 +17,7 @@ case "$1" in printf "%s" "$input" | clipp fi ;; - "") sh "$0" list | commander -p "Emoji:" -x -w 44 -y 10 -c | sh "$0" copy ;; + "") sh "$0" list | commander -p "Emoji:" -xlc | sh "$0" copy ;; esac exit diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index 0d0cdcc..f8f7654 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -1,6 +1,6 @@ #!/bin/sh choice="$( -cat <<EOF | commander -c -w 9 -y 4 +cat <<EOF | commander -c -w 1 -y 4 poweroff suspend hibernate diff --git a/bin/menuscripts/mpwgen b/bin/menuscripts/mpwgen index 51b9bc4..f4f3aa4 100755 --- a/bin/menuscripts/mpwgen +++ b/bin/menuscripts/mpwgen @@ -2,7 +2,7 @@ input () { commander -c -i -p "$1"; } -choice="$(printf "multiline\nsingle\n" | commander -c -d)" +choice="$(printf "multiline\nsingle\n" | commander -c)" [ "$choice" ] || exit 1 password="$(input "name:")" @@ -11,7 +11,7 @@ password="$(input "name:")" if [ "$choice" = "multiline" ] then login="$(find "${PASSWORD_STORE_DIR:=$HOME/.password-store}"/e-mails -type f -maxdepth 1 -iname "*.gpg" -printf "%f\n" | - sed 's/\.gpg$//' | commander -c -d -p 'login:')" + sed 's/\.gpg$//' | commander -c -p 'login:')" [ "$login" ] || exit 1 url="$(input "url:")" [ "$url" ] || exit 1 |