From d46e8dcc37ac147d96e5d1039ba02268e81b7fb5 Mon Sep 17 00:00:00 2001 From: Phantop Date: Tue, 18 Oct 2022 17:47:48 -0400 Subject: [PATCH] fish: lash#cat9-like recording feature using script --- bin/aliases | 48 +++++++++++++++++++++++++++++++++++++++++++ fish/config.fish | 2 +- kitty/kitty.conf | 1 + qutebrowser/user.scss | 6 +++--- 4 files changed, 53 insertions(+), 4 deletions(-) diff --git a/bin/aliases b/bin/aliases index 8f879b5..a729506 100755 --- a/bin/aliases +++ b/bin/aliases @@ -86,3 +86,51 @@ function alpine proot -r alpine end funcsave alpine + +function record + set recfile /tmp/fish_$fish_pid\_$(date +%s.%N) + set -g --append recfiles $recfile + set -g --append reclines "$argv" + set -g --append recfolds $PWD + + if test (type -t $argv[1]) = file + script -efq $recfile -c "$argv" + else + script -efq $recfile -c "fish -c '$argv'" + end + + zstdmt -c $recfile &| sponge $recfile + + function rmrec_(basename $recfile) --on-event fish_exit -V recfile + rm $recfile + end +end +funcsave record + +function listrecords + for i in (seq (count $recfiles)) + echo $i: $recfiles[$i] + printf \t; date -d @(echo $recfiles[$i] | cut -d_ -f3) + echo \t$reclines[$i] + echo \t$recfolds[$i] + end +end +funcsave listrecords + +function viewrecord + if test $argv + set num $argv + else + listrecords + echo Input the number of the desired recording: + set num (read) + end + + if test $KITTY_PID + kitty @ launch --type=tab --hold zstdcat $recfiles[$num] + else + clear + zstdcat $recfiles[$num] + end +end +funcsave viewrecord diff --git a/fish/config.fish b/fish/config.fish index bdcb1c9..7dd0592 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -22,4 +22,4 @@ bind \ef 'fzf | clip' bind \e\co 'open (_fzf_wrapper)' source /usr/share/autojump/autojump.fish -tty -s && starship init fish --print-full-init | source +tty -s && starship init fish --print-full-init | source && echo -en "\e[5 q" diff --git a/kitty/kitty.conf b/kitty/kitty.conf index 7d682fc..8b624d4 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -9,6 +9,7 @@ remember_window_size no close_on_child_death yes initial_window_width 80c initial_window_height 24c +allow_remote_control yes map shift+page_up scroll_page_up map shift+page_down scroll_page_down diff --git a/qutebrowser/user.scss b/qutebrowser/user.scss index a82d44e..77c4acf 100644 --- a/qutebrowser/user.scss +++ b/qutebrowser/user.scss @@ -80,9 +80,9 @@ body>div#outer.wrapper { } dl.meta, li.blurb, li.comment {border-color: #555} - a:visited {color: #999} + a:visited, .work > li > div.header h4 a:visited {color: #999} #admin-banner, #header > ul.primary {display:none} - h1.heading a, .splash .module h3, a:hover {color: MediumPurple} + h1.heading a, .splash .module h3, a:hover, li > div.header h4 a {color: MediumPurple} .secondary {box-shadow:none;background: #000;} #dashboard {border:none; .navigation.actions {border-top:none}} .user.home h2 {border-bottom: none} @@ -91,7 +91,7 @@ body>div#outer.wrapper { ul.work > li { &.share {display: none} a.collapsed {display: none} - ul { + ul.secondary { border: none !important; display: inline !important; position: static;