From 8b922c1f00b7bd22f922b7169dab812595c9a031 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Thu, 22 Jun 2023 17:39:52 +0200 Subject: Created dominion scripts and updated docs.sh to not need a page number. --- docs.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'docs.sh') diff --git a/docs.sh b/docs.sh index fefb2b8..5e59a39 100755 --- a/docs.sh +++ b/docs.sh @@ -16,8 +16,15 @@ referencesFile="$HOME/.config/zathura/refs" lines="$(wc -l "$referencesFile")" if reference="$(sed '/^#/d' "$referencesFile" | sed '/^\s*$/d' | cut -d# -f1 | dmenu -l "$lines" -p "Reference: ")"; then + line="$(grep "$reference" "$referencesFile" | sed q)" file="$(echo "$line" | cut -d# -f2)" page="$(echo "$line" | cut -d# -f3)" - zathura -P "$page" "$file" & + + if [ -n "$page" ]; then + zathura -P "$page" "$file" & + else + zathura "$file" & + fi + fi -- cgit v1.2.1