fbgen 1.1 KB

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. echo -e "#!/bin/bash\n"
  3. awk '/^!/ {gsub(/!/, ""); printf "#%s\n", $0}' $1 # convert any comments to bash format
  4. awk -F# '/^*background/ {printf "\n# %s\n", $0} \
  5. /^*foreground/ {printf "# %s\n", $0}' $1 # include original background and foreground as comments
  6. awk -F# '/^*background/ {printf "\necho -en \"\\e]P0%s\"\n\n", $2} \
  7. /*color1\y/ {printf "echo -en \"\\e]P1%s\"\n", $2} \
  8. /*color2\y/ {printf "echo -en \"\\e]P2%s\"\n", $2} \
  9. /*color3\y/ {printf "echo -en \"\\e]P3%s\"\n", $2} \
  10. /*color4\y/ {printf "echo -en \"\\e]P4%s\"\n", $2} \
  11. /*color5\y/ {printf "echo -en \"\\e]P5%s\"\n", $2} \
  12. /*color6\y/ {printf "echo -en \"\\e]P6%s\"\n", $2} \
  13. /*color7\y/ {printf "echo -en \"\\e]P7%s\"\n", $2} \
  14. /*color8\y/ {printf "echo -en \"\\e]P8%s\"\n", $2} \
  15. /*color9\y/ {printf "echo -en \"\\e]P9%s\"\n", $2} \
  16. /*color10\y/ {printf "echo -en \"\\e]PA%s\"\n", $2} \
  17. /*color11\y/ {printf "echo -en \"\\e]PB%s\"\n", $2} \
  18. /*color12\y/ {printf "echo -en \"\\e]PC%s\"\n", $2} \
  19. /*color13\y/ {printf "echo -en \"\\e]PD%s\"\n", $2} \
  20. /*color14\y/ {printf "echo -en \"\\e]PE%s\"\n", $2} \
  21. /*color15\y/ {printf "echo -en \"\\e]PF%s\"\n", $2}' $1