Customization¶
Aliases¶
If you use an option of Ducker very often, you should consider making a shortcut for it in your shell. In Bash-like shells, you can make aliases. Let’s say we want to add an option to search for articles in Wikipedia; we can create a Bash alias for that.
alias wikipedia='ducker \!w'
After that, calling wikipedia
in the shell will open the main
page of wikipedia, and calling wikipedia free software
would open the “Free software” article from wikipedia.
Note that we’re using DuckDuckGo bangs and that the
exclamation mark (!) must be escaped in Bash. To make Bash
remember your alias for your next sessions you must add
it to your .bashrc
file.
Colors of the interactive mode¶
Ducker allows you to customize the color scheme via a six-letter string, reminiscent of BSD LSCOLORS. The six letters represent the colors of:
- indices,
- titles,
- URLs,
- nothing (may probably be used in a later version),
- abstracts,
- and prompts
respectively. The six-letter string is passed in either as the argument to the –colors option.
We offer the following colors/styles:
Letter Color/Style a black b red c green d yellow e blue f magenta g cyan h white i bright black j bright red k bright green l bright yellow m bright blue n bright magenta o bright cyan p bright white A-H bold version of the lowercase-letter color I-P bold version of the lowercase-letter bright color x normal X bold y reverse video Y bold reverse video
The default colors string is GKlgxy, which stands for
- bold bright cyan indices
- bold bright green titles
- bright yellow URLs
- cyan metadata/publishing info
- normal abstracts
- reverse video prompts
Note that:
- Bright colors (implemented as x1b[90m - x1b[97m) may not be available in all color-capable terminal emulators;
- Some terminal emulators draw bold text in bright colors instead;
- Some terminal emulators only distinguish between bold and bright colors via a default-off switch.
Please consult the manual of your terminal emulator as well as https://en.wikipedia.org/wiki/ANSI_escape_code for details.