scripts: fix bashisms

This commit is contained in:
lelgenio 2021-12-10 20:22:16 -03:00
parent f733fe22e4
commit 91272f517e
7 changed files with 19 additions and 23 deletions

View File

@ -9,7 +9,7 @@
papirus-folders -uC "{{@@ accent_color_name @@}}" || papirus-folders -uC "{{@@ accent_color_name @@}}" ||
papirus-folders -uD papirus-folders -uD
} & } > /dev/null &
{%@@ endif @@%} {%@@ endif @@%}
{%@@ if 'materia' in gtk_theme.lower() @@%} {%@@ if 'materia' in gtk_theme.lower() @@%}

View File

@ -7,4 +7,4 @@
else else
qutebrowser $@ qutebrowser $@
fi fi
} &> /dev/null < /dev/null & disown } > /dev/null 2>&1 &

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
# Copyright Cédric Picard 2014 -- License WTFPL # Copyright Cédric Picard 2014 -- License WTFPL
# Inspired by Ranger's -- See https://github.com/hut/ranger # Inspired by Ranger's -- See https://github.com/hut/ranger
# #

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
set -e set -ex
if test -z "$SWAYSOCK" && pidof gnome-shell &> /dev/null if test -z "$SWAYSOCK" && pidof gnome-shell > /dev/null
then then
exit 0 exit 0
fi fi
@ -15,26 +15,26 @@ die() {
} }
# trap die EXIT # trap die EXIT
{%@@ for name in mail | reverse @@%}
mkdir -p "$HOME/.local/share/mail/{{@@ name @@}}/"
{%@@ endfor @@%}
getnew() { getnew() {
pushd "$HOME/.local/share/mail/" >/dev/null cd "$HOME/.local/share/mail/" >/dev/null
find */INBOX*/new -type f | find */INBOX*/new -type f |
sed -E '/Duolingo|LBRY/d' | sed -E '/Duolingo|LBRY/d' |
wc -l wc -l
popd >/dev/null
} }
OLD=$(getnew) OLD=$(getnew)
if test "$1" = "update" && ! pidof mbsync; then if test "$1" = "update" && ! pidof mbsync; then
if ! ping -c3 {{@@ mail.personal.mail @@}} &> /dev/null if ! ping -c3 {{@@ mail.personal.mail @@}} > /dev/null
then then
exit 0 exit 0
fi fi
timeout 120s mbsync -a || mbsync -a
timeout 120s mbsync -a ||
timeout 120s mbsync -a
fi fi
NEW=$(getnew) NEW=$(getnew)

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
RED_ON="$(pidof redshift)" RED_ON="$(pidof redshift)"

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
# {%@@ if launcher == "fuzzel" @@%} # # {%@@ if launcher == "fuzzel" @@%} #
which fuzzel &> /dev/null && which fuzzel &> /dev/null &&

View File

@ -1,19 +1,15 @@
#!/bin/sh #!/bin/sh
get_displays(){ get_displays() {
swaymsg -t get_outputs | swaymsg -t get_outputs |
jq -r 'map(.name)|join("\n")' jq -r 'map(.name)|join("\n")'
} }
actions=( actions="enable disable brightness"
enable
disable
brightness
)
action=$(printf "%s\n" "${actions[@]}" | wdmenu) action=$(printf "%s\n" $actions | wdmenu)
case "$action" in case "$action" in
enable|disable) enable | disable)
output=$(get_displays | wdmenu -p "output") output=$(get_displays | wdmenu -p "output")
swaymsg output "$output" "$action" swaymsg output "$output" "$action"
;; ;;