bottom icon indicating copy to clipboard operation
bottom copied to clipboard

Config or CLI flag to set default Process sort-by

Open IFcoltransG opened this issue 1 year ago • 1 comments

Config or CLI flag to set default Process sort-by

I'm looking for a way to set the default sorting method for the Process widget when bottom starts.

When I open a system monitor, it's usually to check memory usage of processes. The process widget defaults to sorting by CPU, meaning I need to press an extra key to get it to sort by memory. I would like to set the 'sort-by' only once in config or in the command-line flags I use to start btm.

IFcoltransG avatar Sep 17 '22 12:09 IFcoltransG

While this feature is still in development, here is a workaround to have bottom sort processes by memory usage. This requires dtach to work.

sock_path="$(mktemp -d)/dtach.sock"   # Set dtach socket path
dtach -n "$sock_path" -E btm --basic  # Run bottom in virtual (dtach) terminal
echo m | dtach -p "$sock_path"        # Simulate pressing "m" key in that virtual terminal
dtach -a "$sock_path"                 # Connect to the virtual terminal to see and interact with bottom

danielrode avatar Jun 20 '24 16:06 danielrode