patches.def.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. /* Patches */
  2. /* The alpha patch adds transparency for the dmenu window.
  3. * You need to uncomment the corresponding line in config.mk to use the -lXrender library
  4. * when including this patch.
  5. * https://github.com/bakkeby/patches/blob/master/dmenu/dmenu-alpha-5.0_20210725_523aa08.diff
  6. */
  7. #define ALPHA_PATCH 1
  8. /* This adds padding for dmenu in similar fashion to the similarly named patch for dwm. The idea
  9. * is to have dmenu appear on top of the bar when using said patch in dwm.
  10. * https://github.com/bakkeby/patches/wiki/barpadding
  11. */
  12. #define BARPADDING_PATCH 0
  13. /* This patch adds a border around the dmenu window. It is intended to be used with the center
  14. * or xyw patches, to make the menu stand out from similarly coloured windows.
  15. * http://tools.suckless.org/dmenu/patches/border/
  16. */
  17. #define BORDER_PATCH 1
  18. /* By default the caret in dmenu has a width of 2 pixels. This patch makes that configurable
  19. * as well as overridable via a command line option.
  20. * https://github.com/DarkSamus669/dmenu-patches/blob/main/dmenu-caretwidth-5.2.diff
  21. */
  22. #define CARET_WIDTH_PATCH 1
  23. /* This patch makes dmenu case-insensitive by default, replacing the
  24. * case-insensitive -i option with a case sensitive -s option.
  25. * http://tools.suckless.org/dmenu/patches/case-insensitive/
  26. */
  27. #define CASEINSENSITIVE_PATCH 1
  28. /* This patch centers dmenu in the middle of the screen.
  29. * https://tools.suckless.org/dmenu/patches/center/
  30. */
  31. #define CENTER_PATCH 1
  32. /* Minor patch to enable the use of Ctrl+v (XA_PRIMARY) and Ctrl+Shift+v (CLIPBOARD) to paste.
  33. * By default dmenu only supports Ctrl+y and Ctrl+Shift+y to paste.
  34. */
  35. #define CTRL_V_TO_PASTE_PATCH 1
  36. /* This patch adds a flag (-dy) which makes dmenu run the command given to it whenever input
  37. * is changed with the current input as the last argument and update the option list according
  38. * to the output of that command.
  39. * https://tools.suckless.org/dmenu/patches/dynamicoptions/
  40. */
  41. #define DYNAMIC_OPTIONS_PATCH 0
  42. /* This patch will allow for emojis on the left side with a colored background when selected.
  43. * To test this try running:
  44. * $ echo -e ":b here\n:p there\n:r and here" | ./dmenu -p "Search..." -W 400 -l 20 -i -h -1
  45. * NB: the original patch came embedded with the the xyw patch, the morecolors patch and the
  46. * line height patch and as such is intended to be combined with these.
  47. * https://tools.suckless.org/dmenu/patches/emoji-highlight/
  48. */
  49. #define EMOJI_HIGHLIGHT_PATCH 0
  50. /* This patch make it so that fuzzy matches gets highlighted and is therefore meant
  51. * to be used together with the fuzzymatch patch.
  52. * https://tools.suckless.org/dmenu/patches/fuzzyhighlight/
  53. */
  54. #define FUZZYHIGHLIGHT_PATCH 1
  55. /* This patch adds support for fuzzy-matching to dmenu, allowing users to type non-consecutive
  56. * portions of the string to be matched.
  57. * https://tools.suckless.org/dmenu/patches/fuzzymatch/
  58. */
  59. #define FUZZYMATCH_PATCH 1
  60. /* Adds fzf-like functionality for dmenu.
  61. * Refer to https://github.com/DAFF0D11/dafmenu/ for documentation and example use cases.
  62. * https://github.com/DAFF0D11/dafmenu/blob/master/patches/dmenu-fzfexpect-5.1.diff
  63. */
  64. #define FZFEXPECT_PATCH 1
  65. /* Allows dmenu's entries to be rendered in a grid by adding a new -g flag to specify
  66. * the number of grid columns. The -g and -l options can be used together to create a
  67. * G columns * L lines grid.
  68. * https://tools.suckless.org/dmenu/patches/grid/
  69. */
  70. #define GRID_PATCH 0
  71. /* This patch adds the ability to move left and right through a grid.
  72. * This patch depends on the grid patch.
  73. * https://tools.suckless.org/dmenu/patches/gridnav/
  74. */
  75. #define GRIDNAV_PATCH 0
  76. /* This patch highlights the individual characters of matched text for each dmenu list entry.
  77. * The fuzzy highlight patch takes precedence over this patch.
  78. * https://tools.suckless.org/dmenu/patches/highlight/
  79. */
  80. #define HIGHLIGHT_PATCH 0
  81. /* This will automatically sort the search result so that high priority items are shown first.
  82. * https://tools.suckless.org/dmenu/patches/highpriority/
  83. */
  84. #define HIGHPRIORITY_PATCH 0
  85. /* This patch causes dmenu to print out the current text each time a key is pressed.
  86. * https://tools.suckless.org/dmenu/patches/incremental/
  87. */
  88. #define INCREMENTAL_PATCH 0
  89. /* This patch adds an option to provide preselected text.
  90. * https://tools.suckless.org/dmenu/patches/initialtext/
  91. */
  92. #define INITIALTEXT_PATCH 0
  93. /* This patch adds a flag which will cause dmenu to select an item immediately if there
  94. * is only one matching option left.
  95. * https://tools.suckless.org/dmenu/patches/instant/
  96. */
  97. #define INSTANT_PATCH 0
  98. /* This patch adds a '-h' option which sets the minimum height of a dmenu line. This helps
  99. * integrate dmenu with other UI elements that require a particular vertical size.
  100. * http://tools.suckless.org/dmenu/patches/line-height/
  101. */
  102. #define LINE_HEIGHT_PATCH 1
  103. /* This patch adds a -wm flag which sets override_redirect to false; thus letting your window
  104. * manager manage the dmenu window.
  105. *
  106. * This may be helpful in contexts where you don't want to exclusively bind dmenu or want to
  107. * treat dmenu more as a "window" rather than as an overlay.
  108. * https://tools.suckless.org/dmenu/patches/managed/
  109. */
  110. #define MANAGED_PATCH 0
  111. /* This patch adds an additional color scheme for highlighting entries adjacent to the current
  112. * selection.
  113. * https://tools.suckless.org/dmenu/patches/morecolor/
  114. */
  115. #define MORECOLOR_PATCH 1
  116. /* This patch adds basic mouse support for dmenu.
  117. * https://tools.suckless.org/dmenu/patches/mouse-support/
  118. */
  119. #define MOUSE_SUPPORT_PATCH 1
  120. /* Without this patch when you press Ctrl+Enter dmenu just outputs current item and it is not
  121. * possible to undo that.
  122. * With this patch dmenu will output all selected items only on exit. It is also possible to
  123. * deselect any selected item.
  124. * Also refer to the dmenu_run replacement on the below URL that supports multiple selections.
  125. *
  126. * This patch is not compatible with, and takes precedence over, the json, printinputtext,
  127. * pipeout and non-blocking stdin patches.
  128. *
  129. * https://tools.suckless.org/dmenu/patches/multi-selection/
  130. */
  131. #define MULTI_SELECTION_PATCH 0
  132. /* This patch provides dmenu the ability for history navigation similar to that of bash.
  133. *
  134. * If you take this patch then it is recommended that you also uncomment the line in the
  135. * dmenu_run script which replaces the exec command.
  136. *
  137. * https://tools.suckless.org/dmenu/patches/navhistory/
  138. */
  139. #define NAVHISTORY_PATCH 0
  140. /* This patch adds back in the workaround for a BadLength error in the Xft library when color
  141. * glyphs are used. This is for systems that do not have an updated version of the Xft library
  142. * (or generally prefer monochrome fonts).
  143. */
  144. #define NO_COLOR_EMOJI_PATCH 0
  145. /* Adds the -S option to disable sorting menu items after matching. Useful, for example, when menu
  146. * items are sorted by their frequency of use (using an external cache) and the most frequently
  147. * selected items should always appear first regardless of how they were exact, prefix, or
  148. * substring matches.
  149. * https://tools.suckless.org/dmenu/patches/no-sort/
  150. */
  151. #define NO_SORT_PATCH 0
  152. /* This is a patch to have dmenu read stdin in a non blocking way, making it wait for input both
  153. * from stdin and from X. This means that you can continue feeding dmenu while you type.
  154. * This patch is meant to be used along with the incremental patch, so that you can use stdout
  155. * to feed stdin.
  156. *
  157. * This patch is not compatible with the json and multi-selection patches, both of which takes
  158. * precedence over this patch.
  159. *
  160. * https://tools.suckless.org/dmenu/patches/non_blocking_stdin/
  161. */
  162. #define NON_BLOCKING_STDIN_PATCH 0
  163. /* Adds text which displays the number of matched and total items in the top right corner of dmenu.
  164. * https://tools.suckless.org/dmenu/patches/numbers/
  165. */
  166. #define NUMBERS_PATCH 0
  167. /* This patch adds simple markup for dmenu using pango markup.
  168. * This depends on the pango library v1.44 or greater.
  169. * You need to uncomment the corresponding lines in config.mk to use the pango libraries
  170. * when including this patch.
  171. *
  172. * Note that the pango patch is incompatible with the scroll patch and will result in
  173. * compilation errors if both are enabled.
  174. *
  175. * Note that the pango patch does not protect against the BadLength error from Xft
  176. * when color glyphs are used, which means that dmenu will crash if color emoji is used.
  177. *
  178. * If you need color emoji then you may want to install this patched library from the AUR:
  179. * https://aur.archlinux.org/packages/libxft-bgra/
  180. *
  181. * A long term fix for the libXft library is pending approval of this pull request:
  182. * https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/1
  183. *
  184. * Also see:
  185. * https://developer.gnome.org/pygtk/stable/pango-markup-language.html
  186. * https://github.com/StillANixRookie/dmenu-pango
  187. */
  188. #define PANGO_PATCH 0
  189. /* With this patch dmenu will not directly display the keyboard input, but instead replace
  190. * it with dots. All data from stdin will be ignored.
  191. * https://tools.suckless.org/dmenu/patches/password/
  192. */
  193. #define PASSWORD_PATCH 0
  194. /* This patch allows the selected text to be piped back out with dmenu. This can be useful if you
  195. * want to display the output of a command on the screen.
  196. * Only text starting with the character '#' is piped out by default.
  197. *
  198. * This patch is not compatible with the json and multi-select patches, both of which takes
  199. * precedence over this one.
  200. *
  201. * https://tools.suckless.org/dmenu/patches/pipeout/
  202. */
  203. #define PIPEOUT_PATCH 0
  204. /* Lifted from the listfullwidth patch this simple change just avoids colors for the prompt (with
  205. * the -p option or in config.h) by making it use the same style as the rest of the input field.
  206. * The rest of the listfullwidth patch is covered by the vertfull patch.
  207. * https://tools.suckless.org/dmenu/patches/listfullwidth/
  208. */
  209. #define PLAIN_PROMPT_PATCH 0
  210. /* This patch changes the behaviour of matched items and the Tab key to allow tab completion.
  211. * https://tools.suckless.org/dmenu/patches/prefix-completion/
  212. */
  213. #define PREFIXCOMPLETION_PATCH 1
  214. /* This patch adds an option -ps to specify an item by providing the index that should be
  215. * pre-selected.
  216. * https://tools.suckless.org/dmenu/patches/preselect/
  217. */
  218. #define PRESELECT_PATCH 0
  219. /* This patch allows dmenu to print out the 0-based index of matched text instead of the matched
  220. * text itself. This can be useful in cases where you would like to select entries from one array
  221. * of text but index into another, or when you are selecting from an ordered list of non-unique
  222. * items.
  223. * https://tools.suckless.org/dmenu/patches/printindex/
  224. */
  225. #define PRINTINDEX_PATCH 0
  226. /* This patch adds a flag (-t) which makes Return key to ignore selection and print the input
  227. * text to stdout. The flag basically swaps the functions of Return and Shift+Return hotkeys.
  228. *
  229. * This patch is not compatible with the multi-select and json patches, both of which takes
  230. * precedence over this one.
  231. *
  232. * https://tools.suckless.org/dmenu/patches/printinputtext/
  233. */
  234. #define PRINTINPUTTEXT_PATCH 0
  235. /* This patch adds a new flag to dmenu with which text input will be rejected if it would
  236. * result in no matching item.
  237. * https://tools.suckless.org/dmenu/patches/reject-no-match/
  238. */
  239. #define REJECTNOMATCH_PATCH 0
  240. /* The input width used to be relative to the input options prior to commit e1e1de7:
  241. * https://git.suckless.org/dmenu/commit/e1e1de7b3b8399cba90ddca9613f837b2dbef7b9.html
  242. *
  243. * This had a performance hit when using large data sets and was removed in favour of having the
  244. * input width take up 1/3rd of the available space.
  245. *
  246. * This option adds that feature back in with some performance optimisations at the cost of
  247. * accuracy and correctness.
  248. */
  249. #define RELATIVE_INPUT_WIDTH_PATCH 0
  250. /* This patch adds a '-1' option which disables Shift-Return and Ctrl-Return.
  251. * This guarantees that dmenu will only output one item, and that item was read from stdin.
  252. * The original patch used '-r'. This was changed to '-1' to avoid conflict with the incremental
  253. * patch.
  254. * https://tools.suckless.org/dmenu/patches/restrict-return/
  255. */
  256. #define RESTRICT_RETURN_PATCH 0
  257. /* This patch adds support for text scrolling and no longer appends '...' for long input as
  258. * it can handle long text.
  259. * https://tools.suckless.org/dmenu/patches/scroll/
  260. */
  261. #define SCROLL_PATCH 0
  262. /* This patch adds -d and -D flags which separates the input into two halves; one half to be
  263. * displayed in dmenu and the other to be printed to stdout. This patch takes precedence over
  264. * the TSV patch.
  265. * https://tools.suckless.org/dmenu/patches/separator/
  266. */
  267. #define SEPARATOR_PATCH 0
  268. /* This patch allows the symbols, which are printed in dmenu to indicate that either the input
  269. * is too long or there are too many options to be shown in dmenu in one line, to be defined.
  270. * https://tools.suckless.org/dmenu/patches/symbols/
  271. */
  272. #define SYMBOLS_PATCH 0
  273. /* With this patch dmenu will split input lines at first tab character and only display first
  274. * part, but it will perform matching on and output full lines as usual.
  275. *
  276. * This can be useful if you want to separate data and representation, for example, a music
  277. * player wrapper can display only a track title to user, but still supply full filename to
  278. * the underlying script.
  279. * https://tools.suckless.org/dmenu/patches/tsv/
  280. */
  281. #define TSV_PATCH 0
  282. /* This patch prevents dmenu from indenting items at the same level as the prompt length.
  283. * https://tools.suckless.org/dmenu/patches/vertfull/
  284. */
  285. #define VERTFULL_PATCH 0
  286. /* Adds extended window manager hints such as _NET_WM_WINDOW_TYPE and _NET_WM_WINDOW_TYPE_DOCK.
  287. * https://github.com/Baitinq/dmenu/blob/master/patches/dmenu-wm_type.diff
  288. */
  289. #define WMTYPE_PATCH 0
  290. /* This patch adds the ability to configure dmenu via Xresources. At startup, dmenu will read and
  291. * apply the resources named below:
  292. * dmenu.font : font or font set
  293. * dmenu.background : normal background color
  294. * dmenu.foreground : normal foreground color
  295. * dmenu.selbackground : selected background color
  296. * dmenu.selforeground : selected foreground color
  297. *
  298. * See patch/xresources.c for more color settings.
  299. *
  300. * https://tools.suckless.org/dmenu/patches/xresources/
  301. */
  302. #define XRESOURCES_PATCH 1
  303. /* This patch adds options for specifying dmenu window position and width.
  304. * The center patch takes precedence over the XYW patch if enabled.
  305. * https://tools.suckless.org/dmenu/patches/xyw/
  306. */
  307. #define XYW_PATCH 0