aboutsummaryrefslogtreecommitdiffstats
path: root/config.def.h
AgeCommit message (Collapse)Author
2022-12-22add brightness and contrast (#396)Berke Kocaoğlu
* Imlib2 supports modifying gamma, brightness and contrast directly while sxiv only supports gamma. Makes sense to extend it to brightness and contrast as well. * Since color corrections need to be aware of each other, they have been refactored into one centralized function. * This also makes the code more hackable as it makes it easier to add more color correction functions without them interfering with each other. Co-authored-by: 0ion9 <finticemo@gmail.com> Co-authored-by: NRK <nrk@disroot.org> Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/396 Reviewed-by: NRK <nrk@disroot.org> Reviewed-by: TAAPArthur <taaparthur@noreply.codeberg.org> Co-authored-by: Berke Kocaoğlu <kberke@metu.edu.tr> Co-committed-by: Berke Kocaoğlu <kberke@metu.edu.tr>
2022-09-10allow disabling anti-aliasing via cli flagNRK
simply running nsxiv with `--anti-alias` will enable anti-aliasing, and running it with `--anti-alias=no` will disable it. the cli flag will overwrite the config.h default. Closes: https://codeberg.org/nsxiv/nsxiv/issues/349
2022-08-11fix: build failure when _SC_PHYS_PAGES is not definedNRK
_SC_PHYS_PAGES isn't POSIX and might not be defined. in such case, just return back `CACHE_SIZE_FALLBACK`. NOTE: POSIX says the `names` in `sysconf()` are "symbolic constants" not necessarily macros. So we might end up returning the fallback in some cases where `_SC_PHYS_PAGES` *was* available, but not defined as a macro. which is not ideal, but nothing fatal. in practice, this shouldn't be an issue since most systems seems to define them to be macros, i've checked Glibc, Musl, OpenBSD, FreeBSD and Haiku. also add a (useful) comment on `config.h` describing the effect higher cache size has. Closes: https://codeberg.org/nsxiv/nsxiv/issues/354
2022-06-25fix: don't use reserved identifiersNRK
identifiers beginning with an underscore is reserved by the C standard.
2022-03-02code-style: slight cleanupsNRK
* put TOP_STATUSBAR under the HAVE_LIBFONTS guard * change get_win_title param to take unsigned char ptr * init UTF8_STRING like other atoms
2022-02-26add config.h option for top statusbar (#231)N-R-K
Closes: https://github.com/nsxiv/nsxiv/issues/230 Co-authored-by: mamg22 <45301823+mamg22@users.noreply.github.com>
2022-02-23use win-title script for customizing window title (#213)N-R-K
this removes the cli flag `-T` as well as related config.h options. Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
2022-01-15Add keybind to scroll to image center (#203)Nick Hanley
There are keybinds for scrolling to the edges of an image but there's no way back to the center. This is particularly annoying while zooming.
2022-01-10make thumbnail bindings configureable via config.h (#167)N-R-K
this allows for configuring thumbnail mode mouse bindings similar to image mode bindings. however we can't put the thumbnails bindings into the existing buttons[] array due to fallthrough. For example M3 would switch mode and then end up selecting an image. which is why thumbnail bindings have been put into it's own array `buttons_tns[]` and `buttons[]` has been renamed to `buttons_img[]` for consistency. Closes: https://github.com/nsxiv/nsxiv/issues/131
2022-01-01Allow setting cache size based on memory percentage (#184)MahouShoujoMivutilde
The problem: 1. For the most people imlib2's default 4MiB is unreasonably low; 2. Hardcoding cache size to ~256MiB has performance benefits and doesn't increase RAM usage too much on relatively modern systems; 3. But we can't do that, because that would be detrimental to low spec systems that (apparently) not (?) building nsxiv from source, as been discussed #171 Solution: Calculate cache size based on total memory. Default is set as 3%, which means: * ~245MiB for 8GiB * ~30MiB for 1GiB * and so on CACHE_SIZE_LIMIT (256MiB by default) sets the highest possible value. And in case we cannot determine the total memory (e.g since _SC_PHYS_PAGES isn't POSIX) use CACHE_SIZE_FALLBACK (32MiB by default) instead. Co-authored-by: NRK <nrk@disroot.org>
2021-12-30fix: broken compilation when using HAVE_LIBFONTS=0 (#194)N-R-K
compilation currently fails with `make HAVE_LIBFONTS=0` due to `EXIT_SUCCESS` not being defined. I assume Xft.h includes stdlib.h which is why compilation works with HAVE_LIBFONTS=1 this switches to using 0 as cg_quit argument in keybindings. if my interpretation of the C99 standard is correct, then 0 and EXIT_SUCCESS means the same thing. > If the value of status is zero or EXIT_SUCCESS, an > implementation-defined form of the status successful termination is > returned.
2021-12-19specify func argument and related cleanup (#183)N-R-K
* specifies the function argument type in commands.h compared to leaving it unspecified. all the functions in cmd_t must have arg_t as it's argument. * changes to commands.h will now trigger a rebuild - this restores old behavior prior to 12efa0e * cg_quit now uses it's argument as exit status * DestroyNotify invokes cg_quit rather than calling exit directly. * Explicitly pass EXIT_SUCCESS to cgquit in keybinding Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
2021-12-01bring back zoom_levels (#156)N-R-K
this still keeps the shorter zoom logic, but adds back the zoom_levels array so that stay close to sxiv. for users who would like to have the zoom step behavior see: https://github.com/nsxiv/nsxiv/pull/156#issuecomment-975182631
2021-11-25allow configuring imlib2's cache size (#171)N-R-K
by default imlib2 uses a 4mb cache, which is quite small. this allows users who have more memory to spare to set a bigger cache size and avoid reloading an already viewed image if it fits into the cache. Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
2021-11-24switch back to whitelisting modifers (#150)N-R-K
* Revert "Allow any set of modifiers to be used in keybindings" this keeps things equal with sxiv while giving users possibility to customize USED_MODMASK if they wish. This reverts commit 3234b0e521cca006a94cb135a88d146122d7f66d. Closes: https://github.com/nsxiv/nsxiv/issues/149 Closes: https://github.com/nsxiv/nsxiv/issues/123 Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
2021-11-24rename: keyhandler_abort -> KEYHANDLER_ABORT (#172)N-R-K
with the exception of arrays, all other var names in config.h are in ALL CAPS. since keyhandler_abort is an unreleased feature, it should be okay to rename it for consistency. though.. in the future we should be more careful about naming when adding new vars to config.h (or the codebase in general.)
2021-11-04make width of navigation area configurable (#155)LuXu
this allows users to configure navigation width from config.h. it also allows disabling the navigation function entirely by using a 0 width. one extra functionality this adds is being able to define an absolute width (in pixels) instead of just percentage via `NAV_IS_REL`. Co-authored-by: NRK <nrk@disroot.org>
2021-10-29Add colors and fonts to config.h (#115)Arthur Williams
Adds a set of config vars to control window fg/bg, bar fg/bg, mark color and bar font. This allows everything that can be done from .Xresources to be configurable from config.h. Co-authored-by: N-R-K <79544946+N-R-K@users.noreply.github.com>
2021-10-27Add default key-binding for DRAG_RELATIVE (#117)LuXu
Ctrl-Button1 now has a relative drag using the XC_fleur cursor. XC_fleur is normally the cursor for "size all" action, which has 4 arrows pointing to 4 directions. Co-authored-by: NRK <nrk@disroot.org>
2021-10-13Make imgcursor a config variable.Arthur Williams
Previously, the value of imgcursor was determined by where a pointer binding was set to a ci_cursor_navigate. If it was then the pointer would change to left/right arrows depending on the position relative to the window. Now the user has full control of over it which also allows them to preserve the behavior in case they wrap the function.
2021-10-11code-style: fix consistency issues all over the codebase (#94)Berke Kocaoğlu
* remove duplicate comment * remove empty tabs and blank lines * move macros and globals ontop * comment to seprate function implementation * fix alignment * switch to *argv[] similar to other suckless code * kill all empty last lines * append comment to endif * reuse existing ARRLEN macro * comment fall through * use while (true) everywhere Co-authored-by: NRK <nrk@disroot.org>
2021-09-30update outdated comment in config.def.h (#105)N-R-K
we're not using 'background', 'foreground' and 'font' anymore. see: 0b20783 and f7557c5
2021-09-25Use zoom steps instead of hard-coding levels (#92)Lu Xu
Co-authored-by: NRK <nrk@disroot.org> Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
2021-09-24make keyhandler abort key configurable via config.hNRK
2021-09-20Allow any set of modifiers to be used in keybindingsArthur Williams
Previous the code only allowed ShiftMask,ControlMask or Mod1Mask to be used in keybindings and the presence of any others modifiers would be ignored. Most problems generally allow certain modifiers to be be ignored but not most and certainly don't allow Super-A to be treated like A. Now users can use any modifiers they want in keybindings and can also ignore any modifiers they want. By default only ModMask2 (commonly numlock is ignored) Co-authored-by: N-R-K <79544946+N-R-K@users.noreply.github.com>
2021-09-16config.def.h: change enums to static const intsNRK
2021-09-16Rename, Update Docs and Prepare for Release (#9)Berke Kocaoğlu
Co-authored-by: Guilherme Rugai Freire <41879254+GRFreire@users.noreply.github.com> Co-authored-by: N-R-K <79544946+N-R-K@users.noreply.github.com> Co-authored-by: NRK <nrk@disroot.org> Co-authored-by: Arthur Williams <taaparthur@gmail.com> Co-authored-by: eylles <ed.ylles1997@gmail.com>
2021-09-16set title based on prefix and suffix (#23)qsmodo
Co-authored-by: Guilherme Rugai Freire <41879254+GRFreire@users.noreply.github.com> Co-authored-by: NRK <nrk@disroot.org> Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
2021-09-16add new keybind, Ctrl-a to toggle animation (#33)N-R-K
* add new keybind, Ctrl-a to toggle animation Closes: https://github.com/nsxiv/nsxiv/issues/27 * Format consistency This keeps in line with other actions that have multiple keybinds Co-authored-by: eylles <ed.ylles1997@gmail.com> Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
2021-09-16Implement fill scale modeBerke Kocaoğlu
2019-04-19Change colors and font only via X resourcesBert Münnich
2019-04-19Add Xresources font supportvxid
2019-01-26New colorsBert Münnich
2019-01-26Mention X resource properties in build-time color configBert Münnich
2019-01-23Align compile-time color options with X resource colorsBert Münnich
Two colors are more than enough!
2019-01-23Simplify X resource retrievalBert Münnich
Also makes the color names in config.def.h constant again.
2019-01-23Add Xresources capabilitynoamcore
2018-06-09Change default key-bindings of mark commandsBert Münnich
*Shift-m* feels much more natural for *mark_range* and *Ctrl-u* is decent enough for *unmark_all*.
2018-06-09Add mark range functionDaniel Lublin
Sets the marked state of all images ranging from the latest marked/unmarked image to the current image, to the state of that latest toggled image.
2018-01-22Use argument to select between two drag methodsphi
2017-10-06Improve mouse supportBert Münnich
None of the mouse mappings uses a keyboard modifier, making it possible to access the most basic features by only using the mouse. Next/previous image with left button depending on cursor position, middle button for dragging, right button for switching to thumnail mode and wheel for zooming. Users can keep the old behaviour by simply not adapting the changes to the buttons array in config.def.h to their config.h file.
2017-09-06Make pan fraction configurablejcalve
2016-08-06Use Xft for font loading and text drawingBert Münnich
2015-12-20Build-time option for default thumbnail size; fixes issue #207Bert Münnich
2015-01-11Simplified command argumentsBert Münnich
2015-01-05Apply gamma value on thumbnails too; fixes issue #193Bert Münnich
2014-09-29Moved thumbnail sizes array to config.def.hBert Münnich
2014-09-28Removed obsolete thumbnail dimension configuration settingBert Münnich
2014-09-28Added thumbnail zooming...Bert Münnich
- Key mappings +/- are now general commands - Use JPG as thumbnail cache file format instead of PNG - Fixes issue #161
2014-08-17Increased contrast in default color setBert Münnich