-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimpleserver
More file actions
executable file
·24 lines (22 loc) · 822 Bytes
/
Copy pathsimpleserver
File metadata and controls
executable file
·24 lines (22 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/zsh
#
# The following variable are usable:
#
# $FILES_SELECTED - The currently selected file
# $LEFT_PANE - The directory of the left pane
# $RIGHT_PANE - The directory of the right pane
# $CURRENT_DIRECTORY - The currently selected directory
# $LEFT_PANE_SELECTED_FILE - The currently selected file in the left pane
# $RIGHT_PANE_SELECTED_FILE - The currently selected file in the right pane
#
# This script will go to the current directory in fman and launch a python
# server on port 8000 of the localhost. It stores the pid for the server in
# ~/.serverpid. That is used by the `killserver` script to stop the server. You
# might need to adjust the location of the python interpreter.
#
cd "$CURRENT_DIRECTORY"
python3 -m http.server 9000 &!
echo $! > ~/.serverpid
spid=`cat ~/.serverpid`
disown $spid
exit 0