translate vorbereitung mit $

This commit is contained in:
Désiré Werner Menrath 2023-11-01 17:41:32 +01:00
parent e82124f7d9
commit d8ca98c32c
2 changed files with 20 additions and 20 deletions

View File

@ -17,7 +17,7 @@
nmcli connection down $wert &> ${wg_wdir}.stop.txt nmcli connection down $wert &> ${wg_wdir}.stop.txt
if disable=$(grep -i 'deaktiviert\|disabled' ${wg_wdir}.stop.txt) if disable=$(grep -i 'deaktiviert\|disabled' ${wg_wdir}.stop.txt)
then then
notify-send --icon=${wg_pic}wg-stop.png "$wert Connection disconnected." notify-send --icon=${wg_pic}wg-stop.png $"$wert Connection disconnected."
pkill yad pkill yad
fi fi

38
wire_g
View File

@ -43,7 +43,7 @@ wg_notify(){
#Icon des Menübuttons definieren #Icon des Menübuttons definieren
echo "icon:${wg_pic}wg-vpn.png" >&3 echo "icon:${wg_pic}wg-vpn.png" >&3
#Name des Menüs definieren #Name des Menüs definieren
echo "tooltip:$active activ" >&3 echo $"tooltip:$active activ" >&3
} }
export -f wg_notify export -f wg_notify
@ -58,10 +58,10 @@ import_wg(){
wg_pic="/home/$a_user/.icons/" wg_pic="/home/$a_user/.icons/"
wg_wdir="/home/$a_user/.config/wg_nmcli/" wg_wdir="/home/$a_user/.config/wg_nmcli/"
if wgconf=$(yad --file --separator=" \n" \ if wgconf=$(yad --file --separator=" \n" \
--button="OK" --button="Cancel" \ --button=$"OK" --button=$"Cancel" \
--width=1200 --height=800 \ --width=1200 --height=800 \
--window-icon=${wg_pic}wg-import.png \ --window-icon=${wg_pic}wg-import.png \
--title="Wireguard .conf Select file") --title=$"Wireguard .conf Select file")
then then
active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//') active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
if [[ -n $active ]] if [[ -n $active ]]
@ -92,9 +92,9 @@ remove(){
if selection=$(yad --no-click --list --height=300 --width=60 \ if selection=$(yad --no-click --list --height=300 --width=60 \
--title="Wire-G Trash" --center \ --title="Wire-G Trash" --center \
--fixed --buttons-layout=center \ --fixed --buttons-layout=center \
--button="OK" --button="Cancel" \ --button=$"OK" --button=$"Cancel" \
--separator="" --window-icon=${wg_pic}wg-trash.png \ --separator="" --window-icon=${wg_pic}wg-trash.png \
--borders=8 --column 'Delete' $tunnel) --borders=8 --column=$'Delete' $tunnel)
then then
nmcli connection delete $selection &> ${wg_wdir}.tmp.txt nmcli connection delete $selection &> ${wg_wdir}.tmp.txt
success=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${wg_wdir}.tmp.txt) success=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${wg_wdir}.tmp.txt)
@ -102,14 +102,14 @@ remove(){
then then
yad --window-icon=${wg_pic}wg-trash.png \ yad --window-icon=${wg_pic}wg-trash.png \
--image-on-top --image=${wg_pic}wg-info.png \ --image-on-top --image=${wg_pic}wg-info.png \
--text="Your tunnel $selection was successfully deleted.\n" \ --text=$"Your tunnel $selection was successfully deleted.\n" \
--text-align=center --button="OK" --title "Wire-G Trash" \ --text-align=center --button=$"OK" --title "Wire-G Trash" \
--fixed --center --buttons-layout=center --borders=8 --center --fixed --center --buttons-layout=center --borders=8 --center
else else
yad --window-icon=${wg_pic}wg-trash.png \ yad --window-icon=${wg_pic}wg-trash.png \
--image-on-top --image=${wg_pic}wg-info.png \ --image-on-top --image=${wg_pic}wg-info.png \
--text="Oh something went wrong.\nPlease delete tunnel in the network manager." \ --text=$"Oh something went wrong.\nPlease delete tunnel in the network manager." \
--text-align=center --button="OK" --title "Wire-G Trash" \ --text-align=center --button=$"OK" --title "Wire-G Trash" \
--fixed --center --buttons-layout=center --borders=8 --center --fixed --center --buttons-layout=center --borders=8 --center
fi fi
if [ $selection = $active ] if [ $selection = $active ]
@ -131,8 +131,8 @@ up_or_down(){
if [[ -z $active ]] if [[ -z $active ]]
then then
yad --image-on-top --image=${wg_pic}wg-info.png \ yad --image-on-top --image=${wg_pic}wg-info.png \
--text="There is no active tunnel that you could stop.\n" \ --text=$"There is no active tunnel that you could stop.\n" \
--text-align=center --button="OK" --title "Wire-G" \ --text-align=center --button=$"OK" --title "Wire-G" \
--fixed --center --buttons-layout=center --borders=8 --center --fixed --center --buttons-layout=center --borders=8 --center
else else
wg_stop wg_stop
@ -149,7 +149,7 @@ more(){
a_user=$(whoami) a_user=$(whoami)
wg_pic="/home/$a_user/.icons/" wg_pic="/home/$a_user/.icons/"
selection=$(yad --text "<span color='#626ff1'><b>Wire-G Author: Désiré Werner Menrath</b></span> selection=$(yad --text=$"<span color='#626ff1'><b>Wire-G Author: Désiré Werner Menrath</b></span>
<span color='#626ff1'><b>E-Mail: polunga40@unity-mail.de</b></span> <span color='#626ff1'><b>E-Mail: polunga40@unity-mail.de</b></span>
<span color='#626ff1'><b>At all tunnels, the auto start is disabled"!"</b></span> <span color='#626ff1'><b>At all tunnels, the auto start is disabled"!"</b></span>
<span color='#626ff1'><b>Use without warranty"!"</b></span> <span color='#626ff1'><b>Use without warranty"!"</b></span>
@ -158,9 +158,9 @@ more(){
--title="Wire-G" --center \ --title="Wire-G" --center \
--fixed --borders=8 --close-on-unfocus \ --fixed --borders=8 --close-on-unfocus \
--buttons-layout=center \ --buttons-layout=center \
--button=Import:"bash -c import_wg" \ --button=$"Import":"bash -c import_wg" \
--button="Wire-G Stop":"bash -c up_or_down" \ --button=$"Wire-G Stop":"bash -c up_or_down" \
--button="Cancel":1 \ --button=$"Cancel":1 \
--separator="" --window-icon=${wg_pic}wg-vpn.png) --separator="" --window-icon=${wg_pic}wg-vpn.png)
} }
export -f more export -f more
@ -187,15 +187,15 @@ if selection=$(yad --no-click --list \
--close-on-unfocus --center \ --close-on-unfocus --center \
--height=300 --width=60 --title="Wire-G" \ --height=300 --width=60 --title="Wire-G" \
--fixed --buttons-layout=center \ --fixed --buttons-layout=center \
--button="OK" --button="Cancel" \ --button=$"OK" --button=$"Cancel" \
--button=More:"bash -c more" --button=Remove:"bash -c remove" --separator="" \ --button=$"More":"bash -c more" --button=$"Remove":"bash -c remove" --separator="" \
--window-icon=${wg_pic}wg-vpn.png \ --window-icon=${wg_pic}wg-vpn.png \
--borders=8 --image-on-top --image=${wg_pic}wg-active.png \ --borders=8 --image-on-top --image=${wg_pic}wg-active.png \
--text "<b>Activ Tunnel: </b> <span color='#0fad0a'><b>$active</b></span> --text=$"<b>Activ Tunnel: </b> <span color='#0fad0a'><b>$active</b></span>
<b>----------------------------------------------------------------------------------</b> <b>----------------------------------------------------------------------------------</b>
<b>If no tunnels are listed,</b> <b>If no tunnels are listed,</b>
<b>so they have to import their tunnel beforehand.</b>" \ <b>so they have to import their tunnel beforehand.</b>" \
--column 'Selection' $tunnel) --column=$'Selection' $tunnel)
then then
if [[ -n $active ]] if [[ -n $active ]]