Skip to content

Commit

Permalink
Update script to avoid possible issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveDavenport committed Feb 9, 2025
1 parent 00b15de commit 1942c52
Showing 1 changed file with 34 additions and 40 deletions.
74 changes: 34 additions & 40 deletions mkdocs/docs/themes/capture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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<span size='x-large' color='red'>:-)</span>\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<span size='x-large' color='red'>:-)</span>\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}

0 comments on commit 1942c52

Please sign in to comment.