Simple Terminal from SuckLess
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.5 KiB

  1. #define FONT "-*-*-medium-r-*-*-*-120-75-75-*-70-*-*"
  2. #define BOLDFONT "-*-*-bold-r-*-*-*-120-75-75-*-70-*-*"
  3. /* If italic is not availbel, fall back to bold. */
  4. #define ITALICFONT "-*-*-medium-o-*-*-*-120-75-75-*-70-*-*," BOLDFONT
  5. #define ITALICBOLDFONT "-*-*-bold-o-*-*-*-120-75-75-*-70-*-*," BOLDFONT
  6. /* Space in pixels around the terminal buffer */
  7. #define BORDER 2
  8. /* Default shell to use if SHELL is not set in the env */
  9. #define SHELL "/bin/sh"
  10. /* Terminal colors (16 first used in escape sequence) */
  11. static const char *colorname[] = {
  12. /* 8 normal colors */
  13. "black",
  14. "red3",
  15. "green3",
  16. "yellow3",
  17. "blue2",
  18. "magenta3",
  19. "cyan3",
  20. "gray90",
  21. /* 8 bright colors */
  22. "gray50",
  23. "red",
  24. "green",
  25. "yellow",
  26. "#5c5cff",
  27. "magenta",
  28. "cyan",
  29. "white",
  30. [255] = 0,
  31. /* more colors can be added after 255 to use with DefaultXX */
  32. "#cccccc",
  33. "#333333",
  34. };
  35. /* Default colors (colorname index)
  36. foreground, background, cursor, unfocused cursor */
  37. #define DefaultFG 7
  38. #define DefaultBG 0
  39. #define DefaultCS 256
  40. #define DefaultUCS 257
  41. /* Special keys (change & recompile st.info accordingly)
  42. Keep in mind that kpress() in st.c hardcodes some keys.
  43. Mask value:
  44. * Use XK_ANY_MOD to match the key no matter modifiers state
  45. * Use XK_NO_MOD to match the key alone (no modifiers)
  46. key, mask, output */
  47. static Key key[] = {
  48. { XK_BackSpace, XK_NO_MOD, "\177" },
  49. { XK_Insert, XK_NO_MOD, "\033[2~" },
  50. { XK_Delete, XK_NO_MOD, "\033[3~" },
  51. { XK_Home, XK_NO_MOD, "\033[1~" },
  52. { XK_End, XK_NO_MOD, "\033[4~" },
  53. { XK_Prior, XK_NO_MOD, "\033[5~" },
  54. { XK_Next, XK_NO_MOD, "\033[6~" },
  55. { XK_F1, XK_NO_MOD, "\033OP" },
  56. { XK_F2, XK_NO_MOD, "\033OQ" },
  57. { XK_F3, XK_NO_MOD, "\033OR" },
  58. { XK_F4, XK_NO_MOD, "\033OS" },
  59. { XK_F5, XK_NO_MOD, "\033[15~" },
  60. { XK_F6, XK_NO_MOD, "\033[17~" },
  61. { XK_F7, XK_NO_MOD, "\033[18~" },
  62. { XK_F8, XK_NO_MOD, "\033[19~" },
  63. { XK_F9, XK_NO_MOD, "\033[20~" },
  64. { XK_F10, XK_NO_MOD, "\033[21~" },
  65. { XK_F11, XK_NO_MOD, "\033[23~" },
  66. { XK_F12, XK_NO_MOD, "\033[24~" },
  67. };
  68. /* Set TERM to this */
  69. #define TNAME "st-256color"
  70. /* Line drawing characters (sometime specific to each font...) */
  71. static char gfx[] = {
  72. ['f'] = 'o',
  73. ['g'] = '+',
  74. ['i'] = '#',
  75. [255] = 0,
  76. };
  77. /* double-click timeout (in milliseconds) between clicks for selection */
  78. #define DOUBLECLICK_TIMEOUT 300
  79. #define TRIPLECLICK_TIMEOUT (2*DOUBLECLICK_TIMEOUT)
  80. #define TAB 8