- commit
- 20476a6
- parent
- 8717b20
- author
- xxwhirlpool
- date
- 2026-04-06 16:36:05 -0400 EDT
`serveit`, notifications for `passmenu`
2 files changed,
+35,
-0
1@@ -22,8 +22,10 @@ if [[ "$typeit" -eq 0 ]]; then
2 # else it's a normal password, copy it to clipboard
3 if [[ "${password_files[*]}" =~ 2fa && "$password" =~ 2fa ]]; then
4 pass otp "$password" | perl -pe "chomp if eof" | xclip -sel clipboard
5+ notify-send "passmenu" "2fa code copied to clipboard"
6 else
7 pass show -c "$password" 2>/dev/null
8+ notify-send "passmenu" "password copied to clipboard"
9 fi
10 else
11 pass show "$password" | { IFS= read -r pass; printf %s "$pass"; }
+33,
-0
1@@ -0,0 +1,33 @@
2+#!/usr/bin/env bash
3+#
4+# inspired by evan hahn:
5+# https://codeberg.org/EvanHahn/dotfiles/src/commit/f7a9d94ae2254cb7e5f67e6e5bdb74b6467f6dec/home/bin/bin/serveit
6+
7+usage_help() {
8+ echo "Usage: serveit [-p] [-r | -y]"
9+ echo "Options: -p (port, optional) | -r (ruby) | -y (python)"
10+}
11+
12+if [[ $# -eq 0 ]]; then
13+ usage_help
14+fi
15+
16+port_default="6969"
17+
18+py_server() {
19+ [[ "$(command -v python3)" ]]; python3 -m http.server "${port:-$port_default}" || echo "could not run python server"
20+}
21+
22+rb_server() {
23+ [[ "$(command -v ruby)" ]]; ruby -run -e httpd . -p "${port:-$port_default}" || echo "could not run ruby server"
24+}
25+
26+while getopts "p:ryh" opt; do
27+ case "$opt" in
28+ p) port="$OPTARG" ;;
29+ y) py_server ;;
30+ r) rb_server ;;
31+ h) usage_help ;;
32+ *) echo "something went wrong" ;;
33+ esac
34+done