m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/contrib/dmenu/passmenu
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2020-05-31 12:34:37 +0200
committerMarcin Chrzanowski <m@m-chrzan.xyz>2022-07-01 08:34:04 +0200
commitc9a74565af12fa93b6e0b0bac1c5235033bed343 (patch)
treec6c500bee66f11e12b4213ad0d8a1b709c856c06 /contrib/dmenu/passmenu
parent667e72fe88e66fa734ba0b5b20fe2834df9f4c18 (diff)
Don't eat dmenu arguments
Diffstat (limited to 'contrib/dmenu/passmenu')
-rwxr-xr-xcontrib/dmenu/passmenu9
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/dmenu/passmenu b/contrib/dmenu/passmenu
index 18b2daf..e5635fd 100755
--- a/contrib/dmenu/passmenu
+++ b/contrib/dmenu/passmenu
@@ -6,15 +6,18 @@ typeit=0
otp=0
infer_otp=0
otp_pattern=""
-while [[ $# -gt 0 ]]; do
+finish=0
+while [[ $# -gt 0 && $finish -eq 0 ]]; do
argument="$1"
- shift
case $argument in
--type) typeit=1 ;;
--otp) otp=1 ;;
--infer-otp) infer_otp=1 ;;
- --otp-pattern) otp_pattern="$1"; shift ;;
+ --otp-pattern) shift ; otp_pattern="$1" ;;
+ *) finish=1
esac
+ # Don't shift if we're done with passmenu args - rest of args goes to dmenu
+ [[ $finish -eq 0 ]] && shift
done
if [[ -n $WAYLAND_DISPLAY ]]; then