Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit c173f85

Browse files
committed
Provide a command line flag to set additional dmenu parameters
For example, this allows one to provide additional rofi opts: ``` tessen -d rofi --dopts="-monitor 0" ```
1 parent 79f05b8 commit c173f85

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tessen

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ usage: $prog [options]
604604
-a, --action, --action= choose either 'autotype', 'copy', or 'both'
605605
omit this option to use the default behavior
606606
-c, --config, --config= use a config file on a custom path
607+
--dopts, --dopts= provide additional parameters for the dmenu backend
607608
-h, --help print this help menu
608609
-v, --version print the version of $prog
609610
@@ -759,6 +760,22 @@ main() {
759760
fi
760761
_TSN_CONFIG="${_opt##--config=}"
761762
;;
763+
--dopts)
764+
if [[ $# -lt 2 ]]; then
765+
_die "please specify valid dmenu options"
766+
fi
767+
read -ra new_dopts <<< "$2"
768+
_DMENU_BACKEND_OPTS+=("${new_dopts[@]}")
769+
shift
770+
;;
771+
--dopts=*)
772+
var="${_opt##--dopts=}"
773+
if [[ -z $var ]]; then
774+
_die "please specify valid dmenu options"
775+
fi
776+
read -ra new_dopts <<< "$var"
777+
_DMENU_BACKEND_OPTS+=("${new_dopts[@]}")
778+
;;
762779
-h | --help)
763780
print_help
764781
exit 0

0 commit comments

Comments
 (0)