2022-03-25 19:42:46 +01:00
|
|
|
diff --git a/polybar-wireguard b/rofi-wireguard
|
|
|
|
similarity index 88%
|
|
|
|
rename from polybar-wireguard
|
|
|
|
rename to rofi-wireguard
|
|
|
|
index 6712185..03e7dcb 100755
|
2022-03-18 09:55:44 +01:00
|
|
|
--- a/polybar-wireguard
|
2022-03-25 19:42:46 +01:00
|
|
|
+++ b/rofi-wireguard
|
|
|
|
@@ -6,11 +6,11 @@
|
|
|
|
# https://github.com/polybar/polybar/wiki/Formatting#format-tags-inside-polybar-config
|
|
|
|
green=#55aa55
|
|
|
|
|
2022-03-18 09:55:44 +01:00
|
|
|
-configs_path="/PATH/TO/CONF/FILES"
|
2022-03-25 19:42:46 +01:00
|
|
|
+configs_path="$HOME/.config/wireguard"
|
|
|
|
connected_interface=$(sudo wg | grep interface | cut -d " " -f2)
|
|
|
|
|
|
|
|
connect() {
|
2022-03-18 09:55:44 +01:00
|
|
|
- selected_config=$(ls $configs_path/*.conf | xargs basename -a -s .conf | dmenu)
|
2022-03-25 19:42:46 +01:00
|
|
|
+ selected_config=$(ls $configs_path/*.conf | xargs basename -a -s .conf | rofi -i -dmenu -p "Select a VPN server to connect: ")
|
|
|
|
[[ $selected_config ]] && sudo wg-quick up "$configs_path"/"$selected_config".conf
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -36,9 +36,9 @@ toggle() {
|
|
|
|
print() {
|
|
|
|
if [[ $connected_interface ]]
|
|
|
|
then
|
2022-03-25 17:10:57 +01:00
|
|
|
- echo %{u"$green"}%{+u}%{T4}%{F"$green"}%{T-}%{F-} "$connected_interface"
|
2022-03-25 19:42:46 +01:00
|
|
|
+ echo $connected_interface
|
|
|
|
else
|
2022-03-25 17:10:57 +01:00
|
|
|
- echo %{T4}%{T-}
|
2022-03-25 19:42:46 +01:00
|
|
|
+ echo
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|