diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ec2ac1e..f84c990 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,11 +4,11 @@
-
+
-
+
@@ -55,7 +55,7 @@
"RunOnceActivity.ShowReadmeOnStart": "true",
"Shell Script.install.executor": "Run",
"git-widget-placeholder": "main",
- "last_opened_file_path": "/home/punix/Pyapps/wire-py",
+ "last_opened_file_path": "/home/punix/Pyapps/filebrowserhiddenfiles",
"settings.editor.selected.configurable": "preferences.fileTypes"
}
}
@@ -423,7 +423,15 @@
1726691611936
-
+
+
+ 1726734843529
+
+
+
+ 1726734843529
+
+
@@ -464,7 +472,6 @@
-
@@ -489,7 +496,8 @@
-
+
+
diff --git a/install b/install
index 1e60aa3..6c34953 100755
--- a/install
+++ b/install
@@ -8,7 +8,7 @@ if [ $? -ne 0 ]
cp wg_main.py start_wg.py wg_func.py wirepy /usr/bin/ && \
mkdir -p /etc/wire_py && cp -R wp-icons /usr/share/icons/ && \
chown -R root:root /etc/wire_py && chmod 755 /etc/wire_py && \
- ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy >/dev/null && \
+ ln -sf /usr/bin/wirepy /usr/local/bin/wirepy >/dev/null && \
cp org.wirepy.policy /usr/share/polkit-1/actions/ && \
cp Wire-Py.desktop /usr/share/applications/ && \
cp wg_start.services /lib/systemd/system/ && \
@@ -19,7 +19,7 @@ else
sudo cp wg_main.py start_wg.py wg_func.py wirepy /usr/bin/ && \
sudo mkdir -p /etc/wire_py && sudo cp -R wp-icons /usr/share/icons/ && \
sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
- sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
+ sudo ln -sf /usr/bin/wirepy /usr/local/bin/wirepy && \
sudo cp org.wirepy.policy /usr/share/polkit-1/actions/ && \
sudo cp Wire-Py.desktop /usr/share/applications/ && \
sudo cp wg_start.service /lib/systemd/system/ && \
diff --git a/wg_func.py b/wg_func.py
index 9d752bc..2e76d71 100755
--- a/wg_func.py
+++ b/wg_func.py
@@ -181,9 +181,8 @@ class ImportTunnel:
def wg_import_select(self):
try:
- filepath = filedialog.askopenfilename(initialdir=Path('/home/'), title='Select Wireguard config '
- 'File',
- filetypes=[('WG config files', '*.conf')], )
+ filepath = filedialog.askopenfilename(initialdir='/home/', title='Select Wireguard config File',
+ filetypes=[('WG config files', '*.conf')],)
with open(filepath, 'r') as file:
read = file.read()
@@ -294,12 +293,13 @@ class OnOff:
class ExportTunnels:
@staticmethod
def wg_export():
+ _u = Path.read_text(Path('/tmp/_u'))
now_time = datetime.now()
now_datetime = now_time.strftime('wg-exp-' + '%m-%d-%Y' + '-' + '%H:%M')
tl = ListTunnels.tl_list()
try:
if len(tl) != 0:
- wg_tar = Path(f'/{home}/'), now_datetime
+ wg_tar = _u, now_datetime
p_to_conf = Path('/etc/wire_py/')
shutil.make_archive(wg_tar, 'zip', p_to_conf)
#if zip_full != 0:
diff --git a/wg_main.py b/wg_main.py
index f1c11b3..7518379 100755
--- a/wg_main.py
+++ b/wg_main.py
@@ -1,8 +1,10 @@
#!/usr/bin/python3
import tkinter as tk
from subprocess import check_call
-from tkinter import ttk
+from tkinter import *
from pathlib import Path
+from tkinter import ttk
+
from wg_func import (TunnelActiv, ListTunnels, ImportTunnel, ConToDict, GreenLabel, StartStopBTN, ShowAddress,
FileHandle, ExportTunnels, OnOff)
@@ -251,4 +253,11 @@ class FrameWidgets(ttk.Frame):
if __name__ == '__main__':
window = MainWindow()
+ try:
+ window.tk.call('tk_getOpenFile', '-foobarbaz')
+ except TclError:
+ pass
+
+ window.tk.call('set', '::tk::dialog::file::showHiddenBtn', '0')
+ window.tk.call('set', '::tk::dialog::file::showHiddenVar', '0')
window.mainloop()
diff --git a/wirepy b/wirepy
index 066e378..b133bbe 100755
--- a/wirepy
+++ b/wirepy
@@ -1,3 +1,3 @@
#!/bin/bash
-pkexec /usr/bin/wg_main.py
\ No newline at end of file
+pkexec /usr/bin/wg_main.py