commit d5790a8e98b9dff72b1ae00cb6b4e8e456b2ab9b Author: Davide Depau Date: Fri Sep 6 18:58:07 2019 +0200 Initial commit diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9d1a118 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "easybashgui"] + path = easybashgui + url = https://github.com/BashGui/easybashgui.git diff --git a/easybashgui b/easybashgui new file mode 160000 index 0000000..c7c6c7c --- /dev/null +++ b/easybashgui @@ -0,0 +1 @@ +Subproject commit c7c6c7c1013c006feeb67ef820805d2d5029ef3e diff --git a/shcrt b/shcrt new file mode 100644 index 0000000..e805ef9 --- /dev/null +++ b/shcrt @@ -0,0 +1,37 @@ +#!/bin/bash + +export SHELL_LIBRARY_PATH="$SHELL_LIBRARY_PATH:./easybashgui/lib" +export PATH="$PATH:./easybashgui/src" +source easybashgui + +function is_wsl { + grep -q Microsoft /proc/version + return $? +} + +function win_path_to_wsl { + echo "$1" | sed '[\]|/|g' +} + +function scrt_session_path { + if is_wsl; then + appdata="$(cmd.exe /C 'echo %APPDATA%')" + echo "$appdata/VanDyke/Config/Sessions" + else + echo "$HOME/.vandyke/SecureCRT/Config/Sessions" + fi +} + +session_path="$(scrt_session_path)" +current_path="" + +function scrt_cd { + if [ ! -d "$session_path/$current_path" ]; then + return 1 + fi + current_path="$current_path/$1" +} + +function scrt_ls { + return 1; +}