rasmuslindroth / tut Goto Github PK
View Code? Open in Web Editor NEWTUI for Mastodon with vim inspired keys
Home Page: https://tut.anv.nu
License: MIT License
TUI for Mastodon with vim inspired keys
Home Page: https://tut.anv.nu
License: MIT License
Colours are not correctly shown if the #RRGGBB representation has leading zeros (i.e. the red channel is less than 128). This affects colours given as hex ("#008000") as well as by name ("green").
The following change fixes this behaviour.
--- util.go 2020-04-11 05:06:13.000000000 -0400
+++ util.go 2020-05-05 16:10:02.515224268 -0400
@@ -251,7 +251,7 @@
}
func ColorMark(color tcell.Color) string {
- return fmt.Sprintf("[#%x]", color.Hex())
+ return fmt.Sprintf("[#%06x]", color.Hex())
}
func FormatUsername(a mastodon.Account) string {
On an amd64 machine running plasma on X media and link opening works as it should. On an arm64 machine running plasma wayland session media and link opening do nothing.
I think timeline switching could be improved in the following ways:
gh
, gl
, gn
and so on, as well as the number keys. I would love to see something similar in tut, too.Hi
Although polls cannot be voted (yet? ;), you are always able to already see the results. I think this against the Mastodon philosophy to not let influence yourself by the already given votes. Not sure if it is technically possible to hide them before the person voted (currently with another client only)
Cheers,
Chris
attempting to favorite a toot from the [N]otifications
view throws a panic: runtime error
. However, the Favorite API request does go through. The toot would be favorited when I restart tut
again.
N
to get into Notifications viewF
to Favorite first toot in notifications[F]avorite
to Un[F]avorite
tut
does not crashtoot is favorited
tut
crashes
panic: runtime error: index out of range [19] with length 15 [recovered]
panic: runtime error: index out of range [19] with length 15
goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1(0xc0002c2000)
$GOPATH/pkg/mod/github.com/rivo/[email protected]/application.go:244 +0x82
panic(0x8256e0, 0xc000019040)
$GOPATH/src/runtime/panic.go:967 +0x15d
main.(*NotificationsFeed).Input(0xc000362000, 0xc00000e840)
$GOPATH/src/github.com/RasmusLindroth/tut/feed.go:1130 +0x45a
main.(*StatusView).inputBoth(0xc0001302a0, 0xc00000e840)
$GOPATH/src/github.com/RasmusLindroth/tut/statusview.go:178 +0x8c
main.(*StatusView).Input(0xc0001302a0, 0xc00000e840, 0xc0002c2000)
$GOPATH/src/github.com/RasmusLindroth/tut/statusview.go:268 +0x39
main.main.func1(0xc00000e840, 0xc000273a28)
$GOPATH/src/github.com/RasmusLindroth/tut/main.go:251 +0x561
github.com/rivo/tview.(*Application).Run(0xc0002c2000, 0x0, 0x0)
$GOPATH/pkg/mod/github.com/rivo/[email protected]/application.go:314 +0x7d3
main.main()
$GOPATH/src/github.com/RasmusLindroth/tut/main.go:294 +0xd34
So between 0.0.17 and 0.0.18 it looks like there was an update that included a requirement for GLIBC_2.32
I'm just using the binaries on Ubuntu 20.04 - not sure exactly which library I'd need to install or if the one available is new enough. I can run 0.0.17 just fine, but 0.0.18 and 0.0.20 won't run do to this requirement.
Hi!
Would it be possible to get a arm64/aarch64 build of tut?
been using toot for some time... but GO and TUI! this is great! about to try it, please add auto reload. toot is missing that
As I develop muscle memory for tut, my mutt muscle memory is deteriorating, so that I start pressing 'P' for sending a mail, which postpones it instead. So I was wondering if there is any way to customize the keycommands in the configuration file? Or if this is a hugely complicated thing to implement?
mastodon introduced bookmark support with version 3.1.0. it would be great to see tut
gain support for the feature as well.
I've been using bookmarks extensively and I've been working around this limitation on tut
by opening the same toot on the web and then bookmarking it for later.
by the way, this is an amazing client that works great. thank you for building it.
Hello, will tut allow me to run pass/gopass to fetch the token from the pass/gopass password manager like I do with other tools?
example:
AccessToken: `gopass show -o -f mastodon/myaccount@mydomain`
Thanks, I hope you add some ascii preview for images or something like gomuks does (gomuks is a matrix chat go client)
Hi,
At the moment I can't find any way to see if a mention in the notifications is, in fact, a direct message. This only becomes clear when I reply to the message. Is it possible to configure the client to make this (very) visible?
Replacing the default colour values with any HEX values in ~/.config/tut/config.ini
don’t seem to take effect, only if I use keywords like black
.
I’m using v0.0.5.
Custom viewers for images, video, and audio do not work correctly if flags are given with the program name. For example, video-viewer=ffplay -fs
does not start ffplay
with the -fs
(fullscreen) flag, but attempts to execute ffplay -fs
as a command including a literal space.
The following changes fix this behaviour.
--- config.go 2020-04-11 05:06:13.000000000 -0400
+++ config.go 2020-05-05 23:34:44.261338947 -0400
@@ -2,6 +2,7 @@
import (
"os"
+ "strings"
"github.com/gdamore/tcell"
"github.com/kyoh86/xdg"
@@ -44,10 +45,13 @@
type MediaConfig struct {
ImageViewer string
+ ImageArgs []string
ImageSingle bool
VideoViewer string
+ VideoArgs []string
VideoSingle bool
AudioViewer string
+ AudioArgs []string
AudioSingle bool
}
@@ -139,25 +143,34 @@
func parseMedia(cfg *ini.File) MediaConfig {
media := MediaConfig{}
- imageViewer := cfg.Section("media").Key("image-viewer").String()
- if imageViewer == "" {
- imageViewer = "xdg-open"
+ imageViewerComponents := strings.Fields(cfg.Section("media").Key("image-viewer").String())
+ if len(imageViewerComponents) == 0 {
+ media.ImageViewer = "xdg-open"
+ media.ImageArgs = []string{}
+ } else {
+ media.ImageViewer = imageViewerComponents[0]
+ media.ImageArgs = imageViewerComponents[1:]
}
- media.ImageViewer = imageViewer
media.ImageSingle = cfg.Section("media").Key("image-single").MustBool(true)
- videoViewer := cfg.Section("media").Key("video-viewer").String()
- if videoViewer == "" {
- videoViewer = "xdg-open"
+ videoViewerComponents := strings.Fields(cfg.Section("media").Key("video-viewer").String())
+ if len(videoViewerComponents) == 0 {
+ media.VideoViewer = "xdg-open"
+ media.VideoArgs = []string{}
+ } else {
+ media.VideoViewer = videoViewerComponents[0]
+ media.VideoArgs = videoViewerComponents[1:]
}
- media.VideoViewer = videoViewer
media.VideoSingle = cfg.Section("media").Key("video-single").MustBool(true)
- audioViewer := cfg.Section("media").Key("audio-viewer").String()
- if audioViewer == "" {
- videoViewer = "xdg-open"
+ audioViewerComponents := strings.Fields(cfg.Section("media").Key("audio-viewer").String())
+ if len(audioViewerComponents) == 0 {
+ media.AudioViewer = "xdg-open"
+ media.AudioArgs = []string{}
+ } else {
+ media.AudioViewer = audioViewerComponents[0]
+ media.AudioArgs = audioViewerComponents[1:]
}
- media.AudioViewer = audioViewer
media.AudioSingle = cfg.Section("media").Key("audio-single").MustBool(true)
return media
diff -u util.go util.go
--- util.go 2020-04-11 05:06:13.000000000 -0400
+++ util.go 2020-05-05 23:28:33.792773488 -0400
@@ -109,26 +109,32 @@
case "image":
if conf.ImageSingle {
for _, f := range filenames {
- exec.Command(conf.ImageViewer, f).Run()
+ args := append(conf.ImageArgs, f)
+ exec.Command(conf.ImageViewer, args...).Run()
}
} else {
- exec.Command(conf.ImageViewer, filenames...).Run()
+ args := append(conf.ImageArgs, filenames...)
+ exec.Command(conf.ImageViewer, args...).Run()
}
case "video", "gifv":
if conf.VideoSingle {
for _, f := range filenames {
- exec.Command(conf.VideoViewer, f).Run()
+ args := append(conf.VideoArgs, f)
+ exec.Command(conf.VideoViewer, args...).Run()
}
} else {
- exec.Command(conf.VideoViewer, filenames...).Run()
+ args := append(conf.VideoArgs, filenames...)
+ exec.Command(conf.VideoViewer, args...).Run()
}
case "audio":
if conf.AudioSingle {
for _, f := range filenames {
- exec.Command(conf.AudioViewer, f).Run()
+ args := append(conf.AudioArgs, f)
+ exec.Command(conf.AudioViewer, args...).Run()
}
} else {
- exec.Command(conf.AudioViewer, filenames...).Run()
+ args := append(conf.AudioArgs, filenames...)
+ exec.Command(conf.AudioViewer, args...).Run()
}
}
When adding media the path pops up and there is an "a" at the end of the path. Like this: "/home/usera". If you just backspace once to delete the a it works fine but I think the a being there is a bug.
There seems to be no way to show the toots which were favourited. OTOH the :bookmarks and the :saved commands seem to be doing the same thing (showing bookmarked toots).
I may just have missed something, but when I open a user and hit [F] for follow, nothing happens... Same thing with [A]vatar, [B]lock and [M]ute.
Platform: Arch Linux, tut v 0.0.26
Would it be possible to list the alt text from an image (when it exists) under the image link? It'd be a convenient way to judge whether the image is one I want to actually see.
Hi
Somehow modifying the colours to custom values doesn't seem to work on my system.
I have tried with respective colour names as well hex values -> both failed
As an example, the modification for the bottom bar:
status-bar-background=xrdb:white
Interestingly however I was able to modify the general background colour into black. But even another colour on the same element, doesn't work either.
(This is my first issue here on GitHub, so please don't be too hard with me. I can provide more input if necessary)
Viewing media and links should work even when in view mode
It would be nice to display if one particular toot in the timeline is part of a thread, therefore if it has replies or it is a reply to another toot.
In this way you could immediately know if pressing the thread button will actually be useful, and not waste time checking the thread of single toots.
I used Tusky which doesn't provide this functionality, however from the web interface it's possible to infer this information as at least the number of replies is shown.
When in timeline view, if you switch to the notification column underneath it with n
, and then fav a toot, the toot won't be shown as favorited there. It does show as favorited when viewed from the normal timeline, though.
I apologize if I'm not clear enough. This is what i mean:
I favorited that toot while viewing from the notifications bar/column, but still I got this:
https://i.imgur.com/4gAbZMV.png
If i went back to the timeline view, it does show I favorited it:
https://i.imgur.com/SqrjDz0.png
If i go back to notifications, it still shows as not favorited (and if I click F it will un-favorite it).
If I restart tut, it shows the FAV as it should.
By the way, this new notification bar underneath the timeline is just AWESOME. Thanks so much :)
Certain statuses can contain characters or emojis which are not correctly displayed.
These characters don't disappear in the right pane when switching to another toot.
You therefore can read the new toot, but with strange symbols sparkled here and there.
You can check this toot for reference: https://mastodon.uno/@mte90/106766305830855593
it has two of those characters in the name and one in the text.
In most mastodon clients, when you react on a toot that has a content warning, your reaction automatically get that CW too.
Tut doesn't have that.
I think that would be a good thing to add probably.
For otherwise I have to retype it every time and it is easier to disable it if you don't want it for your specific reaction than having to retype it...
Whenever a follow request is reached in the notifications timeline, nothing is displayed. If subsequently the next or previous notification is selected, the program crashes due to a runtime memory error.
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x168 pc=0x7a777e]
goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1(0xc00020a000)
/home/josias/go/pkg/mod/github.com/rivo/[email protected]/application.go:243 +0x87
panic(0x8106a0, 0xb1b410)
/usr/local/go/src/runtime/panic.go:965 +0x1b9
main.(*NotificationsFeed).Input(0xc0005aa080, 0xc00028c000)
/home/josias/git/tut/feed.go:1175 +0x9e
main.(*StatusView).inputBoth(0xc000408060, 0xc00028c000)
/home/josias/git/tut/statusview.go:192 +0x98
main.(*StatusView).Input(0xc000408060, 0xc00028c000, 0xc00020a000)
/home/josias/git/tut/statusview.go:282 +0x39
main.main.func1(0xc00028c000, 0xc0003f58d8)
/home/josias/git/tut/main.go:288 +0x62f
github.com/rivo/tview.(*Application).Run(0xc00020a000, 0x0, 0x0)
/home/josias/go/pkg/mod/github.com/rivo/[email protected]/application.go:318 +0x785
main.main()
/home/josias/git/tut/main.go:325 +0x1036
I propose that notifications that are not understood by be rendered somehow or with an error message instead of a crash. In addition, follow requests should be handled by tut, allowing accepting and rejecting them in the UI somehow.
Is there a specific reason go get github.com/RasmusLindroth/tut/
isn't used in "Build it yourself" section of the README? I think it is much simpler - 1 command instead of a few.
Once i press "V" to enter view mode, how do I exit it?
Great work, keep going!
Hey! I just tried using s
to 'show' content in a toot with CW, as it was before (https://i.imgur.com/9LH0d5Z.png). But now s
is too bookmark toot, it seems, so I can't view a toot with CW anymore. So I guess one of them needs to have a different shortcut? Or did you already change the shortcut to viewing full content and didn't change the 'tooltip'?
Cheers!
The warning text for CWs is displayed sometimes, but hidden for others on the main feed. When the thread is opened, the content warning appears.
This may sound stupid, but hear me out:
This is, at least, the behavior in i3. I don't know if this is the same in all tiling WMs
I did notice that when I used MATE, it would open them 1-4 so that 4 - being opened last - was on top and 1 on the bottom of the stack, so maybe it's a universal thing....I don't know.
Anyway, would opening them in reverse be a possibility?
Thanks for such an awesome app.
I don't know if this is worth the time, but you could optimize for long screens by placing the List section above the main Post section
I did this for neix, and basically involved setting the height, width and position of the sections depending on the number of columns.
This would benefit those on Termux or such set ups.
Hi!
Not sure if this is by intention, but I doubt it.
When saving a toot as bookmark, I have to capitalize the s = shift+s. Although the shortcut helper shows it as [S], any other shortcut works in lower-case. Maybe it's only my setup, but the bookmarking shortcut is the only process handling it that way.
version: 13 (however -v is showing it as 0.0.19 🙃)
Cheers,
Chris
Using the fourth version, when I finish composing a post or a reply in Neovim and press ZZ
, the whole terminal window becomes blank and unresponsive until I run pkill tut
in another window.
This happens about 20-25% of the time, and I’m not sure how to debug it.
When showing a posting ("a toot") and pressing "o" a window opens from where a list of URLs and hashtags is shown. The user can no hit "o" again while on the URL and a web browser opens.
This is not working when the message originated from a non-Mastodon Activitypub instance, e g. from https://connos.ddnss.ch/ (which is running "Honk" from https://humungus.tedunangst.com/r/honk)
Steps to reproduce:
For some reason, configuring the colors using xrdb codes does not work (hex codes and names work, though).
I'm using tut in xterm with a solarized light theme. Here's the relevant part of my .Xresources:
! Common
#define S_yellow #b58900
#define S_orange #cb4b16
#define S_red #dc322f
#define S_magenta #d33682
#define S_violet #6c71c4
#define S_blue #268bd2
#define S_cyan #2aa198
#define S_green #859900
! Light
#define S_base03 #002b36
#define S_base02 #073642
#define S_base01 #586e75
#define S_base00 #657b83
#define S_base0 #839496
#define S_base1 #93a1a1
#define S_base2 #eee8d5
#define S_base3 #fdf6e3
XTerm*background: white
XTerm*foreground: S_base00
XTerm*fading: 40
XTerm*fadeColor: S_base3
XTerm*cursorColor: S_base01
XTerm*pointerColorBackground: S_base1
XTerm*pointerColorForeground: S_base01
XTerm*color0: S_base02
XTerm*color1: S_red
XTerm*color2: S_green
XTerm*color3: S_yellow
XTerm*color4: S_blue
XTerm*color5: S_magenta
XTerm*color6: S_cyan
XTerm*color7: S_base2
XTerm*color9: S_orange
XTerm*color8: S_base03
XTerm*color10: S_base01
XTerm*color11: S_base00
XTerm*color12: S_base0
XTerm*color13: S_violet
XTerm*color14: S_base1
XTerm*color15: S_base3
And here's what my tut looks like, side by side with the config file open in vim for comparison with the expected colors :
Hi, and thanks for a great client! Really enjoying it so far.
Just wondering if there are any plans to add support for desktop notifications for those of us that enjoy those kinds of things?
notify-send blah
kind of thing...
When replying to a post in the home timeline after loading the reply overlay for a toot in notifications, it displays the reply from notifications instead of the one from the home timeline.
Steps to reproduce:
n
to enter the notifications timeliner
to reply to a messageesc
(or reply to a message, doesn't matter)esc
Current workaround: open the notifications timeline and exit it again.
I'm guessing this problem is related to getting the current status and changing timelines.
I just happened to be reading a post that had a content warning.
So I pressed 'z' to read the post.
While I was reading suddenly the content warning came back, when there came a new message on my timeline.
So apparently that refreshes the current post too?
I think it might be an idea to see if it is possible to only update the timeline?
Or if not then storing somewhere that the content warning was opened, so I don't have it being closed suddenly while I am in the middle of reading a post.
I use lists at Mastodon quite a lot. It would be great if one could switch to a list timeline in tut.
I love the app, I love go and mastodon and the CLI. but creator seems inactive since September 2020 according to his profile, so that means in all his projects etc here in github... anyone willing to help me continue development on a fork or if he reads that he can add us as developers?
Upload media
Show errors in UI. Don't log.fatal if you don't have to
Make it more configurable
Change lefpane to a list?
Notifications
Make use of streams?
Change visibility options for toots
Better default colors. Get from xrdb?
Since GNU Nano has no visualization of character count it's easy to go over the character limit without realizing it. It also makes it difficult to figure out where in a message to split the character count.
Being able to have tut intelligently split the message at the character limit and send subsequent sections as threaded replies would be a wonderful addition.
It would be great to have a couple more options to use to deal with the URLs in the "Open" window:
* an example of this: In newsboat
, I can set a macro in my config file to temporarily set my "browser" to any command, and pass the URL through to that command. Afterwards, I reset my browser back. Example:
macro m set browser "/path/to/script"; open-in-browser ; set browser "/original/browser/path"
I use this, for instance, to open youtube videos in youtube-viewer
/mpv rather than opening a browser window to watch them on the website.
I understand that this is probably no small task to accomplish, so I just wanted to put the bug in your ear to see if it interests anyone.
Before the shortcut letter between the brackets it shows like this [#-00001]
Would be nice to have the option to set a post/reply's visibility.
For example, public, followers only, unlisted, etc.
As you may know some emoji such as 💁🏻♀️ are actually made up of several characters but are meant to be rendered as 1. My terminal doesn't render these correctly as is fairly common instead rendering it as 3 separate characters.
This rendering issue isn't a bug in tut. However, when scrolling to different toots those extra emoji don't clear properly until they're drawn over.
IDK if this a a bug in tut, the tui library tut is using, or my terminal.
The TOML configuration language is very similar to INI, but has a complete standard.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.