customization.rst 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. .. _Customization:
  2. =============
  3. Customization
  4. =============
  5. Aliases
  6. =======
  7. If you use an option of Ducker very often, you
  8. should consider making a shortcut for it in your shell.
  9. In Bash-like shells, you can make aliases. Let's say we want
  10. to add an option to search for articles in Wikipedia;
  11. we can create a Bash alias for that.
  12. ``alias wikipedia='ducker \!w'``
  13. After that, calling ``wikipedia`` in the shell will open the main
  14. page of wikipedia, and calling ``wikipedia free software``
  15. would open the `"Free software" article from wikipedia`_.
  16. Note that we're using `DuckDuckGo bangs`_ and that the
  17. exclamation mark (!) must be escaped in Bash. To make Bash
  18. remember your alias for your next sessions you must add
  19. it to your ``.bashrc`` file.
  20. .. _colors-of-the-interactive-mode:
  21. Colors of the interactive mode
  22. ==============================
  23. Ducker allows you to customize the color scheme via a six-letter string,
  24. reminiscent of BSD LSCOLORS. The six letters represent the colors of:
  25. - indices,
  26. - titles,
  27. - URLs,
  28. - nothing (may probably be used in a later version),
  29. - abstracts,
  30. - and prompts
  31. respectively. The six-letter string is passed in either as the argument
  32. to the --colors option.
  33. We offer the following colors/styles:
  34. ====== =================================================
  35. Letter Color/Style
  36. ====== =================================================
  37. a black
  38. b red
  39. c green
  40. d yellow
  41. e blue
  42. f magenta
  43. g cyan
  44. h white
  45. i bright black
  46. j bright red
  47. k bright green
  48. l bright yellow
  49. m bright blue
  50. n bright magenta
  51. o bright cyan
  52. p bright white
  53. A-H bold version of the lowercase-letter color
  54. I-P bold version of the lowercase-letter bright color
  55. x normal
  56. X bold
  57. y reverse video
  58. Y bold reverse video
  59. ====== =================================================
  60. The default colors string is GKlgxy, which stands for
  61. - bold bright cyan indices
  62. - bold bright green titles
  63. - bright yellow URLs
  64. - cyan metadata/publishing info
  65. - normal abstracts
  66. - reverse video prompts
  67. Note that:
  68. - Bright colors (implemented as \x1b[90m - \x1b[97m) may not be available in all color-capable terminal emulators;
  69. - Some terminal emulators draw bold text in bright colors instead;
  70. - Some terminal emulators only distinguish between bold and bright colors via a default-off switch.
  71. Please consult the manual of your terminal emulator as well as
  72. https://en.wikipedia.org/wiki/ANSI_escape_code for details.
  73. .. _DuckDuckGo bangs: https://duckduckgo.com/bang
  74. .. _"Free software" article from wikipedia: https://en.wikipedia.org/wiki/Free_software