bump version: 0.2

add multisel for spmenuify
This commit is contained in:
speedie 2023-05-19 14:13:00 +02:00
parent f2c72c37f0
commit b1f0266649
3 changed files with 26 additions and 19 deletions

View file

@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
VER = 0.1
VER = 0.2
DESTDIR = "/usr"
NAME = spmenuify
SHELL = /bin/sh
@ -36,9 +36,12 @@ uninstall:
rm -rf ~/.config/${NAME}
rm -f ${PREFIX}${DESTDIR}/bin/${NAME}
dist:
clean:
rm -f *.zst* *.tar.gz ${NAME}-${VER}.PKGBUILD PKGBUILD.orig
dist: clean
mkdir -p ${NAME}-${VER}
cp ${NAME} spmenu_profile README.md LICENSE Makefile *.mk ${NAME}-${VER}
cp ${NAME} spmenu_profile README.md LICENSE Makefile PKGBUILD buildconf build.sh ${NAME}-${VER}
tar -cf ${NAME}-${VER}.tar ${NAME}-${VER}
gzip ${NAME}-${VER}.tar
rm -rf ${NAME}-${VER}.tar ${NAME}-${VER}
@ -47,7 +50,7 @@ pkg_arch: dist
command -v makepkg > /dev/null || exit 1
[ -f PKGBUILD ] || exit 1
cp -f PKGBUILD PKGBUILD.orig
sed -i "s/VERSION/$(VERSION)/g; s/MD5SUM/$$(md5sum *.tar.gz | cut -d ' ' -f 1)/g" PKGBUILD
sed -i "s/VERSION/${VER}/g; s/MD5SUM/$$(md5sum *.tar.gz | cut -d ' ' -f 1)/g" PKGBUILD
makepkg -sfr --sign || exit 1
rm -rf src/ pkg/ *.tar.gz
cp PKGBUILD spmenu-$(VERSION).PKGBUILD; mv PKGBUILD.orig PKGBUILD
cp PKGBUILD ${NAME}-${VER}.PKGBUILD; mv PKGBUILD.orig PKGBUILD

View file

@ -1,3 +1,4 @@
# spmenuify
Theme manager for spmenu
See spmenu wiki for more information.

View file

