-- Leo's gemini proxy

-- Connecting to rawtext.club:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

=====================================================================
             ___       __  _ __
  ___  _____/ (_)___  / /_(_) /__
 / _ \/ ___/ / / __ \/ __/ / //_/
/  __/ /__/ / / /_/ / /_/ / ,<
\___/\___/_/_/ .___/\__/_/_/|_|
            /_/
=====================================================================

Pocket CHIP Terminal Dashboard

2021-04-04 | #100daystooffload #hack #chip


When I first got my Pocket C.H.I.P.[1] one of the first thoughts I had was to use it as sort of a mini-desktop terminal to display things like weather, new mail, etc. After doing some other tinkering[2] with it first, it has been on my desk the last couple of weeks displaying the following information,


1: https://www.ecliptik.com/Pocket-CHIP/

2: https://www.ecliptik.com/CHIP-Serial-Console/


Latest local toot in Fosstodon[3] using Toot[4]

Top 10 Hacker News[5] posts using haxor-news[6]

Current weather from wttr.in[7]

Current time with tty-clock[8]

Currenly playing track on Spotify using walt-grover[9]


Pocket C.H.I.P Terminal Dashboard [IMG]


3: https://fosstodon.org/web/timelines/public/local

4: https://github.com/ihabunek/toot

5: https://news.ycombinator.com

6: https://github.com/donnemartin/haxor-news

7: https://wttr.in

8: https://github.com/xorg62/tty-clock

9: https://github.com/ecliptik/walt-grover



Setup


Tmux[10] is the heart of the setup, with each applet in it's own terminal pane and then borders turned off so it looks like a single seamless screen. Running in tmux has the added benefit of detaching the dashboard, like when you want to watch some vaporwave on the framebuffer[11] or sharing the screen from ssh for remote control.


10: https://github.com/tmux/tmux

11: https://www.ecliptik.com/CHIP-Vaporwave/


The tools used in these panes are a combination of `watch` to refresh every 60 seconds or a small shell script. I attempted to use `watch` for everything, but some commands didn't work well with the ASCII escape codes even with the `--color` option.


It's using tmuxinator[12] to save the layout and restore the dashboard after a reboot.


12: https://github.com/tmuxinator/tmuxinator


Tmuxinator config in `~/.config/tmuxinator/chip.yaml`


name: chip
root: ~/

windows:
  - CHIP:
      layout: 7bd9,60x33,0,0[60x7,0,0,0,60x13,0,8,3,60x7,0,22{27x7,0,22,4,32x7,28,22,9},60x3,0,30,6]
      panes:
        - watch -n60 -t --color "toot timeline --local --public --count 1 --once | sed '/^$/d' | grep -v '─────────────────' | grep -v 'ID ' | sed 's/\s\{2,\}/_TOKEN_/' | awk -F_TOKEN_ {'print \$1'}"
        - watch -n60 -t --color "hn top 10 | head -n -3 | sed 's/^[ \t]*//' | grep -v 'points by' | awk -F\( {'print \$1'} | sed -e 's/\.\s\s\s/. /g'"
        - /home/chip/bin/weather.sh
        - bin/tty-clock -m -B -D -C 5
        - watch -n120 -t --color "/home/chip/bin/spotify/spotify.rb"
  - amfora:
      - amfora
  - serial:

Additional configuration includes updating the pocketchip-batt[13] utility to better display charging and how much battery is remaining and putting it and the CHIPs IP address into the right status of the tmux toolbar.


13: https://github.com/aleh/pocketchip-batt


Terminal blanking is turned off so the display is always on.


setterm -blank 0

Wifi powersave feature is turned off since there were issues with it losing DNS and occasional loss of network connectivity


sudo /sbin/iw dev wlan0 set power_save off

Tmux config in `~/.tmux.conf`,


#Switch Windows
bind-key n next-window
bind-key m previous-window

#Set 256 colors
set -g default-terminal "screen-256color"

# start window numbering at 1
set -g base-index 1

# start pane numbering at 1
set -g pane-base-index 1

#Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter

#Clock
set-option -g clock-mode-colour yellow

#Switch panels with vi keybindings
bind k selectp -U # switch to panel Up
bind j selectp -D # switch to panel Down
bind h selectp -L # switch to panel Left
bind l selectp -R # switch to panel Right

set-option -g status on
set-option -g status-interval 1
set-option -g status-keys vi
set-option -g status-position bottom

set-option -g visual-activity on
set-window-option -g status-left ""
set-window-option -g monitor-activity on
set-window-option -g window-status-activity-style "none"
set-option -g status-right "#( ~/bin/right-status.sh )"

#### COLOUR (Solarized light)

# default statusbar colors
set-option -g status-style fg=yellow,bg=black #yellow and base02

# default window title colors
set-window-option -g window-status-style fg=brightblue,bg=default #base0 and default
#set-window-option -g window-status-style dim

# active window title colors
set-window-option -g window-status-current-style fg=brightred,bg=default #orange and default
#set-window-option -g window-status-current-style bright

# pane border
set-option -g pane-border-style fg=black #base02
set-option -g pane-active-border-style fg=black #base01

# message text
set-option -g message-style fg=brightred,bg=black #orange and base01

# pane number display
set-option -g display-panes-active-colour blue #blue
set-option -g display-panes-colour brightred #orange

# clock
set-window-option -g clock-mode-colour green #green

# bell
set-window-option -g window-status-bell-style fg=black,bg=red #base02, red

Tags


chip

hack

100daystooffload

____________________________________________________________________


Home

-- Response ended

-- Page fetched on Tue Sep 21 08:50:44 2021