Created
August 25, 2019 21:04
-
-
Save TheLie0/c1f559c5753ebd892247a318967b3a33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff ../dmenu_og/dmenu_run ./dmenu_run | |
2c2,24 | |
< dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} & | |
--- | |
> | |
> # This script is meant to replace the standard dmenu_run. | |
> # It searches $path for executable scripts and puts them in a dmenu. | |
> # It is intended to be used as a hub for different submenus. | |
> | |
> path=~/.submenus | |
> | |
> # Gets submenu scripts | |
> get_menu() { | |
> stest -flx "$path" | dmenu "$@" | |
> } | |
> | |
> # Check if path exists and contains files | |
> if [ ! -d $path ]; then | |
> echo "The directory $path does not exist. Please create it to use subdirectories." | |
> exit 0 | |
> fi | |
> if [ -z "$(stest -flx $path)" ]; then | |
> echo "There are no submenus in $path yet. Maybe copy over the original dmenu_run?" | |
> exit 0 | |
> fi | |
> | |
> exec "$path/$(get_menu)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment