diff --git a/README.md b/README.md index 0550c7d..49d340d 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,10 @@ You can either execute the script from a terminal or by binding it to a key combination in your window manager. ``` -bwmenu 0.1 +bwmenu 0.2 Usage: - bwmenu [options] + bwmenu [options] -- [rofi options] Options: --help @@ -55,6 +55,9 @@ Examples: # XDG-compatible state location bwmenu --state-path=${XDG_RUNTIME_DIR}/bwmenu-state + + # Place rofi on top of screen, like a Quake console + bwmenu -- -location 2 ``` diff --git a/bwmenu b/bwmenu index 1e5c9b3..83e39fc 100755 --- a/bwmenu +++ b/bwmenu @@ -1,7 +1,7 @@ #!/bin/bash # Rofi extension for BitWarden-cli NAME="$(basename "$0")" -VERSION="0.1" +VERSION="0.2" DEFAULT_CLEAR=5 # Options @@ -15,6 +15,9 @@ ITEMS= # Stores which command will be used to deal with clipboards CLIPBOARD_MODE= +# Populated in parse_cli_arguments +ROFI_OPTIONS=() + # source the hash file to gain access to the BitWarden CLI # Pre fetch all the items load_items() { @@ -47,8 +50,8 @@ rofi_menu() { -kb-custom-1 alt+r \ -kb-custom-2 alt+n \ -kb-custom-3 alt+u \ - -kb-custom-4 alt+c - + -kb-custom-4 alt+c \ + "${ROFI_OPTIONS[@]}" } # Show items in a rofi menu by name of the item @@ -217,7 +220,7 @@ parse_cli_arguments() { $NAME $VERSION Usage: - $NAME [options] + $NAME [options] -- [rofi options] Options: --help @@ -256,6 +259,9 @@ Examples: # XDG-compatible state location $NAME --state-path=\${XDG_RUNTIME_DIR}/bwmenu-state + + # Place rofi on top of screen, like a Quake console + $NAME -- -location 2 USAGE shift exit 0 @@ -282,6 +288,8 @@ USAGE shift 2 ;; -- ) + shift + ROFI_OPTIONS=("$@") break ;; * )