Skip to content

Commit 25621e5

Browse files
committed
Mise à jour du script wg-toggle pour utiliser pkexec au lieu de sudo et ajustement du menu principal pour appeler omarchy-wg-toggle.
1 parent 611d17c commit 25621e5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

archlinux/install/tilling/bin/dotarchy-wg-toggle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# wg-toggle - Toggle WireGuard configs avec rofi + sudo + notify-send + signal Waybar
2+
# wg-toggle - Toggle WireGuard configs avec rofi + pkexec + notify-send + signal Waybar
33

44
CONF_DIR="/etc/wireguard"
55
SIGNAL=10
@@ -10,11 +10,11 @@ ICON_ERROR="dialog-error-symbolic"
1010
# Tableau : [config, label, config, label, ...]
1111
declare -a configs
1212

13-
# Liste des configs via sudo
13+
# Liste des configs via pkexec
1414
while read -r file; do
1515
name=$(basename "$file" .conf)
1616
configs+=("$name" "${name^}")
17-
done < <(sudo find "$CONF_DIR" -maxdepth 1 -type f -name "*.conf" 2>/dev/null)
17+
done < <(pkexec find "$CONF_DIR" -maxdepth 1 -type f -name "*.conf" 2>/dev/null)
1818

1919
if [ ${#configs[@]} -eq 0 ]; then
2020
notify-send -u critical -t 5000 -i "$ICON_ERROR" "Erreur WireGuard" "Impossible de lister les tunnels"
@@ -52,16 +52,16 @@ done
5252

5353
# Gestion de la sélection
5454
if [[ "$selected" == "Disconnect" ]]; then
55-
sudo wg-quick down "$active_iface" && \
55+
pkexec wg-quick down "$active_iface" && \
5656
notify-send -u normal -t 5000 -i "$ICON_DISCONNECTED" "WireGuard" "$active_label désactivé"
5757
elif [ -n "$active_iface" ] && [ "$active_iface" = "$config" ]; then
58-
sudo wg-quick down "$config" && \
58+
pkexec wg-quick down "$config" && \
5959
notify-send -u normal -t 5000 -i "$ICON_DISCONNECTED" "WireGuard" "$selected désactivé"
6060
elif [ -n "$active_iface" ]; then
61-
sudo wg-quick down "$active_iface" && sudo wg-quick up "$config" && \
61+
pkexec wg-quick down "$active_iface" && pkexec wg-quick up "$config" && \
6262
notify-send -u normal -t 5000 -i "$ICON_CONNECTED" "WireGuard" "$selected activé"
6363
else
64-
sudo wg-quick up "$config" && \
64+
pkexec wg-quick up "$config" && \
6565
notify-send -u normal -t 5000 -i "$ICON_CONNECTED" "WireGuard" "$selected activé"
6666
fi
6767

archlinux/install/tilling/bin/omarchy-menu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ show_style_menu() {
266266
}
267267

268268
show_main_menu() {
269-
go_to_menu "$(dotarchy-display-menu "Go" "󰀻 Apps\n󰧑 Learn\n Capture\n󰔎 Toggle\n󰸌 Style\n Wireguard\n Setup\n󰉉 Install\n󰭌 Remove\n About\n System")"
269+
go_to_menu "$(dotarchy-display-menu "Go" "󰀻 Apps\n󰧑 Learn\n Capture\n󰔎 Toggle\n󰸌 Style\n󰯡 Wireguard\n Setup\n󰉉 Install\n󰭌 Remove\n About\n System")"
270270
}
271271

272272
go_to_menu() {
@@ -282,7 +282,7 @@ go_to_menu() {
282282
*install*) show_install_menu ;;
283283
*remove*) show_remove_menu ;;
284284
*system*) show_system_menu ;;
285-
*Wireguard*) dotarchy-wg-menu ;;
285+
*wireguard*) omarchy-wg-toggle ;;
286286
*about*) terminal bash -c 'fastfetch; read -n 1 -s' ;;
287287
*power*) show_setup_power_menu ;;
288288
*) dotarchy-search-or-open-web "$1" ;;

0 commit comments

Comments
 (0)