Fix some small bugs
This commit is contained in:
parent
bc4b508ac5
commit
38e180c0b3
28
spmenuify
28
spmenuify
|
@ -50,19 +50,19 @@ print_theme_list() {
|
||||||
print_theme_list_t() {
|
print_theme_list_t() {
|
||||||
find "$THEME_DIR" -type f > /tmp/list
|
find "$THEME_DIR" -type f > /tmp/list
|
||||||
|
|
||||||
if [ -z "$(cat /tmp/list)" ]; then
|
while read -r l; do
|
||||||
printf "%b%s\n" "\033[0;31m" "No themes installed."
|
file="$(basename "$l")"
|
||||||
else
|
printf "%s" "$l" | grep -qE "[.]desc|[.]png" && continue
|
||||||
while read -r l; do
|
if [ -f "${l}.png" ] && [ "$ENABLE_IMAGE_PREVIEW" = "true" ]; then
|
||||||
file="$(basename "$l")"
|
printf "img://%s\t%s\n" "${l}.png" "${file}"
|
||||||
printf "%s" "$l" | grep -qE "[.]desc|[.]png" && continue
|
set=true
|
||||||
if [ -f "${l}.png" ] && [ "$ENABLE_IMAGE_PREVIEW" = "true" ]; then
|
else
|
||||||
printf "img://%s\t%s\n" "${l}.png" "${file}"
|
printf "%s\n" "${file}"
|
||||||
else
|
set=true
|
||||||
printf "%s\n" "${file}"
|
fi
|
||||||
fi
|
done < "/tmp/list"; rm -f /tmp/list
|
||||||
done < "/tmp/list"; rm -f /tmp/list
|
|
||||||
fi
|
[ "$set" != "true" ] && printf "%b%s\n" "\033[0;31m" "No themes installed."
|
||||||
}
|
}
|
||||||
|
|
||||||
check_spmenu_ver() {
|
check_spmenu_ver() {
|
||||||
|
@ -114,7 +114,7 @@ opt_theme() {
|
||||||
case "$o" in
|
case "$o" in
|
||||||
"Remove")
|
"Remove")
|
||||||
[ "$(printf "Yes\nNo\n" | spmenu --require-match --lines 40 --columns 1 --prompt "Remove themes?" --no-allow-typing --hide-mode --hide-input --hide-match-count --hide-left-arrow --hide-right-arrow --hide-highlighting --hide-caps --normal)" != "Yes" ] && main && exit 0
|
[ "$(printf "Yes\nNo\n" | spmenu --require-match --lines 40 --columns 1 --prompt "Remove themes?" --no-allow-typing --hide-mode --hide-input --hide-match-count --hide-left-arrow --hide-right-arrow --hide-highlighting --hide-caps --normal)" != "Yes" ] && main && exit 0
|
||||||
rm -f "$THEME_DIR/$output"
|
rm -f "$THEME_DIR/$output" "$THEME_DIR/$output*"
|
||||||
main && exit 0
|
main && exit 0
|
||||||
;;
|
;;
|
||||||
"View")
|
"View")
|
||||||
|
|
Loading…
Reference in a new issue