放张 manjaro 的毒(或许不是?)

tldr 不错,我提交过一个 tldr layer 到 spacemacs,到现在都没有被 merge

嗯,Linux 下很多命令行工具还是很好用的。

话说,我还计划等 spacemacs 0.3 正式 release 出来,再体验一把 Emacs。

我是不是等不到了?:sweat_smile:

确实,spacemacs 最近死气沉沉啊

作者好像在重写底层代码?我看 PR 都堆到 180+ 了。

1 个赞

在搞什么double dot

配置了下 elinks 浏览器,初步感觉不错。

elinks 支持 CSS,这一特性极大提升了浏览体验。

从此,可以在终端里看在线文档了 :slight_smile:

高分屏看起来太爽了,不过字体感觉没配置好,看起来肾虚。

刚看了下 fbterm 有反锯齿选项。开启之后,就和 GTK 下字体渲染一样了。

截图我就懒得重新贴了。其实不开启也行,实际观感没截图中那么明显。:wink:

发现 vimb 浏览含有 GIF/MP4 的网站时,CPU 占用经常飙升到 50% 以上。

换用 Chromium 浏览器,也是如此。

猜测原因是无法使用 GPU 加速。Chromium 任务管理器里也确实看不到 GPU 资源占用。

时至今日,Linux 驱动依然是个头疼的问题。没有硬件,谈何桌面体验?

請教下elink能不能渲染終端下的輸出啊, 比如某終端詞典吐出來raw html…窩想讓這個output自動在終端下渲染好.

elinks -dump 你研究一下?

-dump: Print formatted plain-text versions of given URLs to stdout. 這個選項可以將本地的html文件渲染出來, 輸出到stdout, 但是窩現在的需求是將stdout裏的內容在後臺渲染完然後再在stdout輸出. 感覺有點麻煩呢

确实, elinks -dump 不接受管道传递过来的数据。不过,你也可以将 stdout 先重定向到文件,再 dump 出来嘛。就是比较麻烦……

刚试了一下,用 pandoc 转换也行:

~ % echo "<p>Hello</p>" | pandoc -f html -t plain      
Hello

其实,我看到你的问题第一个念头是:谁家词典这么不人道,竟然用 raw html 输出?而且你还死抱着不放…… :rofl:

行, 窩慢慢研究下shell(慚愧, 之前幾乎沒有寫過腳本)正好從這個開始https://unix.stackexchange.com/questions/31414/how-can-i-pass-a-command-line-argument-into-a-shell-script

發現shell腳本的傳慘$n和standard ml的tuple好像啊…sml的所有函數都只能接受一個參數, 所以用tuple來模擬, 造成多個parameter的假象, #n也可以access tuple的參數. 太像了…相比之下, c要argc和argv, 就要多一個argc了. 不帶長度信息的代價…c_style字符串永遠的痛…

其實有29本不帶html輸出的詞典, 但是偏偏這最後一本(輸出至最後)一坨html, 然後窩的心態是: 要刪這本詞典還要去重新找安裝的位置, 太麻煩啦, 乾脆想怎麼讓它正常輸出吧! 結果事實證明這更麻煩…不過來這裏的人可能多少會這樣的折騰(雖然窩知道在大家眼裏這連折騰的門檻都還算不上), 只是理由各不相同吧 : )

没关系,都一样是折腾。我只是比较好奇而已。

有问题随时发出来,总有人能帮忙解决。比自己毫无头绪地琢磨要好些。

嗯嗯, 謝謝. 最後窩醬解決了:

#tt.sh
/usr/bin/sdcv $1 > /home/czxyl/Documents/firstlove.md
pandoc /home/czxyl/Documents/firstlove.md -o /home/czxyl/Documents/firstlove.html
elinks -dump /home/czxyl/Documents/firstlove.html
rm /home/czxyl/Documents/firstlove.html /home/czxyl/Documents/firstlove.md
alias def='. tt.sh'
# czxyl @ archlinux in ~ [0:22:34] 
$ def hello
   Found 7 items, similar to hello. –>CMU American English spelling –>hello

   [hə’ləu]

   –>dictd_www.dict.org_gcide –>Hello

   Hello lo“, interj. & n. An exclamation used as a greeting, to call
   attention, as an exclamation of surprise, or to encourage one. This
   variant of {Halloo} and {Holloo} has become the dominant form. In the
   United States, it is the most common greeting used in answering a
   telephone. [1913 Webster +PJC]

   –>WordNet –>hello

   hello n : an expression of greeting; “every morning they exchanged polite
   hellos” [syn: {hullo}, {hi}, {howdy}, {how-do-you-do}]

   –>Webster’s Revised Unabridged Dictionary (1913) –>Hello

   Hello lo“, interj. & n. See {Halloo}.

   –>牛津现代英汉双解词典 –>hello

   = hallo.

   –>Longman Dictionary of Contemporary English –>hello

   S1 interjection, n also hallo, hullo BrE [C] [Date: 1800-1900; Origin:
   hollo a shout to call attention (16-19 centuries)]// 1 used as a greeting
   when you see or meet someone: –Hello, John! How are you?// –Stanley, come
   and say hello to your nephew.// –Well, hello there ! I haven’t seen you
   for ages.// 2 used when answering the telephone or starting a telephone
   conversation: –Hello - may I speak to Anne?// 3 used when calling to get
   someone’s attention: –Hello! Is there anybody home?// 4 used when you
   think someone is not acting sensibly or has said something stupid: –You
   didn’t remember her birthday? Hello!// 5 BrE used to show that you are
   surprised or confused by something: –Hello! What’s happened here?// 6 say
   hello: to have a quick conversation with someone// –Promise you’ll look in
   and say hello when you have time.//

   –>Collins Cobuild 5 –>golden hello

   gold|en hel|lo (golden hellos)
   [N-COUNT]
   A golden hello is a sum of money that a company offers to a person in
   order to persuade them to join the company. (BUSINESS)
   ● Most people recognise the need to pay a golden hello to attract the
   best.

   ══════════════════════════════════════════════════════════════════════════

# czxyl @ archlinux in ~ [0:22:40] 
$ 

終於能正常渲染了

搜了下 sdcv ,原来是星际词霸。我 manjaro 上装了个 goldendict,但使用频率极低;而且好像没有命令行版。

你的意思是有的词典输出正确,有的则是 raw html,两者混杂在一起?然后就需要使用 markdown 格式做中转?

另外,你的脚本看着比较啰嗦,可以优化下。

alias def='_a(){  sdcv $1 | pandoc -f markdown -t plain; }; _a'

这样一行就行了。参考资料:bash alias怎么解析传入的参数的? - 知乎

對的, 最近看得書口語化比較厲害, 詞彙有點跟不上了. markdown也是用來中轉的, 不然plain text在html裏就是一團了. 謝謝你提供的優化alias, 窩研究下, 命令行博大精深呀