diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-04 14:02:28 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-04 14:02:28 +0200 |
commit | dc03fb40fe55a7dc88c07509b47299223d4d5815 (patch) | |
tree | 93d33df604005218d287d535b37dfc4ab9de307d | |
parent | 1496b8724c39dd6d16a46916ad4ed47a83a44852 (diff) |
cleaned up scripts, use sh (-> dash) where possible
-rwxr-xr-x | bin/common/autofetch | 2 | ||||
-rwxr-xr-x | bin/common/gign | 2 | ||||
-rwxr-xr-x | bin/common/hextorgb | 15 | ||||
-rwxr-xr-x | bin/common/wt | 4 | ||||
-rwxr-xr-x | bin/common/y2feed | 2 | ||||
-rwxr-xr-x | bin/extra/arr_hjkl | 2 | ||||
-rwxr-xr-x | bin/extra/cht.sh | 8 | ||||
-rwxr-xr-x | bin/extra/colorscript | 2 | ||||
-rwxr-xr-x | bin/extra/cycleKB | 2 | ||||
-rwxr-xr-x | bin/extra/ehbtodl | 2 | ||||
-rwxr-xr-x | bin/extra/vimastp | 2 | ||||
-rwxr-xr-x | bin/guiscripts/dmclip | 4 | ||||
-rwxr-xr-x | bin/guiscripts/dmdsktp | 2 | ||||
-rwxr-xr-x | bin/guiscripts/dmemoji | 4 | ||||
-rwxr-xr-x | bin/guiscripts/dmfm | 2 | ||||
-rwxr-xr-x | bin/guiscripts/dmhelp | 2 | ||||
-rwxr-xr-x | bin/guiscripts/dminw | 2 | ||||
-rwxr-xr-x | bin/guiscripts/dmlang | 10 | ||||
-rwxr-xr-x | bin/guiscripts/dmpass | 2 | ||||
-rwxr-xr-x | bin/guiscripts/dmpassgen | 5 | ||||
-rwxr-xr-x | bin/guiscripts/dmpdf | 2 | ||||
-rwxr-xr-x | bin/guiscripts/dmpower | 2 | ||||
-rwxr-xr-x | bin/guiscripts/dmvid | 2 | ||||
-rwxr-xr-x | bin/guiscripts/dmvol | 2 | ||||
-rwxr-xr-x | bin/guiscripts/dmyt-not | 2 | ||||
-rwxr-xr-x | bin/guiscripts/sturl | 2 |
26 files changed, 44 insertions, 44 deletions
diff --git a/bin/common/autofetch b/bin/common/autofetch index 3dcdc15..ae48444 100755 --- a/bin/common/autofetch +++ b/bin/common/autofetch @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh GREEN='\033[0;32m' NC='\033[0m' # Fetches for git repos, meant to run at startup diff --git a/bin/common/gign b/bin/common/gign index e3ba12a..e82c0b8 100755 --- a/bin/common/gign +++ b/bin/common/gign @@ -1,2 +1,2 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh git status --porcelain=v1 | grep "^??" | cut -d' ' -f2- | sed -r 's/^["](.*)["]$/\1/' >> .gitignore diff --git a/bin/common/hextorgb b/bin/common/hextorgb index b268db5..e70040e 100755 --- a/bin/common/hextorgb +++ b/bin/common/hextorgb @@ -1,7 +1,8 @@ -#!/usr/bin/env bash -cat /dev/stdin \ - | tr -d '#' | tr '[:lower:]' '[:upper:]' \ - | sed -r 's/([0-9A-F]{2})/\1\n/g ; i ibase=16' \ - | bc \ - | tr '\n' ',' \ - | sed 's/.$// ; s/.*/rgb(&)/' +#!/usr/bin/env sh +cat /dev/stdin | + tr -d '#' | + tr '[:lower:]' '[:upper:]' | + sed -r 's/([0-9A-F]{2})/1n/g ; i ibase=16' | + bc | + tr 'n' ',' | + sed 's/.$// ; s/.*/rgb(&)/' diff --git a/bin/common/wt b/bin/common/wt index 81081c8..0568b99 100755 --- a/bin/common/wt +++ b/bin/common/wt @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/sh echo "$@" > /tmp/truewhile.tmp while true do - bash /tmp/truewhile.tmp + sh /tmp/truewhile.tmp sleep 1 clear done diff --git a/bin/common/y2feed b/bin/common/y2feed index e5e2201..0f27d68 100755 --- a/bin/common/y2feed +++ b/bin/common/y2feed @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh test -z "${url:=$1}" \ && url="$(cat /dev/stdin)" diff --git a/bin/extra/arr_hjkl b/bin/extra/arr_hjkl index 0ef542e..d134c78 100755 --- a/bin/extra/arr_hjkl +++ b/bin/extra/arr_hjkl @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh if [ "$(xmodmap -pke | grep ' = h')" ] then diff --git a/bin/extra/cht.sh b/bin/extra/cht.sh index 7cd4892..681fc69 100755 --- a/bin/extra/cht.sh +++ b/bin/extra/cht.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # shellcheck disable=SC1117,SC2001 # # [X] open section @@ -234,13 +234,13 @@ EOF if CHEATSH_TEST_STANDALONE=YES \ CHEATSH_TEST_SKIP_ONLINE=NO \ CHEATSH_TEST_SHOW_DETAILS=NO \ - PYTHON=../ve/bin/python bash run-tests.sh | tee -a "$LOG" + PYTHON=../ve/bin/python sh run-tests.sh | tee -a "$LOG" then printf "\033[0;32m%s\033[0m\n" "SUCCESS" else printf "\033[0;31m%s\033[0m\n" "FAILED" echo "Some tests were failed. Run the tests manually for further investigation:" - echo " cd $PWD; bash run-tests.sh)" + echo " cd $PWD; sh run-tests.sh)" fi ) @@ -773,7 +773,7 @@ while true; do fi input=$( - rlwrap -H "$CHTSH_HOME/history" -pgreen -C cht.sh -S "$full_prompt" bash "$0" --read | sed 's/ *#.*//' + rlwrap -H "$CHTSH_HOME/history" -pgreen -C cht.sh -S "$full_prompt" sh "$0" --read | sed 's/ *#.*//' ) cmd_name=${input%% *} diff --git a/bin/extra/colorscript b/bin/extra/colorscript index 90dacb1..ad74d67 100755 --- a/bin/extra/colorscript +++ b/bin/extra/colorscript @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh counter=0 var1="$(seq 30 38)" diff --git a/bin/extra/cycleKB b/bin/extra/cycleKB index 5674786..e2cb19d 100755 --- a/bin/extra/cycleKB +++ b/bin/extra/cycleKB @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh keyboards_file="/home/aluc/bin/keyboards.txt" cur_keyboard="$(setxkbmap -print | grep "xkb_symbols" | cut -f 2 -d "+")" # Get line number of match diff --git a/bin/extra/ehbtodl b/bin/extra/ehbtodl index 39d8621..df11797 100755 --- a/bin/extra/ehbtodl +++ b/bin/extra/ehbtodl @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh echo "$1" | sed 's/-H/\\\n\t&/g' | sed '/gzip/d' > /tmp/curlcommand.sh sh /tmp/curlcommand.sh > /tmp/ehbso.html vids="$(grep -oE "youtube\.com/embed/.{11}" /tmp/ehbso.html | cut -d'/' -f 3 | tr '\n' ' ')" diff --git a/bin/extra/vimastp b/bin/extra/vimastp index f4ae6b5..28e00a3 100755 --- a/bin/extra/vimastp +++ b/bin/extra/vimastp @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh for var in name vcpus memory cdrom disk_size osinfo do read -p "${var}:" "$var" diff --git a/bin/guiscripts/dmclip b/bin/guiscripts/dmclip index 9c09b04..a1ca634 100755 --- a/bin/guiscripts/dmclip +++ b/bin/guiscripts/dmclip @@ -9,7 +9,7 @@ NotImage () { exit } -selection="$(echo -e "primary\nclipboard\nswap" | +selection="$(echo "primary\nclipboard\nswap" | dmenu -l 1 -g 3 -p "selection:")" if [[ "$selection" == "swap" ]] then @@ -37,7 +37,7 @@ else cut -c -"$DICL_LEN")" fi -menu_option="$(echo -e "save\nload\nimage\nreplace" | +menu_option="$(echo "save\nload\nimage\nreplace" | dmenu -l 1 -g 4 -p "'$disp_clip'")" [ "${menu_option}" ] || exit diff --git a/bin/guiscripts/dmdsktp b/bin/guiscripts/dmdsktp index d0905b7..3711f13 100755 --- a/bin/guiscripts/dmdsktp +++ b/bin/guiscripts/dmdsktp @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Searches through .desktop files and prompt to launch them via dmenu gtk-launch "$(find ~/.local/share/applications \ -maxdepth 1 \ diff --git a/bin/guiscripts/dmemoji b/bin/guiscripts/dmemoji index e9bd4f4..8225f12 100755 --- a/bin/guiscripts/dmemoji +++ b/bin/guiscripts/dmemoji @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # This files comes from: # https://github.com/porras/dmenu-emoji # @@ -21,7 +21,7 @@ case "$1" in fi ;; "") - bash $0 list | dmenu -x -i -g 1 -l 20 -p 'Emoji:' | bash $0 copy + sh $0 list | dmenu -x -i -g 1 -l 20 -p 'Emoji:' | sh $0 copy ;; esac diff --git a/bin/guiscripts/dmfm b/bin/guiscripts/dmfm index 34a9e2c..969c111 100755 --- a/bin/guiscripts/dmfm +++ b/bin/guiscripts/dmfm @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh file=1 while [ "$file" ]; do diff --git a/bin/guiscripts/dmhelp b/bin/guiscripts/dmhelp index 653fa1f..6199c21 100755 --- a/bin/guiscripts/dmhelp +++ b/bin/guiscripts/dmhelp @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh program="${1:-$(dmenu_path | dmenu -l 4 -g 5)}" opfil="/tmp/dmh_options.txt" test -z "${program}" && exit 1 diff --git a/bin/guiscripts/dminw b/bin/guiscripts/dminw index 3ea5fb3..5066ca8 100755 --- a/bin/guiscripts/dminw +++ b/bin/guiscripts/dminw @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh WINDOWID=${1:-$(xdotool getwindowfocus)} WIDTH=$(xdotool getwindowgeometry -s ${WINDOWID} | grep WIDTH | cut -d ' ' -f 2) dmenu_run -w ${1:-$(xdotool getwindowfocus)} -c diff --git a/bin/guiscripts/dmlang b/bin/guiscripts/dmlang index 0009704..0e9672e 100755 --- a/bin/guiscripts/dmlang +++ b/bin/guiscripts/dmlang @@ -1,7 +1,5 @@ -#!/usr/bin/env bash -choice="$(\ - echo -e "us\ngb\nbe" \ - | dmenu \ - -p "($(setxkbmap -query | awk 'NR==3 {print $2}'))" \ -)" +#!/usr/bin/env sh +choice="$(echo "us\ngb\nbe" | + dmenu -p "($(setxkbmap -query | + awk 'NR==3 {print $2}'))")" setxkbmap "${choice:-us}" diff --git a/bin/guiscripts/dmpass b/bin/guiscripts/dmpass index 9d79660..bb7bee2 100755 --- a/bin/guiscripts/dmpass +++ b/bin/guiscripts/dmpass @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh store="$HOME/.password-store" lscmd="ls --group-directories-first" dmenucmd="dmenu -l 4 -g 2" diff --git a/bin/guiscripts/dmpassgen b/bin/guiscripts/dmpassgen index c627a1d..12d911d 100755 --- a/bin/guiscripts/dmpassgen +++ b/bin/guiscripts/dmpassgen @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh choice="$(echo -ne "multiline\nsingle" | dmenu -l 1 -g 2)" test -z "${choice}" && exit 1 @@ -12,7 +12,8 @@ then test -z "${login}" && exit 1 url="$(echo -n "" | dmenu -p "url:")" test -z "${url}" && exit 1 - echo -e "${password}\nlogin: ${login}\nurl: ${url}" | pass insert -mf "${password}" + echo "${password}\nlogin: ${login}\nurl: ${url}" | + pass insert -mf "${password}" pass generate -ci "${password}" else pass generate -cf "${password}" diff --git a/bin/guiscripts/dmpdf b/bin/guiscripts/dmpdf index 2d51760..e8d4601 100755 --- a/bin/guiscripts/dmpdf +++ b/bin/guiscripts/dmpdf @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh tmp="/tmp/dmpdf" find ${1:-$HOME/docs $HOME/dl} 2> /dev/null | grep -E ".+\.pdf" | sort > "$tmp" diff --git a/bin/guiscripts/dmpower b/bin/guiscripts/dmpower index c6c7fe4..5c333a8 100755 --- a/bin/guiscripts/dmpower +++ b/bin/guiscripts/dmpower @@ -1,3 +1,3 @@ #!/bin/sh -choice="$(echo -e "poweroff\nreboot\nhibernate" | dmenu -l 1 -g 3)" +choice="$(echo "poweroff\nreboot\nhibernate" | dmenu -l 1 -g 3)" test -z "$choice" || doas "$choice" diff --git a/bin/guiscripts/dmvid b/bin/guiscripts/dmvid index fe3155e..51971e6 100755 --- a/bin/guiscripts/dmvid +++ b/bin/guiscripts/dmvid @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh find ${1:-~/vids ~/dl} 2> /dev/null | grep -E ".+\.(webm|mp4|mpeg|mkv)$" | sort > /tmp/dmvids diff --git a/bin/guiscripts/dmvol b/bin/guiscripts/dmvol index a73e128..8909de7 100755 --- a/bin/guiscripts/dmvol +++ b/bin/guiscripts/dmvol @@ -2,7 +2,7 @@ while true do volume="$(mpc volume | awk '{print $2}' | cut -f1 -d'%')" - choice="$(echo -e "plus\nmin" | + choice="$(echo "plus\nmin" | dmenu -g 2 -l 1 -p "$volume" | sed 's/plus/+/;s/min/-/')" test -z "$choice" && break diff --git a/bin/guiscripts/dmyt-not b/bin/guiscripts/dmyt-not index 4783a8d..293ddde 100755 --- a/bin/guiscripts/dmyt-not +++ b/bin/guiscripts/dmyt-not @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh # Open a video from channels.yt-not by selecting the channel channel="$(awk '{print $2}' ~/.local/share/yt-not/channels.yt-not | dmenu -l 2 -g 4)" video_id="$(awk "/$channel/ {print \$3}" ~/.local/share/yt-not/channels.yt-not )" diff --git a/bin/guiscripts/sturl b/bin/guiscripts/sturl index bf1fb02..c738c8e 100755 --- a/bin/guiscripts/sturl +++ b/bin/guiscripts/sturl @@ -1,7 +1,7 @@ #!/bin/sh regex='(((https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)' -url="$(cat | tr -d '\n' | grep -Eo "$regex" | dmenu -x -c -g 1 -l 10)" +url="$(tr -d '\n' | grep -Eo "$regex" | dmenu -x -c -g 1 -l 10)" [ -z "$url" ] && exit 1 case $1 in |