summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-06-01 16:10:10 +0200
committerChristian Krinitsin <mail@krinitsin.com>2025-06-01 16:10:10 +0200
commit8a3fab48c41d4d85f45f74b5a0806bf387cf515c (patch)
tree1de94c53e8b9f55499aaf9fe9b29803afd9b5be2
parentb5f27af0a9539eae22a3296f1a72a312125112f1 (diff)
downloaddotfiles-8a3fab48c41d4d85f45f74b5a0806bf387cf515c.tar.gz
dotfiles-8a3fab48c41d4d85f45f74b5a0806bf387cf515c.zip
add vpn
-rwxr-xr-xbin/port-forwarding3
-rwxr-xr-xbin/vpn_toggle23
-rw-r--r--sway/.config/sway/config2
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