Commit Graph

28 Commits

Author SHA1 Message Date
Paul Meyer
30b3868787 themes: load/save by name if possible
This fixes #443 and a downstream issue in nixpkgs:
https://github.com/NixOS/nixpkgs/issues/460344

Short description of the latter issue: I nixpkgs, different versions
of btop are installed under different paths. If a user selects a
theme and it is saved to the config by its absolute path, that path
will be broken after an update.

To solve this, we allow writing the theme name only into the config,
and we save the theme by name if possible.

When selecting a theme, we check if it is the first (with respect to
the load oder priority: custom > user > system) match for this
filename in the list of available themes. If it is, we save it by
filename instead of using the full path. If there is another theme
with the same name and higher priority, we save using the full path.

This should also be compatible with the previous behavior of being
able to load themes by name from $XDG_CONFIG_PATH/btop/themes.

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2026-05-13 10:27:39 +02:00
Steffen Winter
fd9cd479ad refactor: use fmt::format like interface for logger
This will only allocate the log message if a log file exists and the log
level is enabled. The interface forwards it's arguments to fmt::format.
This gets also rid of some global state and hides it in the btop_log.cpp
translation unit.

Closes: https://github.com/aristocratos/btop/issues/1347
2026-01-04 12:11:21 +01:00
Barry Van Deerlin
6c4f019953 Feat: Process following
- Added menu options to automatically enable process following for selected process from Detailed View

- Changed Pause keybinding to 'u'

- Added keybinding 'F' (Shift+F) to follow selected process

- Added Follow and Pause buttons

- Processes are followed through sorting, tree mode, and reverse mode changes.

- Process following disengages if the process is no longer in the list.
  - Either because it died or it was filtered out

- Changing the selection exits following mode unless the list is paused.
  - While paused, changing sorting method returns the selection to the followed process.
  - Unpausing also returns the selection to the process being followed.
  - Opening a new detailed view will change the process being followed.

- Pause banner has been upgraded to a Pause and Following banner.
  - Text on banner reflects current state.
  - Banner background color changes depending on mode.
  - Currently:
    - Red Banner (Process list paused)
    - Blue Banner (Following process)
    - Purple Banner (Paused list and following process)
2025-12-30 01:42:54 -08:00
adeci
04c3a938a8 feat: add --themes-dir flag 2025-11-10 10:04:49 +07:00
Barry Van Deerlin
fd8c4453c4 fix tty theme for pause banner
was accidently using ansi foreground color instead of background color for banner
2025-11-01 17:04:52 -07:00
Barry Van Deerlin
a74f678df2 Implement feat Process list pausing
This feature sets a keybinding 'F' that pauses the processes list.
- It doesn't stop collection.
- It stops new processes from being added and dead processes from being removed.
- It also disables sorting except when:
    - the sorting mode is changed.
    - switching between normal and tree view modes.
- While paused the user can still scroll through the processes list.
- Detailed view can still be opened and it displays current information.
- Details view shows accurate elapsed time for dead processes
- When pausing is enabled it displays a banner on the last line of the processes list.
- Added menu option for preserving cpu and mem usage of dead processes or not
2025-10-26 19:22:58 -07:00
bad code
f366b38f85 Avoid copies in ltrim() and ltrim() 2025-04-23 20:15:12 +00:00
bad code
34c0532ca7 Reduce variable scope 2025-04-23 20:15:12 +00:00
Andrea Jemmett
0127e8b3cd Fix comments in theme files 2024-05-12 16:09:09 +02:00
aristocratos
ced47a960f Replace robin_hood map and set with STD alternative and add safeVal() function for map/vector access with fallback 2023-12-25 02:26:13 +01:00
aristocratos
aca2e4be75 Fix whitespace indent -> tab indent 2023-07-26 14:38:48 +02:00
aristocratos
33faa01910 Revert fmt submodule to static fmt folder in include 2023-07-26 14:34:15 +02:00
Στέφανος
2f1bf0df01 No need for const & in bool 2022-10-04 11:47:26 +03:00
Στέφανος
eda6873071 Further 'cleanup' 2022-10-02 21:52:27 +03:00
aristocratos
8d3e4575be Fixed: stoi 0 literal pointer to nullptr and added more clamping for gradient array access 2021-09-21 17:21:42 +02:00
aristocratos
8583a8a2ef Added menu system 2021-09-12 15:58:23 +02:00
aristocratos
8bd97b4f24 Fixed memory leak and greatly reduced general memory usage 2021-08-17 22:33:21 +02:00
aristocratos
acb20832d1 Added mem and disks 2021-08-10 20:20:33 +02:00
aristocratos
e33b4b7b0c Added Cpu::collect(), Cpu::get_cpuName() and Cpu::getHz() 2021-07-29 23:40:56 +02:00
aristocratos
9ee9f3232d Added functionality for text editing and slight modifications to default theme colors 2021-07-24 02:13:26 +02:00
aristocratos
5d4e2ce182 Loads... 2021-07-21 03:17:34 +02:00
aristocratos
e3b297e82a Proc::draw gradients 2021-07-05 22:18:58 +02:00
aristocratos
ad5864266a Added Proc::_collect_details for process info box collection 2021-07-04 01:18:48 +02:00
aristocratos
36f0264485 Added theme loadfile function 2021-06-25 23:58:19 +02:00
aristocratos
c222805383 Why not and or 2021-06-21 22:52:55 +02:00
aristocratos
3a783ae4a5 Added themes and 16 color mode 2021-06-20 22:07:04 +02:00
aristocratos
3e92a5e89a More file reorganizations 2021-06-19 22:48:31 +02:00
aristocratos
d459d088a0 File reorganization and more efficient build 2021-06-19 14:57:27 +02:00