-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from nschlimm/feature/EasyKey.bash
Feature/easy key.bash
- Loading branch information
Showing
11 changed files
with
153 additions
and
59 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
EasyKey.git/.ezk-git-loca-conf |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[locations] | ||
mavenhome=~/.m2 | ||
workspace=~/workspace | ||
easykey=~/workspace/EasyKey.shellmenu |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# EasyKey.bash utility | ||
|
||
Experimental state of menu with usefull bash commands. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
#################################### | ||
# EasyKey.bash utility main script # | ||
#################################### | ||
|
||
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
source "$script_dir/../shellmenu.sh" | ||
|
||
findText(){ | ||
echo "Text pattern:" | ||
read textPattern | ||
echo "File pattern:" | ||
read filePattern | ||
find . -name "$filePattern" -exec grep -H "$textPattern" {} + | awk -F ":" '{printf "%-40s %s\n", $1, $2}' | ||
} | ||
|
||
menuInit "EasyKey.bash" | ||
submenuHead "Usefull:" | ||
menuItem f "Find text inside files" findText | ||
startMenu "$(pwd)" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
unset locations | ||
|
||
script_dir="$1" | ||
source "${script_dir}/shellmenu.sh" | ||
|
||
configfilename=.ezk-bash-config | ||
|
||
function toDirAndTerminate () { | ||
vars="$*" # all splitted words back to one var | ||
blueLog "toDir $vars" | ||
eval "cd ${vars// /\\ }" # escape spaces | ||
nowaitonexit | ||
} | ||
|
||
# Reads the config into global array "workspaces" | ||
# The config needs to have that section [workspaces] | ||
initConfig "${script_dir}/EasyKey.bash/${configfilename}" | ||
|
||
echo "${locations[@]}" | ||
|
||
clear | ||
thekeys=($(echo {a..p}) $(echo {r..z}) $(echo {1..9}) $(echo {A..Z})) | ||
declare -x keycounter=1 | ||
|
||
immediateMode=true | ||
|
||
menuInit "Quick Locations" | ||
echo | ||
submenuHead "Registered locations:" | ||
OLD_IFS=$IFS | ||
for (( i = 1; i < (( ${#locations[@]} + 1 )); i++ )); do | ||
IFS="=" read -r locname locdestination <<< "${locations[i]}" | ||
menuItem "${thekeys[keycounter]}" "$locdestination" "toDirAndTerminate ${locdestination}" | ||
((keycounter++)) | ||
done | ||
IFS=$OLD_IFS | ||
echo | ||
submenuHead "Shortcuts" | ||
menuItem X "Purge git dir cache" purgDirCache | ||
choice | ||
|
||
unset locations |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
[workspaces] | ||
myworkspacelocation=~/workspace | ||
|
||
[locations] | ||
mavenrepohome=~/.m2 | ||
userbin=/usr/local/bin | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# EasyKey.maven utility | ||
|
||
EasyKey.maven is a sample menu used for daily work with Maven. Here is the menu: | ||
|
||
<img width="574" alt="image" src="https://github.com/nschlimm/EasyKey.shellmenu/assets/876604/37f76f5e-55af-445a-987d-b2787473a057"> | ||
|
||
# Get started | ||
|
||
To get startet with the full functionality: | ||
|
||
1. Install `mvn` (Maven) on the command line. | ||
2. Clone this repository using `git clone https://github.com/nschlimm/EasyKey.shellmenu.git` | ||
3. Start the menu with `bash maven.sh` or with `bash path/to/maven.sh` |
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