diff options
author | Gianni Ceccarelli <gianni.ceccarelli@broadbean.com> | 2018-02-01 18:33:15 +0000 |
---|---|---|
committer | Gianni Ceccarelli <gianni.ceccarelli@broadbean.com> | 2018-02-01 18:33:27 +0000 |
commit | c2115cd68914acb53012410de5b112a914f02d3f (patch) | |
tree | 63ea82086b00376fd9e5faa21fc59d586736fea3 | |
parent | script to guess how long an emerge will run (diff) | |
download | misc-scripts-c2115cd68914acb53012410de5b112a914f02d3f.tar.gz misc-scripts-c2115cd68914acb53012410de5b112a914f02d3f.tar.bz2 misc-scripts-c2115cd68914acb53012410de5b112a914f02d3f.zip |
more set-screen features
-rwxr-xr-x | bin/set-screen | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/bin/set-screen b/bin/set-screen index edecc26..57bdd59 100755 --- a/bin/set-screen +++ b/bin/set-screen @@ -24,6 +24,15 @@ function make_display_state_dir() { dir="$(display_state_dir)" mkdir -p "$dir" echo "Created $dir" + if [[ -n "$1" ]]; then + local srccmd="${CONFIG_DIR}/$1/command" + if [[ -x "$srccmd" ]]; then + ln -s "$srccmd" "$dir/command" && \ + echo "Linked <$1> command" + else + echo "<$1> command is not there, ignoring" + fi + fi } function run_display_state_commands() { @@ -49,6 +58,7 @@ $0 -- re-configure screens Usage: $0 make create directory for current state + $0 which show directory for current state $0 set execute 'command' script in directory for current state $0 same as 'set' $0 help show this text @@ -56,7 +66,8 @@ EOF } case "$1" in - 'make') make_display_state_dir ;; + 'make') make_display_state_dir "$2" ;; + 'which') display_state_dir ;; '' | 'set') run_display_state_commands ;; 'help' | '--help' ) print_usage ; exit 0 ;; *) >&2 print_usage; exit 1 ;; |