about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAoi Koizumi <novaburst@kalli.st>2022-04-28 09:29:08 -0300
committerAoi Koizumi <novaburst@kalli.st>2022-04-28 09:29:08 -0300
commit27eb27e8380d096f73a697de2e8641db471b3aa9 (patch)
tree1852885b31a9a5c3276e0acba662710e22a95853
parent2d528b69bd4bef811f667619a726a8d035d2d149 (diff)
downloadayu-27eb27e8380d096f73a697de2e8641db471b3aa9.tar.gz
Reformatted the whole thing yet again
-rw-r--r--COPYING2
-rw-r--r--README9
-rw-r--r--ayu27
-rw-r--r--config.mk2
-rw-r--r--makefile11
5 files changed, 34 insertions, 17 deletions
diff --git a/COPYING b/COPYING
index c643d83..5a37f48 100644
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,6 @@
 Discordian Public License (DPL)
 
-All Rights Reversed Ⓚ 3187 Nova li Gensokyo <novaburst@kalli.st>
+All Rights Reversed Ⓚ 3187-3188 Aoi Koizumi <novaburst@kalli.st>
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 
diff --git a/README b/README
index ecf0e4d..01b7702 100644
--- a/README
+++ b/README
@@ -24,14 +24,19 @@ Neither of those are included and probably will never be.
 Just use the CLI tools by themselves, lol.
 
 
+Add-ons
+-------
+
+1) ayu-bemenu: bemenu integration
+2) ayu-dmenu: same as above but dmenu
+3) ayu-totp: adds time-based one-time password support
+
 Dependencies
 -------------
 
 1) age(1), duh!
 2) mandoc (documentation)
 3) tree
-4) xclip (optional)
-
 
 Related software
 ----------------
diff --git a/ayu b/ayu
index d33db1c..85fa41b 100644
--- a/ayu
+++ b/ayu
@@ -1,16 +1,21 @@
 #!/bin/sh
+
+# Exit on error
 set -e
 
+# Disabling some shellcheck stuff here as I won't really solve it anyway.
 # shellcheck disable=SC2154,SC1091
 
 ayu_dir=${ayu_dir:-$HOME/.ayu}
 ayu_settings=${ayu_settings:-$XDG_CONFIG_HOME/ayu}
 ayu_store=${ayu_store:-$HOME/.ayu-store}
 
+# Check if the above directories exist, otherwise create them
 for dir in "$ayu_dir" "$ayu_settings" "$ayu_store"; do
 	test -d "$dir" || mkdir -p "$dir"
 done
 
+# Same thing for the configuration file
 if ! test -f "$ayu_settings"/config; then
 	cat << EOF > "$ayu_settings"/config
 	#ayu_clipboard=$(wl-copy --primary)
@@ -24,8 +29,11 @@ else
 	. "$ayu_settings"/config
 fi
 
+# Switch directory to the store, else bail out
 cd "$ayu_store" || exit 1
 
+## THEGOODS ##
+
 fn_copy() {
 	fn_view "$2" | "$ayu_clipboard"
 }
@@ -69,13 +77,16 @@ fn_view() {
 		exit
 	fi
 }
+## SDOOGEHT ##
+
+## Command line parsing (I don't get why this has be so difficult for say, Lua)
 case $1 in
--c) fn_copy "$2" ;;
--e) fn_edit "$2" ;;
--l) fn_list ;;
--n) fn_new "$2" ;;
--r) fn_remove_single "$2" ;;
--R) fn_remove_recursive "$2" ;;
--v) fn_view "$2" ;;
-*) fn_usage ;;
+    -c) fn_copy "$2" ;;
+    -e) fn_edit "$2" ;;
+    -l) fn_list ;;
+    -n) fn_new "$2" ;;
+    -r) fn_remove_single "$2" ;;
+    -R) fn_remove_recursive "$2" ;;
+    -v) fn_view "$2" ;;
+    *) fn_usage ;;
 esac
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..8aaed1b
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,2 @@
+destdir ?= 
+prefix ?= /usr/local
diff --git a/makefile b/makefile
index 44d1638..28e26b8 100644
--- a/makefile
+++ b/makefile
@@ -1,9 +1,8 @@
-destdir ?=
-prefix ?= /usr/local
+include config.mk
 
 install:
-	install -Dm0755 ayu $(destdir)$(prefix)/bin/ayu
-	mandoc -T man ayu.mdoc > $(destdir)$(prefix)/share/man/man1/ayu.1
+	install -Dm0755 ayu ${destdir}${prefix}/bin/ayu
+	mandoc -T man ayu.mdoc > ${destdir}${prefix}/share/man/man1/ayu.1
 uninstall:
-	rm -f $(destdir)$(prefix)/bin/ayu
-	rm -f $(destdir)$(prefix)/share/man/man1/ayu.1
+	rm -f ${destdir}${prefix}/bin/ayu
+	rm -f ${destdir}${prefix}/share/man/man1/ayu.1