aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dmenu_pass.sh17
-rw-r--r--[-rwxr-xr-x]bin/gscr.sh0
-rw-r--r--[-rwxr-xr-x]bin/msc.sh0
-rw-r--r--bin/sls.sh3
-rw-r--r--bin/slsf.awk29
-rw-r--r--bin/tm.sh9
6 files changed, 33 insertions, 25 deletions
diff --git a/bin/dmenu_pass.sh b/bin/dmenu_pass.sh
deleted file mode 100755
index 44296439..00000000
--- a/bin/dmenu_pass.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-# Pick and type out a pass(1) password with dmenu(1) and xdotool(1)
-self=dmenu_pass
-cd -- "${PASSWORD_STORE_DIR:-"$HOME"/.password-store}" || exit
-# shellcheck disable=SC2016
-name=$(
- find . -name \*.gpg ! -type d |
- sed -e 's_^\./__' -e 's_\.gpg$__' |
- LC_ALL=C sort -f |
- dmenu
-)
-password=$(pass show -- "$name" | head -n 1) || exit
-[ -n "$password" ] || exit
-printf %s "$password" | xdotool type --clearmodifiers --file - \
- || exit
-notify-send --app-name="$self" -- \
- "Password typed" \
- "$name"
diff --git a/bin/gscr.sh b/bin/gscr.sh
index 26eafb12..26eafb12 100755..100644
--- a/bin/gscr.sh
+++ b/bin/gscr.sh
diff --git a/bin/msc.sh b/bin/msc.sh
index 051f104a..051f104a 100755..100644
--- a/bin/msc.sh
+++ b/bin/msc.sh
diff --git a/bin/sls.sh b/bin/sls.sh
index 55c1dfc7..9741144a 100644
--- a/bin/sls.sh
+++ b/bin/sls.sh
@@ -3,7 +3,8 @@
# If we weren't given a file explicitly, we'll try to read both /etc/ssh_config
# and ~/.ssh_config in that order if they exist
if [ "$#" -eq 0 ] ; then
- for cfg in /etc/ssh_config "$HOME"/.ssh/config ; do
+ for cfg in /etc/ssh_config.d/*.conf /etc/ssh_config \
+ "$HOME"/.ssh/config.d/*.conf "$HOME"/.ssh/config ; do
[ -e "$cfg" ] || continue
set -- "$@" "$cfg"
done
diff --git a/bin/slsf.awk b/bin/slsf.awk
index 3d5c190f..75efe7a4 100644
--- a/bin/slsf.awk
+++ b/bin/slsf.awk
@@ -1,9 +1,28 @@
-# Print the first non-glob "Host" name from each line of ssh_config(5) files
+# Print all the hosts from ssh_config(1) files
# Manage the processing flag (starts set in each file)
-FNR == 1 || /### sls/ { sls = 1 }
+BEGIN { sls = 1 }
+FNR == 1 { sls = 1 }
+/### sls/ { sls = 1 }
/### nosls/ { sls = 0 }
-# If processing flag set, directive is "Host", and hostname has no wildcards,
-# then print it
-sls && $1 == "Host" && $2 !~ /\*/ { print $2 }
+# Skip if we're ignoring hosts
+!sls { next }
+# Skip if this isn't a host line
+$1 != "Host" { next }
+
+# Add all the patterns after the keyword that don't have wildcards
+{
+ for (i = 2; i <= NF; i++) {
+ if ($i !~ /[?*]/) {
+ hosts[$i]++
+ }
+ }
+}
+
+# Print the complete list of hosts, sorted
+END {
+ for (host in hosts) {
+ print host | "sort"
+ }
+}
diff --git a/bin/tm.sh b/bin/tm.sh
index d5422869..6bdce20b 100644
--- a/bin/tm.sh
+++ b/bin/tm.sh
@@ -1,5 +1,10 @@
# Attach to existing tmux session rather than create a new one if possible
+# Source config if it exists (just the session name, really)
+if [ -e "${XDG_CONFIG_HOME:-"$HOME"/.config}"/tm/config ] ; then
+ . "${XDG_CONFIG_HOME:-"$HOME"/.config}"/tm/config || exit
+fi
+
# If given any arguments, just use them as they are
if [ "$#" -gt 0 ] ; then
:
@@ -10,8 +15,8 @@ elif tmux has-session 2>/dev/null ; then
# Create a new session with an appropriate name
else
- set -- new-session -s "${TMUX_SESSION:-default}"
+ set -- new-session -s "${default_session_name:-default}"
fi
# Execute with concluded arguments
-tmux "$@"
+exec tmux "$@"