From 1942c527a81d1044e8adbc65727d56b227efef52 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Sun, 9 Feb 2025 11:15:36 +0100 Subject: [PATCH] Update script to avoid possible issues. --- mkdocs/docs/themes/capture.sh | 74 ++++++++++++++++------------------- 1 file changed, 34 insertions(+), 40 deletions(-) diff --git a/mkdocs/docs/themes/capture.sh b/mkdocs/docs/themes/capture.sh index bb0be6bb3..3506047cf 100755 --- a/mkdocs/docs/themes/capture.sh +++ b/mkdocs/docs/themes/capture.sh @@ -3,55 +3,49 @@ THEMES=../../../themes/*.rasi ROFI_BIN=../../../build/rofi - -function generate_options() -{ - echo -en "rofi\0icon\x1frofi\n" - echo -en "help browser\0icon\x1fhelp-browser\n" - echo -en "thunderbird\0icon\x1fthunderbird\n" - echo -en "Urgent\0icon\x1femblem-urgent\n" - echo -en "Active\0icon\x1fface-wink\n" - echo -en "folder\0icon\x1ffolder\n" - echo -en "Icon font 🐢 🥳\n" - echo -en "Font icon\0icon\x1f:-)\n" - echo -en "Quit\0icon\x1fapplication-exit\n" +function generate_options() { + echo -en "rofi\0icon\x1frofi\n" + echo -en "help browser\0icon\x1fhelp-browser\n" + echo -en "thunderbird\0icon\x1fthunderbird\n" + echo -en "Urgent\0icon\x1femblem-urgent\n" + echo -en "Active\0icon\x1fface-wink\n" + echo -en "folder\0icon\x1ffolder\n" + echo -en "Icon font 🐢 🥳\n" + echo -en "Font icon\0icon\x1f:-)\n" + echo -en "Quit\0icon\x1fapplication-exit\n" } -function run_theme -{ - theme=$1 - BASE=$(basename ${theme}) - NAME=${BASE%.rasi} - export ROFI_PNG_OUTPUT="${NAME}.png" - if [ ${NAME} = "default" ] - then - echo "# Default theme" >> themes.md - else - echo "# [${NAME}](https://github.com/davatorium/rofi/blob/next/themes/${BASE})" >> themes.md - fi - echo "" >> themes.md - generate_options | ${ROFI_BIN} -theme-str "@theme \"${theme}\"" \ - -no-config -dmenu -p "mode" -show-icons \ - -u 3 -a 4 -mesg "Message box for extra information" \ - -take-screenshot-quit 1500 - - echo "![${NAME}](${NAME}.png)" >> themes.md - echo "" >> themes.md +function run_theme { + theme=$1 + BASE="$(basename ${theme})" + NAME=${BASE%.rasi} + export ROFI_PNG_OUTPUT="${NAME}.png" + if [ "${NAME}" = "default" ]; then + echo "# Default theme" >>themes.md + else + echo "# [${NAME}](https://github.com/davatorium/rofi/blob/next/themes/${BASE})" >>themes.md + fi + echo "" >>themes.md + generate_options | ${ROFI_BIN} -theme-str "@theme \"${theme}\"" \ + -no-config -dmenu -p "mode" -show-icons \ + -u 3 -a 4 -mesg "Message box for extra information" \ + -take-screenshot-quit 1500 + + echo "![${NAME}](${NAME}.png)" >>themes.md + echo "" >>themes.md } -echo "# Included Themes" > themes.md - -echo "Below is a list of themes shipped with rofi." >> themes.md -echo "Use \`rofi-theme-selector\` to select and use one of these themes." >> themes.md +echo "# Included Themes" >themes.md +echo "Below is a list of themes shipped with rofi." >>themes.md +echo "Use \`rofi-theme-selector\` to select and use one of these themes." >>themes.md Xvfb :1234 -screen 0 1920x1080x24 & XEPHYR_PID=$! export DISPLAY=:1234 -sleep 0.5; +sleep 0.5 run_theme "default" -for theme in ${THEMES} -do - run_theme ${theme} +for theme in ${THEMES}; do + run_theme "${theme}" done kill ${XEPHYR_PID}