diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-06-01 16:10:10 +0200 |
|---|---|---|
| committer | Christian Krinitsin <mail@krinitsin.com> | 2025-06-01 16:10:10 +0200 |
| commit | 8a3fab48c41d4d85f45f74b5a0806bf387cf515c (patch) | |
| tree | 1de94c53e8b9f55499aaf9fe9b29803afd9b5be2 | |
| parent | b5f27af0a9539eae22a3296f1a72a312125112f1 (diff) | |
| download | dotfiles-8a3fab48c41d4d85f45f74b5a0806bf387cf515c.tar.gz dotfiles-8a3fab48c41d4d85f45f74b5a0806bf387cf515c.zip | |
add vpn
| -rwxr-xr-x | bin/port-forwarding | 3 | ||||
| -rwxr-xr-x | bin/vpn_toggle | 23 | ||||
| -rw-r--r-- | sway/.config/sway/config | 2 |
3 files changed, 28 insertions, 0 deletions
diff --git a/bin/port-forwarding b/bin/port-forwarding new file mode 100755 index 0000000..c904110 --- /dev/null +++ b/bin/port-forwarding @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +while true ; do date ; natpmpc -a 1 0 udp 60 -g 10.2.0.1 && natpmpc -a 1 0 tcp 60 -g 10.2.0.1 || { echo -e "ERROR with natpmpc command \a" ; break ; } ; sleep 45 ; done diff --git a/bin/vpn_toggle b/bin/vpn_toggle new file mode 100755 index 0000000..201b59e --- /dev/null +++ b/bin/vpn_toggle @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +out=$(sudo wg) + +if [ "$1" == "-i" ] +then + if [ -n "$out" ] + then + notify-send "vpn is activated" + else + notify-send "vpn is deactivated" + fi + exit +fi + +if [ -n "$out" ] +then + sudo wg-quick down /etc/wireguard/schwitz.conf + echo "vpn is deactivated" +else + sudo wg-quick up /etc/wireguard/schwitz.conf + echo "vpn is activated" +fi diff --git a/sway/.config/sway/config b/sway/.config/sway/config index e5388c0..9a1204a 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -151,7 +151,9 @@ bindsym $mod+Ctrl+w exec random-wallpaper bindsym $mod+u exec toggle_monitor_focus bindsym $mod+Shift+m exec prismlauncher -l 1.21.4 -s krinitsin.com bindsym $mod+Shift+g exec steam-launcher +bindsym $mod+Shift+v exec vpn_toggle -i +# screensharing exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway # autostart |