summaryrefslogtreecommitdiffstats
path: root/mkdocs/docs/themes/capture.sh
blob: a99335813f7fc7a5a61c733bb88dc55cbb1666e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash

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 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


Xvfb :1234 -screen 0 1920x1080x24 &
XEPHYR_PID=$!
export DISPLAY=:1234
run_theme "default"
for theme in ${THEMES}
do
  run_theme ${theme}
done
kill ${XEPHYR_PID}