Place a large wok or skillet over medium heat and add the rice. Toast the rice for 3 to 4 minutes, gently swirling the wok occasionally, until the grains begin to turn golden brown and fragrant.
Transfer the rice to a mini food processor or coffee grinder, then grind it to a powder. Set it aside.
Add the oil to the wok and place it over medium-high heat. Give the oil a minute to heat up, then add about ½ cup of the sliced shallots, reserving the remaining ¼ cup of shallots. Stir-fry the shallots for about 2 minutes, stirring constantly, until softened and lightly browned, with some crisp edges forming. Remove the shallots from the wok, leaving the oil, and transfer them to a plate.
Add the crumbled tofu to the wok. Let the tofu sit, undisturbed, for a minute or two, then stir. Continue this process for 5 to 7 minutes, until the tofu starts to brown and crisp in spots.
While the tofu cooks, stir the soy sauce, dark soy sauce, and brown sugar together in a small bowl. Add the mixture to the tofu after it has started to brown, then cook the mixture for 1 to 2 minutes more, stirring constantly, until the liquid begins to reduce.
Add the rice powder and Thai chili to the wok. Stir well to coat the tofu with the powder and continue to cook the mixture for 1 to 2 minutes. Add up to ¼ cup of water if the mixture seems too dry.
Remove the wok from heat. Stir in the cooked shallots, the reserved uncooked shallots, lime juice, cilantro, mint, and scallions. Taste-test the mixture and adjust any seasonings to your liking.
Serve over lettuce leaves and garnish with cucumber slices and sweet peppers, if desired.