diff --git a/dot_leetcode/star-prompt.json b/dot_leetcode/star-prompt.json index 24cdf1b..521b731 100644 --- a/dot_leetcode/star-prompt.json +++ b/dot_leetcode/star-prompt.json @@ -1,10 +1,10 @@ { - "totalAccepted": 31, + "totalAccepted": 41, "shownMilestones": [ 10, 20 ], - "submissionsSinceLastPrompt": 14, + "submissionsSinceLastPrompt": 24, "windowStartedAt": 1790356839288, "lastShownAt": 1790359187702, "dismissed": true diff --git a/dot_leetcode/version-cache.json b/dot_leetcode/version-cache.json index dc2e4b4..deb1634 100644 --- a/dot_leetcode/version-cache.json +++ b/dot_leetcode/version-cache.json @@ -1,5 +1,5 @@ { - "lastCheck": 1790784309856, + "lastCheck": 1790958825140, "latestVersion": "3.5.2", "hasBreakingChanges": false } diff --git a/television/cable/ghq-repos.toml b/television/cable/ghq-repos.toml index 5edffd5..ca53cee 100644 --- a/television/cable/ghq-repos.toml +++ b/television/cable/ghq-repos.toml @@ -5,7 +5,7 @@ ghq repositories (plus the chezmoi source tree) and Obsidian vaults, newest git activity first. Enter prints the directory; the gho shell function (ctrl-o in fish, zsh and bash) cds into it. """ -requirements = ["ghq", "fd", "onefetch", "mtime-sort"] +requirements = ["ghq", "fd", "git", "serie", "onefetch", "mtime-sort"] # Entries are "\t": the name is what you fuzzy-match, the # path is what enter prints. ctrl-s cycles repos → vaults. @@ -31,20 +31,35 @@ shell = "bash" display = "{split:\\t:0}" output = "{split:\\t:1}" +# Two previews, ctrl-f cycles: commit graph (default), then onefetch. serie +# itself cannot draw here -- it is a fullscreen TUI that paints the graph with +# kitty images and has no print mode -- so ctrl-g (history) opens it. [preview] -command = ''' +command = [ + ''' +d='{split:\t:1}' +if [ -e "$d/.git" ]; then + git -C "$d" log --graph --all --color=always --date=relative -n 300 \ + --format='%C(yellow)%h%C(reset) %C(blue)%<(12,trunc)%ad%C(reset) %s%C(auto)%d' 2>&1 +else + eza --tree --level 2 --color=always "$d" 2>/dev/null || ls -la "$d" +fi +''', + ''' d='{split:\t:1}' if [ -e "$d/.git" ]; then onefetch --no-art "$d" 2>&1 else eza --tree --level 2 --color=always "$d" 2>/dev/null || ls -la "$d" fi -''' +''', +] shell = "bash" # ctrl-e (edit) is bound globally in config.toml. [keybindings] ctrl-b = "actions:browse" +ctrl-g = "actions:history" [actions.edit] description = "Open the repository in nvim" @@ -58,3 +73,11 @@ description = "Open the repository's web page (gop)" command = "cd '{split:\\t:1}' && gop >/dev/null 2>&1" shell = "bash" mode = "fork" + +[actions.history] +description = "Browse the commit graph in serie" +# Fork: quitting serie (q) returns to the picker. /dev/tty for the same reason +# as edit; serie also needs a real tty to detect kitty graphics. +command = "cd '{split:\\t:1}' && [ -e .git ] && serie /dev/tty" +shell = "bash" +mode = "fork"