diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ed81308..fe5b03a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,8 +4,10 @@
-
+
+
+
@@ -132,14 +134,6 @@
1723279982210
-
-
- 1723847456806
-
-
-
- 1723847456806
-
1724013210356
@@ -524,7 +518,15 @@
1727288788988
-
+
+
+ 1727347126769
+
+
+
+ 1727347126769
+
+
@@ -565,7 +567,6 @@
-
@@ -590,31 +591,22 @@
-
+
+
file://$PROJECT_DIR$/wg_func.py
- 137
+ 184
file://$PROJECT_DIR$/wg_func.py
- 196
+ 294
-
- file://$PROJECT_DIR$/wg_func.py
- 74
-
-
-
- file://$PROJECT_DIR$/wg_func.py
- 348
-
-
diff --git a/wg_func.py b/wg_func.py
index 0d07da5..1c9dc3d 100755
--- a/wg_func.py
+++ b/wg_func.py
@@ -10,6 +10,7 @@ from pathlib import Path
from subprocess import check_call
font_color = '#4011a7'
+dk_theme = '#2e2e2e'
path_to_file = Path('/etc/wire_py/wg_py')
_u = Path.read_text(Path('/tmp/_u'))
@@ -34,19 +35,20 @@ def msg_window(img_w, img_i, w_title, w_txt, x, y):
msg.monitor_center_x = msg.winfo_screenwidth() / 2 - (msg.x_width / 2)
msg.monitor_center_y = msg.winfo_screenheight() / 2 - (msg.y_height / 2)
msg.geometry('%dx%d+%d+%d' % (msg.x_width, msg.y_height, msg.monitor_center_x, msg.monitor_center_y))
- msg.columnconfigure(0, weight=1)
- msg.configure(pady=20)
+ msg.configure(pady=15)
msg.img = tk.PhotoImage(file=img_w)
msg.i_window = tk.Label(msg, image=msg.img)
msg.i_window.grid(column=0, row=0)
label = tk.Label(msg, text=w_txt)
- label.config(font=('Ubuntu', 11), padx=15, pady=15)
+ label.config(font=('Ubuntu', 11), padx=15)
label.grid(column=1, row=0)
button = tk.Button(msg, text='OK', command=msg.destroy)
- button.config(padx=15, pady=5)
+ button.config(padx=15)
button.grid(column=0, columnspan=2, row=1)
img_i = tk.PhotoImage(file=img_i)
msg.iconphoto(True, img_i)
+ msg.columnconfigure(0, weight=1)
+ msg.rowconfigure(0, weight=1)
msg.winfo_toplevel()
@@ -54,6 +56,7 @@ class GreenLabel:
"""
Show the active tunnel in green in the label
"""
+
def __init__(self):
self.StrVar = None
self.lb_tunnel = None
@@ -76,6 +79,7 @@ class StartStopBTN:
"""
Show Start and Stop Button in Label
"""
+
def __init__(self):
self.lb_frame_btn_lbox = None
self.wg_switch = None
@@ -97,6 +101,7 @@ class ConToDict:
The config file is packed into a dictionary,
to display the values Address , DNS and Peer in the labels
"""
+
@classmethod
def covert_to_dict(cls, file):
dictlist = []
@@ -139,6 +144,7 @@ class TunnelActiv:
"""
Shows the Active Tunnel
"""
+
@staticmethod
def active(): # Shows the active tunnel
active = os.popen('nmcli con show --active | grep -iPo "(.*)(wireguard)"').read().split()
@@ -155,6 +161,7 @@ class ShowAddress:
Displays the value address, DNS and peer in the labels
or empty it again
"""
+
def __init__(self):
self.lb_frame2 = None
self.lb_frame = None
@@ -198,10 +205,11 @@ class ListTunnels:
"""
Shows all existing Wireguard tunnels
"""
+
@staticmethod
def tl_list():
wg_s = os.popen('nmcli con show | grep -iPo "(.*)(wireguard)"').read().split()
- tl = wg_s[::3] # tl = Tunnel list # Show of 4.Element in list
+ tl = wg_s[::3] # tl = Tunnel list # Show of 4.Element in list
return tl
@@ -319,6 +327,7 @@ class FileHandle:
Tunnel is automatically started regardless of the active tunnel.
The selected tunnel is written into a file to read it after the start of the system.
"""
+
def __init__(self):
self.wg_autostart = None
@@ -352,6 +361,7 @@ class OnOff:
Set (on), the selected tunnel is displayed in the label.
At (off) the label is first emptied then filled with No Autoconnect
"""
+
def __init__(self):
self.wg_autostart = None
self.selected_option = None
@@ -384,6 +394,7 @@ class ExportTunnels:
A zipfile with current date and time is created
in the user's home directory with correct right
"""
+
@staticmethod
def wg_export():
_u1 = str(_u[6:])
diff --git a/wg_main.py b/wg_main.py
index 12150cd..c5636ec 100755
--- a/wg_main.py
+++ b/wg_main.py
@@ -10,6 +10,7 @@ from wg_func import (TunnelActiv, ListTunnels, ImportTunnel, ConToDict, GreenLab
FileHandle, ExportTunnels, OnOff, msg_window)
font_color = '#4011a7'
+dk_theme = '#2e2e2e'
class MainWindow(tk.Tk):
@@ -242,7 +243,7 @@ class FrameWidgets(ttk.Frame):
iw = r'/usr/share/icons/wp-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = 'Renaming not possible'
- msg_t = 'No valid sign. These must not be used.\nBlank, Slash, Backslash and { }'
+ msg_t = 'No valid sign. These must not be used.\nBlank, Slash, Backslash and { }\n'
x = 370 # width
y = 130 # height
msg_window(iw, ii, wt, msg_t, x, y)