-
-
Save Phate6660/bbca71291f639369af6bf8ba56e1a9a6 to your computer and use it in GitHub Desktop.
Choose a script to edit via rofi, and edit with $EDITOR.
This file contains hidden or 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
#!/bin/bash | |
## The idea is to create a dmenu prompt with fancy names (i.e nameOfDirectory/nameOfScriptWithoutExtension) and open them in emacs. | |
## TODO: Open submenu if more than one of the same file is found. | |
script_dir="$HOME/scripts" # Set to whatever dir you store your scripts in. I personally prefer $HOME/scripts. | |
editor="$EDITOR" # Set to whatever editor you prefer, if you don't already have $EDITOR set. | |
# Print names of scripts without extensions into rofi's dmenu mode, and save the selection to the choice variable. | |
choice="$(ls -1 "$script_dir" | sed 's/\.[^.]*$//' | rofi -dmenu -p "Select script to edit")" | |
"$editor" "$script_dir"/"$choice"* # Edit the chosen script with $editor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment