diff --git a/.config/i3/config b/.config/i3/config index 54907f9..d37bae8 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -75,7 +75,7 @@ exec --no-startup-id twmnd & #Wpgtk exec --no-startup-id ~/.config/wpg/wp_init.sh #Battery notify -exec --no-startup-id ~/.config/Scripts/i3-battery-monitor +exec --no-startup-id ~/.config/Scripts/i3-battery-monitor & #Conky #exec --no-startup-id conky -d -c ~/.config/conky/conkybg & #Picom diff --git a/.config/polybar/config b/.config/polybar/config index 74daaac..35d1b6d 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -11,7 +11,7 @@ monitor = ${env:MONITOR:eDP-1} include-file = ~/.config/polybar/top-bar modules-left = i3 arrow01 xwindow arrow0 modules-center = term chrome editor fm music vpn -modules-right = arrow10 redshift arrow9 vpn-nordvpn-status arrow7 wlan arrow6 pkg arrow5 pavolume arrow4 battery arrow3 backlight arrow2 networkmanager arrow1 popup-calendar +modules-right = arrow10 redshift arrow9 vpn-wireguard-wg arrow8 vpn-nordvpn-status arrow7 wlan arrow6 pkg arrow5 pavolume arrow4 battery arrow3 backlight arrow2 networkmanager arrow1 popup-calendar ;tray-position = right ;tray-padding = 2 @@ -101,13 +101,13 @@ content-background = ${colors.color3} [module/arrow8] type = custom/text content = "" -content-foreground = ${colors.color2} -content-background = ${colors.color3} +content-foreground = ${colors.color3} +content-background = ${colors.color4} [module/arrow9] type = custom/text content = "" -content-foreground = ${colors.color3} +content-foreground = ${colors.color4} content-background = ${colors.color6} [module/arrow10] @@ -219,6 +219,14 @@ label = "%output% " label-foreground = ${colors.color0} label-background = ${colors.color9} +[module/vpn-wireguard-wg] +type = custom/script +exec = ~/.config/polybar/scripts/wireguard/vpn-wireguard-wg.sh +interval = 5 +click-left = ~/.config/polybar/scripts/wireguard/vpn-wireguard-wg.sh --toggle & +label-foreground = ${colors.color0} +label-background = ${colors.color4} + [module/temperature] type = internal/temperature thermal-zone = 6 diff --git a/.config/polybar/scripts/wireguard/vpn-wireguard-wg.sh b/.config/polybar/scripts/wireguard/vpn-wireguard-wg.sh new file mode 100755 index 0000000..a4d9622 --- /dev/null +++ b/.config/polybar/scripts/wireguard/vpn-wireguard-wg.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +connection_status() { + if [ -f "$config" ]; then + connection=$(sudo wg show "$config_name" 2>/dev/null | head -n 1 | awk '{print $NF }') + + if [ "$connection" = "$config_name" ]; then + echo "1" + else + echo "2" + fi + else + echo "3" + fi +} + +config="$HOME/wg/wg0.conf" +config_name=$(basename "${config%.*}") + +case "$1" in +--toggle) + if [ "$(connection_status)" = "1" ]; then + sudo wg-quick down "$config" 2>/dev/null + else + sudo wg-quick up "$config" 2>/dev/null + fi + ;; +*) + if [ "$(connection_status)" = "1" ]; then + echo " WG up" + elif [ "$(connection_status)" = "3" ]; then + echo "#3 Config not found!" + else + echo " WG down" + fi + ;; +esac diff --git a/addons/pacman-packages b/addons/pacman-packages index 49af925..570b4f0 100644 --- a/addons/pacman-packages +++ b/addons/pacman-packages @@ -64,6 +64,7 @@ inetutils intel-media-driver intel-ucode iproute2 +ipset iputils iwd jfsutils @@ -102,6 +103,7 @@ ncmpcpp neofetch neovim netctl +network-manager-applet networkmanager networkmanager-openvpn newsboat @@ -177,6 +179,7 @@ vulkan-intel w3m wget which +wireguard-tools wireless_tools wpa_supplicant xcursor-vanilla-dmz