Update the `system-info` directory with the addition of a `systemd`
service file and an new Linux script to display current CPU temperature
and core/thread utilization. Update `.conduit.yaml` with addition
`apt` dependencies `sysstat` and `jq`. Update the install and remove
scripts to setup and tear down the `systemd` user unit. Lastly, decrease
the `tmux` status line update interval from 5 to 2 seconds.
The `system-info` directory contains scripts and configuration files to
install and remove a `launchd` user agent on macOS which collects
information about the system and outputs it to the file
`~/.cache/tmux/system-info`. This file is then read periodically by
`tmux` and the contents displayed in the status line.
iTerm2 has tmux integration which I don't care for, this integration
mucks up using tmux as the shell for a profile. To work around this, the
`visor.zsh` script is used in the _Send text at start_ for the a Quake
style visor profile as follows:
```
source ~/.config/tmux/visor.zsh
```
For pagers such as `less` which don't support terminal mouse features
enable scrolling with the mouse wheel by emulating the behaviour using
`send-keys -t= {up,down}` when in alternate (fullscreen) mode.
These bindings retain the expected behaviour when using programs which
do support terminal mouse events and copy-mode.
Sometimes when yanking large blocks of text from a pane larger than its
size in copy mode did not work. Switch to using `xclip` from `xsel` to
see if this works better.
Make using the `@vim$TMUX_PANE` window flag much more robust by
unsetting it every time the zsh prompt is drawn and setting it again
using a `FocusGained` `autocmd` in vim. This removes the need for the
hacky check for zsh in the conditional defined in the `in_vim` variable.
Fixes#6 by setting a window option called `vim$TMUX_PANE` during vim
setup, and removing it when vim exits:
```vim
if $TMUX !=# ''
" Set tmux window option to detect when to change pane.
let s:tmux_option = '@vim'.substitute($TMUX_PANE, '%', '\\%', 'g')
call system('tmux set-window-option '.s:tmux_option.' 1')
au VimLeave * call system('tmux set-window-option -u '.s:tmux_option)
endif
```
Then update the `is_vim` conditional shell statement to check if this
variables exists for the current pane to determine when to change tmux
pane or pass through the binding to vim.
```conf
in_vim='[[ "$(tmux show-window-options)" = *"@vim#{pane_id}"* ]] && \
[[ "#{pane_current_command}" != zsh ]]'
```
Additionally check if the vim task has been backgrounded by comparing
the value of `#{pane_current_command}`, this is likely a bit brittle if
backgrounding is used heavily but works otherwise.