fix install and .desktop File Tar works now for user home and filebrowser.askfilebrowser start now in user home

This commit is contained in:
Désiré Werner Menrath 2024-09-19 22:23:34 +02:00
parent b633fac5a0
commit 3965844b6b
4 changed files with 36 additions and 28 deletions

View File

@ -4,11 +4,11 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="fix a filedialog for hidden Files work&#10;install rollback to bash for start wirepy and wirepy rollback to bash">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="install rollback bash to py wirepy rollback to py">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/install" beforeDir="false" afterPath="$PROJECT_DIR$/install" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Wire-Py.desktop" beforeDir="false" afterPath="$PROJECT_DIR$/Wire-Py.desktop" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_func.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wirepy" beforeDir="false" afterPath="$PROJECT_DIR$/wirepy.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wirepy.py" beforeDir="false" afterPath="$PROJECT_DIR$/wirepy.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -42,23 +42,23 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"ASKED_ADD_EXTERNAL_FILES": "true",
"Python.INSTALL.executor": "Run",
"Python.install.executor": "Run",
"Python.main.executor": "Run",
"Python.messagebox.executor": "Run",
"Python.start_wg.executor": "Run",
"Python.wg_func.executor": "Run",
"Python.wg_main.executor": "Run",
"RunOnceActivity.ShowReadmeOnStart": "true",
"Shell Script.install.executor": "Run",
"git-widget-placeholder": "main",
"last_opened_file_path": "/home/punix/Pyapps/wire-py",
"settings.editor.selected.configurable": "preferences.fileTypes"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
&quot;Python.INSTALL.executor&quot;: &quot;Run&quot;,
&quot;Python.install.executor&quot;: &quot;Run&quot;,
&quot;Python.main.executor&quot;: &quot;Run&quot;,
&quot;Python.messagebox.executor&quot;: &quot;Run&quot;,
&quot;Python.start_wg.executor&quot;: &quot;Run&quot;,
&quot;Python.wg_func.executor&quot;: &quot;Run&quot;,
&quot;Python.wg_main.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;Shell Script.install.executor&quot;: &quot;Run&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;last_opened_file_path&quot;: &quot;/home/punix/Pyapps/wire-py&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.fileTypes&quot;
}
}]]></component>
}</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$" />
@ -439,7 +439,15 @@
<option name="project" value="LOCAL" />
<updated>1726764877546</updated>
</task>
<option name="localTasksCounter" value="39" />
<task id="LOCAL-00039" summary="install rollback bash to py wirepy and wirepy rollback to py">
<option name="closed" value="true" />
<created>1726770649542</created>
<option name="number" value="00039" />
<option name="presentableId" value="LOCAL-00039" />
<option name="project" value="LOCAL" />
<updated>1726770649542</updated>
</task>
<option name="localTasksCounter" value="40" />
<servers />
</component>
<component name="UnknownFeatures">
@ -480,7 +488,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="In FrameWidged Class else Block StrVar, this resorts reference and variable assignment together" />
<MESSAGE value="add method init_and_report and label_empty to Class ShowAddress" />
<MESSAGE value="little fixes in Class Import" />
<MESSAGE value="fix label when laat Tunnel delete and fix Tuple error in delete and Start/Stop when listbox empty" />
@ -505,6 +512,7 @@
<MESSAGE value="set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" />
<MESSAGE value="fix set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" />
<MESSAGE value="fix a filedialog for hidden Files work&#10;install rollback to bash for start wirepy and wirepy rollback to bash" />
<option name="LAST_COMMIT_MESSAGE" value="fix a filedialog for hidden Files work&#10;install rollback to bash for start wirepy and wirepy rollback to bash" />
<MESSAGE value="install rollback bash to py wirepy and wirepy rollback to py" />
<option name="LAST_COMMIT_MESSAGE" value="install rollback bash to py wirepy and wirepy rollback to py" />
</component>
</project>

View File

@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Wire-Py
Exec=/usr/bin/wirepy
Exec=/usr/bin/wirepy.py
Terminal=false
Categories=Network;
Icon=/usr/share/icons/wp-icons/128/wg_vpn.png

View File

@ -9,7 +9,7 @@ from subprocess import check_call
font_color = '#4011a7'
path_to_file = Path('/etc/wire_py/wg_py')
_u = Path.read_text(Path('/tmp/_u'))
def msg_window():
msg = tk.Toplevel()
@ -181,7 +181,7 @@ class ImportTunnel:
def wg_import_select(self):
try:
filepath = filedialog.askopenfilename(initialdir='/home/', title='Select Wireguard config File',
filepath = filedialog.askopenfilename(initialdir=str(_u), title='Select Wireguard config File',
filetypes=[('WG config files', '*.conf')],)
with open(filepath, 'r') as file:
@ -293,13 +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 = '/home/' + str(_u) + now_datetime
wg_tar = str(_u) + '/' + now_datetime
p_to_conf = Path('/etc/wire_py/')
shutil.make_archive(wg_tar, 'zip', p_to_conf)
#if zip_full != 0:

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/python3
from subprocess import check_call
from pathlib import Path