Skip to content

Commit

Permalink
allow using indicator to show the main window
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon2fly committed Nov 24, 2016
1 parent f2a6bfe commit c6a9dfa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ please make a new issue at https://github.com/Dragon2fly/vpngate-with-proxy/issu
* **python 2.7.x**: should already be shipped with your linux
* **python-requests**: ```$ sudo apt-get install python-requests```
* **python-urwid 1.3+**: ```$ sudo apt-get install python-urwid``` , only if you use `tui` version (terminal user interface)
* **wmctrl**: ```$ sudo apt-get install wmctrl```, only if you use `tui` version, use for focusing window from indicator.

Except *python 2.7.x*, all other dependencies should be automatically installed at first run.

Expand Down
1 change: 1 addition & 0 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# allow running from anywhere
dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
cd "$(dirname "$(realpath "$0")")";
echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"

type=$1
arg=$2
Expand Down
5 changes: 4 additions & 1 deletion vpnproxy_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ def exit(self, loop, data=None):
vpn_connect = Connection() # initiate network parameter

# check_dependencies:
required = {'openvpn': 0, 'python-pip': 0, 'requests': 0, 'urwid': 0}
required = {'openvpn': 0, 'python-pip': 0, 'requests': 0, 'urwid': 0, 'wmctrl': 0}
for module in ['pip', 'requests', 'urwid']:
try:
__import__(module, globals(), locals(), [], -1)
Expand All @@ -989,6 +989,9 @@ def exit(self, loop, data=None):
if not os.path.exists('/usr/sbin/openvpn'):
required['openvpn'] = 1

if not os.path.exists('/usr/sbin/openvpn'):
required['wmctrl'] = 1

need = sorted([p for p in required if required[p]])
if need:
print ctext('\n**Lack of dependencies**\n', 'rB')
Expand Down

0 comments on commit c6a9dfa

Please sign in to comment.