Bläddra i källkod

Add info display feature

master
= 3 år sedan
förälder
incheckning
595359a884
3 ändrade filer med 40 tillägg och 8 borttagningar
  1. +11
    -8
      README.md
  2. +17
    -0
      pages
  3. +12
    -0
      prompt

+ 11
- 8
README.md Visa fil

@@ -4,27 +4,30 @@ This is a collection of scripts I use to make managing files and processes easie
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. 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 ## Installing dependencies
`sudo apt install enscript ghostscript ps2pdf zathura suckless-tools`
`sudo apt install pass enscript dunst xclip scrot mpc mpd ghostscript 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.
All of them are optional except suckless-tools. Many of the features aren't interdependent and are made up of 1 or 2 functions.

## prompt
It's the central script that gives the rest of the features interactivity. Read the source code for more details.
### Usage
prompt [ launch | action | cmd | ddg | pass | manual ]
pages [ open ]

## pages
pages is a command for viewing /tmp/pages-{number} files with less or zathura. The files are the result of prompt commands like `prompt action` -> Go page or can be created from your own tools. I use it for viewing documentation.




- [ dmenu ](http://tools.suckless.org/dmenu/) for the prompts. It can be changed to rofi or some other solution - [ dmenu ](http://tools.suckless.org/dmenu/) for the prompts. It can be changed to rofi or some other solution
- scrot and xclip for screenshots - scrot and xclip for screenshots
- all scripts assume your prefered terminal is [ st ](http://st.suckless.org) - all scripts assume your prefered terminal is [ st ](http://st.suckless.org)
- mpc is for media controls - mpc is for media controls
- the script assumes your passwords are in ~/Passwords/
- commands that display information from man pages, godoc, logs, etc - commands that display information from man pages, godoc, logs, etc
do it using `enscript -p - | ps2pdf - | zathura -`. I'm considering do it using `enscript -p - | ps2pdf - | zathura -`. I'm considering
more minimal combinations like enscript and surf or st and less but more minimal combinations like enscript and surf or st and less but
they create their own set of problems. This solution makes future they create their own set of problems. This solution makes future
changes easy without becoming too complicated changes easy without becoming too complicated


### Usage
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. 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.


#### TODO #### TODO


+ 17
- 0
pages Visa fil

@@ -0,0 +1,17 @@
#!/bin/sh

pager() {
# st -e tail -F -n +1 "/tmp/pages-$1"
st -e less "/tmp/pages-$1"
}

pdf() {
st -e zathura "/tmp/pages-$1"
}



case $1 in
pager) pager "$2";;
pdf) pdf "$2";;
esac

+ 12
- 0
prompt Visa fil

@@ -36,17 +36,20 @@ action() {
action=$(printf "Play Music action=$(printf "Play Music
Pause Music Pause Music
Toggle Music Toggle Music
Go page
Command Command
Command to clipboard Command to clipboard
Search github Search github
Search ddg Search ddg
Search godoc Search godoc
Open page
Select VPN Select VPN
Disable VPN Disable VPN
Enable VPN Enable VPN
VPN Status VPN Status
Rebind Keys Rebind Keys
Disable Bar Disable Bar
Man
Enable Bar" | tr -d '\t' | Enable Bar" | tr -d '\t' |
dmenu -i -p "Actions") dmenu -i -p "Actions")


@@ -60,8 +63,11 @@ case $action in
'Search github') github;; 'Search github') github;;
'Search godoc') godoc;; 'Search godoc') godoc;;
'Search ddg') ddg;; 'Search ddg') ddg;;
'Open page') pages pager "$(printf "1\n2\n3\n" | dmenu -p 'page')";;
'Command') cmd;; 'Command') cmd;;
'Command to clipboard') cmd_clip;; 'Command to clipboard') cmd_clip;;
'Man') st -e man "$(printf "" | dmenu -p 'man')";;
'Go page') num=$(go_page); pages pager $num;;
esac esac
} }


@@ -164,6 +170,12 @@ goinfo() {
result=$(go doc "$search"); notify-send -u low -t 0 "Go documentation" "$result"; result=$(go doc "$search"); notify-send -u low -t 0 "Go documentation" "$result";
} }


go_page() {
name=$(printf "1\n2\n3\n4" | dmenu -p "page name")
go doc "$(printf "" | dmenu -p 'go doc search')" > /tmp/pages-$name
printf "$name"
}

infowindow() { infowindow() {
printf "$1" | enscript -p - | ps2pdf - | zathura - printf "$1" | enscript -p - | ps2pdf - | zathura -
} }


Laddar…
Avbryt
Spara