From f92d2f5971cca3ad1f3cbdd70a94c18f619681e8 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 22 Dec 2020 22:44:53 -0500 Subject: [PATCH] Try displaying info with zathura --- README.md | 10 +++++++++- prompt | 16 +++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dfae7bb..b8f44ca 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ This is a collection of scripts I use to make managing files and processes easier. Use it to automagically select and run terminal applications, send signals to daemons, execute arbitrary commands, search the web, grab passwords from a password manager, and more. +## Installing dependencies +`sudo apt install enscript ghostscript ps2pdf zathura suckless-tools` + ## Prompt mpc dmenu scrot xclip tmux vim lbry pass dunst They're all optional but missing commands may have unexpeted side effects. The scripts also assumes you have the common commands in GNU core utilities like sed, awk, etc. @@ -13,9 +16,14 @@ They're all optional but missing commands may have unexpeted side effects. The s - all scripts assume your prefered terminal is [ st ](http://st.suckless.org) - mpc is for media controls - the script assumes your passwords are in ~/Passwords/ +- commands that display information from man pages, godoc, logs, etc + do it using `enscript -p - | ps2pdf - | zathura -`. I'm considering + more minimal combinations like enscript and surf or st and less but + they create their own set of problems. This solution makes future + changes easy without becoming too complicated ### Usage - prompt [launch | action | cmd | ddg | pass] + prompt [launch | action | cmd | ddg | pass | manual] edit-ini ... Use it to automagically select and run terminal applications, send signals to daemons, execute arbitrary commands, search the web, grab passwords from the password manager, and more. diff --git a/prompt b/prompt index 21d8eb2..7ae0e26 100755 --- a/prompt +++ b/prompt @@ -151,15 +151,21 @@ godoc() { manual() { search=$(printf '' | dmenu -p 'manual') result=$(man "$search") - printf "$result" | zathura - - # notify-send -u low -t 0 "Manual" "$result" + printf "$result" | enscript -p - | ps2pdf - | zathura - } goinfo() { #Maybe this can also show recent searches - search=$(printf '' | dmenu -p 'goinfo') - result=$(go doc "$search") - notify-send -u low -t -1 "Go documentation" "$result" + search=$(printf "Window\nNotify" | dmenu -p 'goinfo') + case $search in + Window) search=$(printf '' | dmenu -p 'goinfo'); result=$(go doc "$search"); infowindow "$result"; exit;; + Notify) search=$(printf '' | dmenu -p 'goinfo'); result=$(go doc "$search"); notify-send -u low -t 0 "Go documentation" "$result"; exit;; + esac + result=$(go doc "$search"); notify-send -u low -t 0 "Go documentation" "$result"; +} + +infowindow() { + printf "$1" | enscript -p - | ps2pdf - | zathura - } cmd() {