@ -18,7 +18,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
THEME_DIR="${THEME_DIR:-$HOME/.config/spmenu/themes}"
print_list() {
@ -62,18 +61,20 @@ list_files() {
[ ! -x "$(command -v spmenu_run)" ] && printf "spmenu_run not found, can't continue.\n" && exit 1
export LS_ARGS="--color=always -a"
selfile="$(spmenu_run -fm "$HOME" --stdout -a "--insert --prompt Select:" | sed -e 's/\x1b\[[0-9;]*m//g')"
spmenu_run -fm "$HOME" --stdout -a "--require-match --insert --prompt Select:" | sed -e 's/\x1b\[[0-9;]*m//g' > /tmp/spmenuify_out
[ ! -f "$selfile" ] && main
[ "$(printf "Yes\nNo\n" | spmenu --lines 40 --columns 1 --prompt "Install theme ${selfile}?" --no-allow-typing --hide-mode --hide-input --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --hide-caps --normal)" != "Yes" ] && main
[ "$(printf "Yes\nNo\n" | spmenu --require-match --lines 40 --columns 1 --prompt "Install theme(s) $(cat /tmp/spmenuify_out)?" --no-allow-typing --hide-mode --hide-input --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --hide-caps --normal)" != "Yes" ] && main
grep -q "theme" "$selfile" && cp "$selfile" "$THEME_DIR/"
while read -r theme; do
[ ! -f "$theme" ] && continue
grep -q "theme" "$theme" && cp "$theme" "$THEME_DIR/"
done < /tmp/spmenuify_out; rm -f /tmp/spmenuify_out
main
}
enable_theme() {
[ "$(printf "Yes\nNo\n" | spmenu --lines 40 --columns 1 --prompt "Enable theme ${output}?" --no-allow-typing --hide-mode --hide-input --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --hide-caps --normal)" != "Yes" ] && main
[ "$(printf "Yes\nNo\n" | spmenu --require-match --lines 40 --columns 1 --prompt "Enable theme ${output}?" --no-allow-typing --hide-mode --hide-input --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --hide-caps --normal)" != "Yes" ] && main
[ -f "$THEME_DIR/$output" ] && cp -f "$THEME_DIR/$output" "$HOME/.config/spmenu/theme.conf" && \
command -v notify-send > /dev/null && notify-send "Enabled" "Enabled theme $output"
@ -86,7 +87,7 @@ preview() {
[ -f "$HOME/.config/spmenu/theme.conf" ] && cp "$HOME/.config/spmenu/theme.conf" "/tmp/theme.conf"
[ -f "$THEME_DIR/$output" ] && cp -f "$THEME_DIR/$output" "$HOME/.config/spmenu/theme.conf"
printf "\033[0;31mItem 1\n\033[0;32mItem 2\n\033[0;33mItem 3\n\033[0;34mItem 4\n\033[0;35mItem 5\n\033[0;36mItem 6\n\033[0;37mItem 7\n\033[0;38mItem 8\n\033[1;31mItem 9\n\033[1;32mItem 10\n\033[1;33mItem 11\n\033[1;34mItem 12\n\033[1;35mItem 13\n\033[1;36mItem 14\n\033[1;37mItem 15\n\033[1;38mItem 16\n\
\033[0;41mItem 1\n\033[0;42mItem 2\n\033[0;43mItem 3\n\033[0;44mItem 4\n\033[0;45mItem 5\n\033[0;46mItem 6\n\033[0;47mItem 7\n\033[0;48mItem 8\n\033[1;41mItem 9\n\033[1;42mItem 10\n\033[1;43mItem 11\n\033[1;44mItem 12\n\033[1;45mItem 13\n\033[1;46mItem 14\n\033[1;47mItem 15\n\033[1;48mItem 16\n" | spmenu --lines 40 --columns 1 --prompt "Preview" --no-allow-typing
\033[0;41mItem 1\n\033[0;42mItem 2\n\033[0;43mItem 3\n\033[0;44mItem 4\n\033[0;45mItem 5\n\033[0;46mItem 6\n\033[0;47mItem 7\n\033[0;48mItem 8\n\033[1;41mItem 9\n\033[1;42mItem 10\n\033[1;43mItem 11\n\033[1;44mItem 12\n\033[1;45mItem 13\n\033[1;46mItem 14\n\033[1;47mItem 15\n\033[1;48mItem 16\n" | spmenu --require-match --lines 40 --columns 1 --prompt "Preview" --no-allow-typing
if [ -f "/tmp/theme.conf" ]; then
mv "/tmp/theme.conf" "$HOME/.config/spmenu/theme.conf" || rm -f "$HOME/.config/spmenu/theme.conf"
fi
@ -95,18 +96,20 @@ preview() {
}
view_theme() {
output="$(print_theme_list | spmenu --lines 40 --columns 1 --prompt "Select a theme to list:" --hide-mode --hide-caps --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --normal | sed -e 's/\x1b\[[0-9;]*m//g')"
[ -f "$THEME_DIR/$output" ] && spmenu --lines 40 --columns 1 --prompt "Viewing theme '$output'" --hide-mode --hide-caps --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --normal < "$THEME_DIR/$output"
output="$(print_theme_list | spmenu --require-match --lines 40 --columns 1 --prompt "Select a theme to list:" --hide-mode --hide-caps --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --normal | sed -e 's/\x1b\[[0-9;]*m//g')"
[ -f "$THEME_DIR/$output" ] && spmenu --require-match --lines 40 --columns 1 --prompt "Viewing theme '$output'" --hide-mode --hide-caps --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --normal < "$THEME_DIR/$output"
main
}
remove() {
output="$(print_theme_list | spmenu --lines 40 --columns 1 --prompt "Select a theme to remove:" --hide-mode --hide-caps --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --normal | sed -e 's/\x1b\[[0-9;]*m//g')"
[ ! -f "$THEME_DIR/$output" ] && main
print_theme_list | spmenu --require-match --lines 40 --columns 1 --prompt "Select a theme to remove:" --hide-mode --hide-caps --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --normal | sed -e 's/\x1b\[[0-9;]*m//g' > /tmp/spmenuify_out
[ "$(printf "Yes\nNo\n" | spmenu --lines 40 --columns 1 --prompt "Remove theme ${output}?" --no-allow-typing --hide-mode --hide-input --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --hide-caps --normal)" != "Yes" ] && main
[ "$(printf "Yes\nNo\n" | spmenu --require-match --lines 40 --columns 1 --prompt "Remove theme(s) $(cat /tmp/spmenuify_out)?" --no-allow-typing --hide-mode --hide-input --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting --hide-caps --normal)" != "Yes" ] && main
rm -f "$THEME_DIR/$output"
while read -r theme; do
[ ! -f "$THEME_DIR/$theme" ] && continue
rm -f "$THEME_DIR/$theme"
done < /tmp/spmenuify_out; rm -f /tmp/spmenuify_out
main
}
@ -114,7 +117,7 @@ remove() {
main() {
check_spmenu_ver
mkdir -p "$HOME/.config/spmenu/"
output="$(print_list | spmenu --lines 40 --columns 1 --prompt "Select:" --hide-mode --hide-caps --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting | sed -e 's/\x1b\[[0-9;]*m//g')"
output="$(print_list | spmenu --require-match --lines 40 --columns 1 --prompt "Select:" --hide-mode --hide-caps --hide-match-count --hide-left-arrow --hide-right-arrow --hide-image --hide-highlighting | sed -e 's/\x1b\[[0-9;]*m//g')"
case "$output" in
"Install") list_files ;;