Archive

Archive for November, 2019

use tmux as a “GUI” interface

November 16, 2019 Leave a comment

Problem
I have a console application that clears the screen, draws a table and updates it every second in an infinite loop (let’s call it Part A). If this application is started with a specific command-line parameter, then it starts in interactive mode (Part B). From Part B I can give some commands that control Part A. How could I display both Part A and Part B in the terminal?

Solution
You can do it with tmux. With tmuxp, it’s even simpler. Here is a config file called sample.yaml that you can load with “tmuxp load sample.yaml“.

session_name: main-pane-height
windows:
- layout: main-horizontal
  options:
    main-pane-height: 35
  panes:
  - shell_command:
    - echo top pane
  - shell_command:
    - echo bottom pane
  window_name: Title Comes Here

This creates two panes and executes the specified commands in the panes. With this I could start Part A in the top pane, and Part B in the bottom pane.

Categories: bash Tags: , , , , ,

htop in full details

November 16, 2019 Leave a comment

See https://peteris.rocks/blog/htop/ for a very detailed explanation of the htop command.

Categories: linux Tags:

crop images easily

November 2, 2019 Leave a comment

Problem
You have lots of images and you want to crop them. How to do it without losing your hair?

Solution
I just found a nice little hobby project for this: https://github.com/weclaw1/inbac.

Under Manjaro, I had to install tkinter too: “sudo pacman -S tk“.

Reddit discussion here.

Categories: python Tags: , ,