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>
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
- 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)
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