Compare commits

...

4 commits
1.0 ... master

Author SHA1 Message Date
Jacob c5699bd8d7 Version bump: 1.1 2023-08-28 11:09:02 +02:00
Jacob d8eada8a7b improve slightly 2023-08-08 22:38:01 +02:00
Jacob 73ac9c5658 Replace use of xdotool with new spmenu FIFO 2023-08-08 21:04:06 +02:00
speedie 38e180c0b3 Fix some small bugs 2023-07-26 19:39:09 +02:00
2 changed files with 30 additions and 20 deletions

View file

@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
VER = 1.0 VER = 1.1
DESTDIR = "/usr" DESTDIR = "/usr"
NAME = spmenuify NAME = spmenuify
SHELL = /bin/sh SHELL = /bin/sh

View file

@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
VERSION="${VERSION:-1.0}" VERSION="${VERSION:-1.1}"
THEME_DIR="${THEME_DIR:-$HOME/.config/spmenu/themes}" THEME_DIR="${THEME_DIR:-$HOME/.config/spmenu/themes}"
REPO_DIR="${REPO_DIR:-${XDG_CACHE_DIR:-$HOME/.cache}/spmenuify/repo}" REPO_DIR="${REPO_DIR:-${XDG_CACHE_DIR:-$HOME/.cache}/spmenuify/repo}"
CONFIG_FILE="${CONFIG_FILE:-$HOME/.config/spmenu/spmenuify/spmenuify.conf}" CONFIG_FILE="${CONFIG_FILE:-$HOME/.config/spmenu/spmenuify/spmenuify.conf}"
@ -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
printf "%b%s\n" "\033[0;31m" "No themes installed."
else
while read -r l; do while read -r l; do
file="$(basename "$l")" file="$(basename "$l")"
printf "%s" "$l" | grep -qE "[.]desc|[.]png" && continue printf "%s" "$l" | grep -qE "[.]desc|[.]png" && continue
if [ -f "${l}.png" ] && [ "$ENABLE_IMAGE_PREVIEW" = "true" ]; then if [ -f "${l}.png" ] && [ "$ENABLE_IMAGE_PREVIEW" = "true" ]; then
printf "img://%s\t%s\n" "${l}.png" "${file}" printf "img://%s\t%s\n" "${l}.png" "${file}"
set=true
else else
printf "%s\n" "${file}" printf "%s\n" "${file}"
set=true
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")
@ -155,22 +155,32 @@ opt_theme() {
print_about() { print_about() {
printf "\033[0;31ms" > /tmp/spmenuify_about_out printf "\033[0;31ms" > /tmp/spmenuify_about_out
sleep 0.1; printf "update" > /tmp/spmenu.fifo
printf "\033[0;32mp" >> /tmp/spmenuify_about_out printf "\033[0;32mp" >> /tmp/spmenuify_about_out
sleep 0.1; printf "update" > /tmp/spmenu.fifo
printf "\033[0;33mm" >> /tmp/spmenuify_about_out printf "\033[0;33mm" >> /tmp/spmenuify_about_out
sleep 0.1; printf "update" > /tmp/spmenu.fifo
printf "\033[0;34me" >> /tmp/spmenuify_about_out printf "\033[0;34me" >> /tmp/spmenuify_about_out
sleep 0.1; printf "update" > /tmp/spmenu.fifo
printf "\033[0;35mn" >> /tmp/spmenuify_about_out printf "\033[0;35mn" >> /tmp/spmenuify_about_out
sleep 0.1; printf "update" > /tmp/spmenu.fifo
printf "\033[0;36mu" >> /tmp/spmenuify_about_out printf "\033[0;36mu" >> /tmp/spmenuify_about_out
sleep 0.1; printf "update" > /tmp/spmenu.fifo
printf "\033[0;37mi" >> /tmp/spmenuify_about_out printf "\033[0;37mi" >> /tmp/spmenuify_about_out
sleep 0.1; printf "update" > /tmp/spmenu.fifo
printf "\033[0;38mf" >> /tmp/spmenuify_about_out printf "\033[0;38mf" >> /tmp/spmenuify_about_out
sleep 0.1; printf "update" > /tmp/spmenu.fifo
printf "\033[1;31my " >> /tmp/spmenuify_about_out printf "\033[1;31my " >> /tmp/spmenuify_about_out
sleep 1 sleep 0.1; printf "update" > /tmp/spmenu.fifo
printf "\033[1;32m %s\n" "$VERSION" >> /tmp/spmenuify_about_out printf "\033[1;32m%s\n" "$VERSION" >> /tmp/spmenuify_about_out
sleep 0.1
printf "update" > /tmp/spmenu.fifo
sleep 1 sleep 1
printf "Written by speedie & contributors\n" >> /tmp/spmenuify_about_out printf "Written by speedie & contributors\n" >> /tmp/spmenuify_about_out
[ -x "$(command -v xdotool)" ] && [ -n "$DISPLAY" ] && xdotool key control printf "update" > /tmp/spmenu.fifo
sleep 1 sleep 1
printf "\033[0;34mLicensed under the GNU General Public License version 3.0.\n\n" >> /tmp/spmenuify_about_out printf "\033[0;34mLicensed under the GNU General Public License version 3.0.\n\n" >> /tmp/spmenuify_about_out
[ -x "$(command -v xdotool)" ] && [ -n "$DISPLAY" ] && xdotool key control printf "update" > /tmp/spmenu.fifo
} }
about() { about() {