Git Product home page Git Product logo

Comments (9)

mattydebie avatar mattydebie commented on September 13, 2024 1

Hi @brainlessdeveloper thanks for the interest in bitwarden-rofi!
I can understand why you'd want to limit the amount of lines shown, so that's a go for sure.

You could try and send all the options bwmenu does not know to rofi. This way we won't have to add new rofi flags to bwmenu every time.. What's your take on this?

# example
bwmenu -c 5 -lines 2 
# above would show a notification for 5 seconds and call rofi with args '-lines 2'

from bitwarden-rofi.

fnune avatar fnune commented on September 13, 2024

Exactly, my suggestion was to have bwmenu extend the arguments rofi accepts by just passing them over just like you mentioned.

from bitwarden-rofi.

fnune avatar fnune commented on September 13, 2024

And of course to avoid needing to implement extra stuff on bwmenu, apart from the option fall-through.

from bitwarden-rofi.

mattydebie avatar mattydebie commented on September 13, 2024

I'd be interested in a patch like this 😁

from bitwarden-rofi.

fnune avatar fnune commented on September 13, 2024

I'll take a look at it during the weekend :) I'm quite busy nowadays.

Thanks for the tool btw!

from bitwarden-rofi.

Mange avatar Mange commented on September 13, 2024

Another common convention is --.

bwmenu [OPTIONS] -- [ROFI_OPTIONS]

Example:

bwmenu --seconds 10 -- -lines 2

I think this is a working implementation of that:

rofi_menu() {
  rofi -dmenu -p 'Name' \
    -i -no-custom \
    -mesg ' <b>Alt+r</b>: sync | <b>Alt+u</b>: urls | <b>Alt+n</b>: names | <b>Alt+c</b>: folders' \
    -kb-custom-1 alt+r \
    -kb-custom-2 alt+n \
    -kb-custom-3 alt+u \
    -kb-custom-4 alt+c \
     "$@"
}

from bitwarden-rofi.

mattydebie avatar mattydebie commented on September 13, 2024

I think this is indeed the correct way to do this.

from bitwarden-rofi.

fnune avatar fnune commented on September 13, 2024

yarn used to follow that convention:

yarn my-script-from-package-json -yarn-arg-1 -yarn-arg-2 -- -arg-for-my-script

They later switched to the same thing but without the --. I like the -- version too, anyway.

from bitwarden-rofi.

fnune avatar fnune commented on September 13, 2024

Another common convention is --.

bwmenu [OPTIONS] -- [ROFI_OPTIONS]

Example:

bwmenu --seconds 10 -- -lines 2

I think this is a working implementation of that:

rofi_menu() {
  rofi -dmenu -p 'Name' \
    -i -no-custom \
    -mesg ' <b>Alt+r</b>: sync | <b>Alt+u</b>: urls | <b>Alt+n</b>: names | <b>Alt+c</b>: folders' \
    -kb-custom-1 alt+r \
    -kb-custom-2 alt+n \
    -kb-custom-3 alt+u \
    -kb-custom-4 alt+c \
     "$@"
}

I tried your implementation and apparently it gets passed over character by character:

getopt: invalid option -- 'l'
getopt: invalid option -- 'i'
getopt: invalid option -- 'n'
getopt: invalid option -- 'e'
getopt: invalid option -- 's'

I don't know how to use getopt to do this though.

from bitwarden-rofi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.