1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
dff2f6cd17 Audit script now caches urls for user convenience 2020-03-26 13:00:09 +01:00
f18cfbcafe Added tldr support 2020-03-26 12:31:18 +01:00
5 changed files with 34 additions and 12 deletions

View File

@ -58,6 +58,7 @@ A repository of my personal configuration files.
- [[https://github.com/dylanaraps/pywal][pywal]] - [[https://github.com/dylanaraps/pywal][pywal]]
- [[http://www.gnu.org/software/stow/][stow]] - [[http://www.gnu.org/software/stow/][stow]]
- [[https://github.com/muennich/sxiv][sxiv]] - [[https://github.com/muennich/sxiv][sxiv]]
- [[https://github.com/tldr-pages/tldr][tldr]]
- [[https://www.freedesktop.org/wiki/Software/udisks/][udisks]] - [[https://www.freedesktop.org/wiki/Software/udisks/][udisks]]
- [[https://github.com/stoeckmann/xwallpaper][xwallpaper]] - [[https://github.com/stoeckmann/xwallpaper][xwallpaper]]
- [[https://pwmt.org/projects/zathura/][zathura]] - [[https://pwmt.org/projects/zathura/][zathura]]

6
dmenu/.local/bin/tldr-dmenu Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env sh
. ~/.cache/wal/colors.sh
command=$(curl --silent "https://github.com/tldr-pages/tldr/tree/master/pages/linux" | grep -o "[1-zA-Z0-9\-]*.md" | cut -f 1 -d '.' | uniq | sort | dmenu -p "tldr" -i -nb "$color0" -nf "$color15" -sb "$color1" -sf "$color15")
test ! -z "$command" && alacritty --class float,float -e ~/.config/polybar/bin/tldr-and-wait "$command"

View File

@ -2,13 +2,15 @@
. $HOME/.cache/wal/colors.sh . $HOME/.cache/wal/colors.sh
cachedUrls=$(cat ~/.cache/audit-urls 2>/dev/null)
localServices=$(netstat -ltpn 2>/dev/null | grep "node" | awk '{ print "http://"$4 }') localServices=$(netstat -ltpn 2>/dev/null | grep "node" | awk '{ print "http://"$4 }')
url="$(echo -e "$localServices\nOther" | dmenu -i -nb "$color0" -nf "$color15" -sb "$color1" -sf "$color15" "$@")"
if [ "$url" == "Other" ]; then test -n "$localServices" && dmenUrls+="$localServices"
read -r -p "Url: " url test -n "$cachedUrls" && dmenuUrls+="$cachedUrls"
fi
url="$(echo -e "$dmenuUrls" | uniq | sort | dmenu -i -nb "$color0" -nf "$color15" -sb "$color1" -sf "$color15" "$@")"
if [[ -n "$url" && "$url" != "http://" && "$url" != "https://" ]]; then
rm -f "$HOME"/Downloads/lighthouse.html rm -f "$HOME"/Downloads/lighthouse.html
env CHROME_PATH=/usr/local/bin/brave lighthouse --output-path="$HOME"/Downloads/lighthouse.html "$url" env CHROME_PATH=/usr/local/bin/brave lighthouse --output-path="$HOME"/Downloads/lighthouse.html "$url"
@ -17,3 +19,10 @@ if [ -f "$HOME"/Downloads/lighthouse.html ]; then
else else
read -r -n 1 -p "Something went wrong. Press any key to exit." read -r -n 1 -p "Something went wrong. Press any key to exit."
fi fi
# Cache list of audit urls used with dmenu
if [[ ! $(grep "$url" ~/.cache/audit-urls) ]]; then
echo "$url" >>~/.cache/audit-urls
fi
fi

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
tldr "$@"
read -n 1 -r -p ""

View File

@ -83,6 +83,8 @@ ctrl + alt + {l, n, r, w, s, p, v, k, a}
alacritty --class float,float -e {lf, neomutt, /usr/bin/newsboat, ~/.config/polybar/bin/wttr-and-wait, spt, castero, nvim, ~/.local/bin/calendar-and-wait, ~/.local/bin/audit} alacritty --class float,float -e {lf, neomutt, /usr/bin/newsboat, ~/.config/polybar/bin/wttr-and-wait, spt, castero, nvim, ~/.local/bin/calendar-and-wait, ~/.local/bin/audit}
ctrl + alt + {b, e, S} ctrl + alt + {b, e, S}
{brave, emacs, spotify} {brave, emacs, spotify}
ctrl + alt + {t}
~/.local/bin/tldr-dmenu
#-----------------------------------------------------------Bspwm-------------------------------------------------------------- #-----------------------------------------------------------Bspwm--------------------------------------------------------------
# quit/restart bspwm # quit/restart bspwm