gtl - Gemini Tiny Logs - A simple TUI for the tinylog format on gemini

Related tags

gtl
Overview

GTL: Gemini Tiny Logs

Goal: A TUI for the tinylogs format on the gemini space.

See screenshots

Installation

gtl requires go ≥ 1.16

From Source

git clone http://git.bacardi55.io/bacardi55/gtl.git
cd gtl
make dependencies
make build

Put the binary in a directory available in your $PATH if you don't want to type the full path to the program.

From Binaries

You can download binaries for linux here. Binaries are only available for linux 386, amd64, arm and arm64 for now.

PS: I don't have a Mac or Windows box easily accessible, so any help/patch on this is appreciated :).

Usage

Quick start:

Assuming you put the binary in ~/bin:

~/bin/gtl # will create the configuration and subscription files in ~/.config/gtl/ and a subscription path.
[~/bin/gtl add --url gemini://capsule.tld/tinylog.gmi # Adding other entries than just my default one.
[# Repeat add command for all the feeds.]
~/bin/gtl --mode cli --limit 10
# Or use the TUI mode:
~/bin/gtl --mode tui

You can still use gtl "continuously":

while true; do clear && ~/bin/gtl --mode cli --limit 10 && sleep 1800; done;

Or use the TUI and refresh the timeline when you want.

Global commands:

gtl --help
gtl --version

Use gtl TUI

Screenshot of the TUI below.

gtl --mode tui

or configure the gtl.toml to set mode = tui (see config below).

PS: TUI is the default mode since v0.4.8

TUI Shortcuts:

?: Display help
r: Refresh timeline (refresh all tinylogs)
t: Display timeline (remove all filters like highlights of specific tinylog)
h: Toggle Highligts only / all entries (keep tinylog filter).
s: Toggle hide/show subscription sidebar (left).
Tab: Switch between timeline and subscription list.
Arrow keys up/down or j/k: navigate
ctrl+n: Open tinylog in $EDITOR. (See configuration below.)
q or Ctrl-C: Quit

You can navigate on the subscription list and:

  • left click or press enter: Will filter only entries from this tinylog and hide all entries from other tinylogs. A Status F or 🔎 is indicated.
  • right click or press alt+enter: Will open a menu to mute / unmute a tinylog. A tinylog muted means no entry from this tinylog are displayed. A Status M or 🔕 is displayed.

TUI Emoji Status:

If tui_status_emoji is set to true in the configuration file (see below), emoji will be used for the status. Otherwise, simple ASCII characters will be used.

  • V or : All good :)
  • X or : Indicates that the feed format is wrong or that no entries has been found.
  • D or ☠️ : Indicates that the capsule/page is unreachable.
  • S or 🔓: Indicates an error with the SSL certificate.
  • F or 🔎: Indicates that the feed is selected. It means only entries from this tinylog are displayed.
  • M or 🔕: Indicates that the feed is muted. It means no entry of this tinylog will be displayed.

Use gtl CLI

Screenshot of the CLI below.

Usage:
	--config configFile	Indicate a specific config file.
	--mode {cli,tui}	Select the cli or tui mode.
	--limit X		When using cli mode, display only X item.
	--help			Display this help message.

Example:

gtl --mode cli --limit 10
gtl --limit 10 # cli mode is default, so this is the same as above.
gtl --mode cli --limit 10 --config path/to/config/file # with specific path for config file.

If you don't provide a config file path, gtl will look for it in {homepath}/.config/gtl/gtl.toml

You need a subscription file though with the list of tinylogs to follow. For easier migration, the format is the same as lace:

 nameOfTinyLog
 nameOfTinyLog2
…

Warning: The nameOfTinyLog is optional. But if you don't indicate one and the tinylog doesn't have an author: @authorName metadata, gtl will not no what to display for the author and will indicate "unknown"

This file should be in your configuration file:

subscribed_data = "path/to/sub/file"

Screenshot of the CLI below.

Configuration

Default configuration file

# Default config file:
# Path to subscribed tinylogs:
subscribed_data = "~/.config/gtl/subs"
# Refresh time:
refresh = 10
# Date display format
date_format = "Mon 02 Jan 2006 15:04 MST"
# Log file:
log_file = "/dev/null"
# Optional: Highlight when text is found in content.
# Separate values by a coma, eg:
# highlights = "@bacardi55, @bacardi, anything"
# Maximum number of entries showed in cli mode. If --limit is used, it will overide this setting.
# Will be ignored in tui mode.
cli_limit = 10
# Mode: either cli or tui
mode = "tui"
# If false, standard ascii characters will be used.
tui_status_emoji = false

# Enable tinylog edition from gtl:
# This will use an external editor,
# configured in your EDITOR environment variable.
# You can check with 'echo $EDITOR' to see if it
# is configured correctly.
# ctrl+n is disabled when set to false.
# Settings available since v0.5.0
allow_edit = false
# Path to tinylog file. This option is ignored if
# allow_edit = false.
# If not a valid file, editing will not be possible
# and ctrl+n will be disabled.
tinylog_path = "path/to/tinylog/file.gmi"
# Path to script to be executed after the edition is done.
# This script needs to be executable.
# If not a valid executable script, it will be ignored.
post_edit_script = "path/to/script"
# Auto refresh feeds after editing the tinylog file.
# Only used when allow_edit = true
# Settings available since v0.5.1
post_edit_refresh = false

By default, gtl will look for ~/.config/gtl/gtl.toml . It will create it if needed.

The --config option only look for the file, it will not create it if the file given as argument of --config doesn't exist.

Subscription management

You can add and remove tinylog entry either manually from the file directly, or use gtl to do it for you:

Subscription management usage:
	add --url url [--title title]	Indicate a new tinylog url (and optional title) to subscribe to.
	rm --url url			Indicate a tinylog url to be removed from the subscription.

Screenshots

TUI mode

Gtl TUI screenshot

CLI mode

Gtl CLI screenshot

Issues
  • TUI mode: tinylog background highlighted for no reason

    TUI mode: tinylog background highlighted for no reason

    Only in TUI mode:

    After the latest mention (in time therefore the first to appear in the feed) every single tinylog has a highlighted background (without bold font unlike intended Highlights)

    As it's visible on the pic, the tinylog before @\szczezuja's tinylog from 13/06 has the normal behavior (no highlighted background) but those following haven't.

    TUI bug 
    opened by UncleReaton 12
  • displays only the named Tinylog (except the last one which is always displayed)

    displays only the named Tinylog (except the last one which is always displayed)

    e.g. When my .config/gtl/subs looks like this:

    <url1> name1
    <url2>
    <url3> name3
    <url4>
    

    It's gonna display tinylog just for <url1>,<url3> and <url4>.

    If I only name <url3> it's gonna display <url3> and <url4>

    bug 
    opened by UncleReaton 4
  • Getting an error with MakeFile

    Getting an error with MakeFile

    When I try to make dependencies I get this error:

    CGO_ENABLED=0 go1.16.4 get "git.sr.ht/~adnano/go-gemini"
    /bin/sh: line 1: go1.16.4: command not found
    make: *** [Makefile:32: dependencies] Error 127
    

    I know nothing about go but I fixed it by replacing on line 1 go1.16.4 by go.

    opened by UncleReaton 2
  • [TUI] Text selection

    [TUI] Text selection

    II know this is very specific so no problem if it's not a priority or even not in your plan at all. In my terminals (ST & urxvt) I'm unable to click on links, so it could be cool if we could select text so that we can copy links (or even any other text).

    Something to note: I'm able to click on tinylogs names in the subscription panel.

    help wanted wontfix 
    opened by UncleReaton 2
  • Error with the access path to tcell

    Error with the access path to tcell

    In the pre-release 0.4.1, it's impossible to make the dependencies due to a bad path. It's returning this : go get: malformed module path "github.com/gdamore/tcell/v2 v2.3

    A quick work-around is to change in the Makefile github.com/gdamore/tcell/v2 v2.3 to github.com/gdamore/tcell. After it's done, everything works fine.

    bug 
    opened by UncleReaton 2
  • [TUI] Indicates when a feed has 0 entry

    [TUI] Indicates when a feed has 0 entry

    Which usually mean the tinylog is not in a compatible format. For now this isn't flag accordingly.

    Feed TUI enhancement 
    opened by bacardi55 1
  • [TUI] Link cropped when wrapped to multiple lines

    [TUI] Link cropped when wrapped to multiple lines

    When the terminal width is small then the text is wrapped to more lines but if a link is wrapped only the first line is considered a link. e.g. : =>https://github.com/bacardi55/gtl/releases/tag/v0.4.5 when wrapped will look like this for instance :

    https://github.com/bacar
    di55/gtl/releases/tag/v0.4.5
    

    Only the first line is a link, so this link brings us to @\bacar profile.

    I don't know if I'm very clear on this issue, sorry if it's the case :[]

    help wanted wontfix 
    opened by UncleReaton 1
  • [CLI] Add ability to add new entry in tinylog

    [CLI] Add ability to add new entry in tinylog

    CLI enhancement 
    opened by bacardi55 1
  • [TUI] Add a refresh message while feeds are refreshed.

    [TUI] Add a refresh message while feeds are refreshed.

    TUI enhancement 
    opened by bacardi55 1
  • Add spartan and/or gopher support

    Add spartan and/or gopher support

    This is just an idea at this stage…

    Idea core enhancement 
    opened by bacardi55 0
  • Cache tinylog responses

    Cache tinylog responses

    Would allow to still display previously read entries from a tinylog that is unresponsive at a time.

    I don't know if it makes really sens so I don't know if I will work on this yet.

    Feed Idea core enhancement 
    opened by bacardi55 0
  • Show the tinylog entry being replied to

    Show the tinylog entry being replied to

    If a reply is found in a tinylog entry that refers to another tinylog that is known (in the subs list) then clicking on the reply line could either:

    • open that tinylog in the window and scroll to the referenced entry (and going back should return you to the last cursor location of the previous tinylog)
    • open a popup window which displays only the referenced entry, not the entire tinylog (and clicking outside the window hides it to return to the previous tinylog)
    TUI blocked enhancement 
    opened by Perelandra0x309 1
  • Bookmarks management

    Bookmarks management

    TUI enhancement 
    opened by bacardi55 0
  • Feature of providing response stub

    Feature of providing response stub

    I think that is less important to start editor from gtl, but gtl could provide some easy way for preparing some template for copy&pasting to editor running, for example, in second window. I thinking about something like browsing through tinylog, and get response stub (date, reference link, nickname, and place for our response).

    ## <Current date in supported format>
    => <Base tinylog> Re: <Base date from selected post>
    <Base nickname>: <Cursor position> or <Quoted base post>
    

    For copy&pasting I suggest consider a new dialog with textfield which will be easy to copy in tmux. Rather than doing some advance solutions with xclip etc.

    TUI blocked enhancement 
    opened by szczja 1
  • Refresh feeds list from known-tinylogs.md

    Refresh feeds list from known-tinylogs.md

    https://codeberg.org/bacardi55/gemini-tinylog-rfc/src/branch/main/Known-tinylogs.md

    opened by bacardi55 0
  • Don't block the TUI while refreshing feeds

    Don't block the TUI while refreshing feeds

    At the moments, the TUI show a full screen message while refreshing feeds and thus stop the user to continue browsing tinylogs entries while refreshing.

    This is done at the moment because otherwhise, the TUI would be frozen while refreshing. And I prefer having this message than an unresponsive TUI during the refresh phase (and at least the user know why).

    It would be better if the refreshing mechanism doesn't block the TUI. It might need some heavy code change to move the timeline construction to an asynchronous tasks that won't block because of the way cview (the tui library) works (or at least who I understood it).

    TUI 
    opened by bacardi55 0
  • Timeline order issue (BST timezone?)

    Timeline order issue (BST timezone?)

    Seems there is an issue in the timeline with some timezone?

    latest-screenshot

    Feed blocked bug 
    opened by bacardi55 1
Releases(v0.5.2)
Owner
bacardi55
bacardi55
Parse awesome-go README file and generate a new README file with repo info.

Awesome Go Extra All data are from awesome-go and GitHub API. Audio and Music Libraries for manipulating audio. Name Description Star Open Issues Crea

Wendell Sun 13 Jul 24, 2021
A simple logging interface for Go

A more minimal logging API for Go Before you consider this package, please read this blog post by the inimitable Dave Cheney. I really appreciate what

null 430 Jul 23, 2021
Like Prometheus, but for logs.

Loki: like Prometheus, but for logs. Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus. It

Grafana Labs 13.4k Jul 23, 2021
raft variant with topology order logs

Safe: A log that is safe if it has been replicated to a quorum, no matter whether or not the committed flag is set on any replica.

null 27 Apr 17, 2021
GoVector is a vector clock logging library written in Go.

GoVector is a vector clock logging library written in Go. The vector clock algorithm is used to order events in distributed systems in the absence of a centralized clock. GoVector implements the vector clock algorithm and provides feature-rich logging and encoding infrastructure.

Distributed clocks 155 Jul 16, 2021
Minimalistic logging library for Go.

logger Minimalistic logging library for Go. Blog Post Features: Advanced output filters (package and/or level) Attributes Timers for measuring perform

Azer Koçulu 148 Mar 29, 2021
Port of perl5 File::RotateLogs to Go

file-rotatelogs Provide an io.Writer that periodically rotates log files from within the application. Port of File::RotateLogs from Perl to Go. SYNOPS

null 715 Jul 23, 2021
A 12-factor app logger built for performance and happy development

logxi log XI is a structured 12-factor app logger built for speed and happy development. Simpler. Sane no-configuration defaults out of the box. Faste

Mario Gutierrez 347 May 8, 2021
Simple logger for Go programs. Allows custom formats for messages.

go-logger A simple go logger for easy logging in your programs. Allows setting custom format for messages. Preview Install go get github.com/apsdehal/

Amanpreet Singh 266 Jul 15, 2021
A system and resource monitoring tool written in Golang!

Grofer A clean and modern system and resource monitor written purely in golang using termui and gopsutil! Currently compatible with Linux only. Curren

PES Open Source Community 158 Jul 10, 2021
A pure Go contextual logging library with "batteries included"

Cue Overview Cue implements contextual logging with "batteries included". It has thorough test coverage and supports logging to stdout/stderr, file, s

Bob Ziuchkovski 26 Sep 16, 2019
Logur is an opinionated collection of logging best practices

Logur is an opinionated collection of logging best practices. Table of Contents Preface Features Installation Usage FAQ Why not just X logger? Why not

Logur 129 Jul 16, 2021
Logging packages for Go

This repository contains logging packages for Go: stdlog is the main package of this repository, it is a simple and fast logger to the standard output

Alexandre Cesaro 45 Aug 12, 2020
Structured logging package for Go.

Package log implements a simple structured logging API inspired by Logrus, designed with centralization in mind. Read more on Medium. Handlers apexlog

Apex 1.2k Jul 23, 2021