Compare commits

..

No commits in common. "2e07b6fa54b0f8fc0be3c5b8bcdf51d145ee69eb" and "bbe08b942ab305aa0261010a8c619270c7a68920" have entirely different histories.

2 changed files with 29 additions and 48 deletions

View file

@ -1,10 +1,6 @@
#!/usr/bin/env bash
BOLD="\033[1m"
CYAN="\033[1;36m"
GREEN="\033[1;33m"
END="\033[0m"
#colors
help() {
cat <<EOF
@ -25,27 +21,19 @@ if [[ $# -eq 0 ]]; then
exit 1
fi
if [[ -z $BROWSER ]]; then
echo 'please set $BROWSER'
exit 1
fi
PORT=8090
DIR='~/'
DIR="~/"
USER_HOST=$1
case $USER_HOST in
-h | --help)
shift
while [[ $1 =~ ^- && $1 != "--" ]]; do
echo checking $1
case $1 in
-h | --help)
help
exit 0
;;
*)
shift
;;
esac
while [[ $1 =~ ^- && $1 != "--" ]]; do
case $1 in
-p | --port)
shift
PORT=${PORT:+$1}
@ -54,8 +42,8 @@ while [[ $1 =~ ^- && $1 != "--" ]]; do
shift
DIR=${DIR:+$1}
;;
-*)
echo "Invalid option: $1"
-* | --*)
echo "Invalid option: $opt"
help
exit 1
;;
@ -65,15 +53,13 @@ done
URL="http://localhost:$PORT"
printf "connecting to ${BOLD}%s${END} with port ${GREEN}%s${END}\n" \
"$USER_HOST" "$PORT"
echo "connecting to $USER_HOST with port $PORT"
echo "serving directory:"
printf " ${BOLD}->>${CYAN} %s${END}\n" "${DIR}"
echo "->>$DIR"
printf "opening ${BOLD}%s${END} using %s\n" "$URL" "$BROWSER"
echo '---------------'
"$BROWSER" "$URL" >/dev/null 2>&1 &
echo "opening $URL using $BROWSER"
$BROWSER $URL >/dev/null 2>&1 &
# first change directory in case python<3.7
ssh -tL localhost:"$PORT":localhost:"$PORT" "$USER_HOST" \
ssh -tL localhost:$PORT:localhost:$PORT $USER_HOST \
"cd $DIR && python3 -m http.server $PORT"

View file

@ -7,7 +7,6 @@ set -g mouse on
# smart pane switching with awareness of vim splits
set -g prefix C-a
unbind C-b
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
@ -39,26 +38,21 @@ thm_blue="#89b4fa"
thm_orange="#fab387"
thm_black4="#585b70"
set -g status on
set -g status-style "fg=magenta,bg=default"
set -g status-interval 2
set -g status-justify "centre"
set -g status-left "working on#[fg=cyan,bold] #S"
set -g status-left-length 60
# set -g status-right '[#S]'
set -g status-right "%b %d %Y %l:%M %p"
set -g status-right-length 60
set -g window-status-last-style "fg=${thm_yellow}"
set -g pane-border-lines heavy
active_marker="#[fg=red,bold] λ "
set -g window-status-current-format "#[bg=${thm_bg}]${active_marker}#[fg=green,bold]#W${active_marker}"
set -g status "on"
set -g status-bg "${thm_bg}"
set -g status-style "fg=${thm_magenta}"
set-option -g status on
set-option -g status-interval 2
set-option -g status-justify "centre"
set-option -g status-left-length 60
set-option -g status-right-length 60
set -g status-right '[#S]'
set-option -g window-status-current-style "fg=${thm_orange}"
set-option -g window-status-last-style "fg=${thm_yellow}"
# messages
set -g message-style "fg=${thm_orange},bg=${thm_bg},align=centre"
set -g message-command-style "fg=${thm_cyan},bg=${thm_bg},align=centre"
set -g message-style "fg=${thm_orange},bg=${thm_gray},align=centre"
set -g message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre"
# panes
set -g pane-border-style "fg=${thm_gray}"
@ -69,5 +63,6 @@ setw -g window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none"
setw -g window-status-separator " | "
setw -g window-status-style "fg=${thm_fg},bg=${thm_bg},none"
setw -g clock-mode-colour "${thm_blue}"
setw -g mode-style "fg=${thm_pink} bg=${thm_black4} bold"