- 
      
 - 
        
Save f0xmulder/c81b9f8351e291d12e11c58803eb817b to your computer and use it in GitHub Desktop.  
Revisions
- 
        
bigfreak85 revised this gist
Dec 10, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ "custom/vpn": { "format": "{}", "exec": "bash /home/bigfreak/.config/sway/tools/vpnupdown status", // "exec-if": "test -d /proc/sys/net/ipv4/conf/tun0", "tooltip": "true", "return-type": "json",  - 
        
bigfreak85 revised this gist
Dec 8, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,5 +5,5 @@ "tooltip": "true", "return-type": "json", "interval": 1, "on-click": "bash /home/bigfreak/.config/sway/tools/vpnupdown toggle" },  - 
        
bigfreak85 renamed this gist
Dec 7, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. - 
        
bigfreak85 renamed this gist
Dec 7, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. - 
        
bigfreak85 revised this gist
Dec 7, 2023 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ This Scripts and Config Snippets are for a little Symbol in the Waybar. If you Click on the Tunnelsymbol the OpenVPN-Client establish a Connection to the given Config (Systemd Openvpn-Client). If you do not Need the Tunnel then you can Click again on the Symbol and the VPN-Tunnel gets closed. The following moving Parts are needed: 1. The Waybar Config Snippit 2. The Toggle/Status Script 3. The Polkit Rule to allow the control of the OpenVPN-Client systemd-Unit by given user (a sudo nopasswd is also possible but not so granular and allows systemctl completly)  - 
        
bigfreak85 revised this gist
Dec 7, 2023 . No changes.There are no files selected for viewing
 - 
        
bigfreak85 revised this gist
Dec 7, 2023 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.systemd1.manage-units" && action.lookup("unit") == "[email protected]" && subject.user == "bigfreak") { return polkit.Result.YES; } });  - 
        
bigfreak85 revised this gist
Dec 6, 2023 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,8 +16,6 @@ STATUS="$(systemctl is-active [email protected])" if [ "${STATUS}" = "inactive" ]; then if [ $1 = 'toggle' ]; then systemctl start [email protected] text="{\"text\":\" \",\"class\":\"enabled\"}" fi text="{\"text\":\"\",\"tooltip\":\"imc closed\"}"  - 
        
bigfreak85 renamed this gist
Dec 6, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. - 
        
bigfreak85 renamed this gist
Dec 6, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. - 
        
bigfreak85 created this gist
Dec 6, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ "custom/vpn": { "format": "{}", "exec": "sudo bash /home/bigfreak/.config/sway/tools/vpnupdown status", // "exec-if": "test -d /proc/sys/net/ipv4/conf/tun0", "tooltip": "true", "return-type": "json", "interval": 1, "on-click": "sudo bash /home/bigfreak/.config/sway/tools/vpnupdown toggle" }, This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ # ******************************************************** # # # # # # vpnupdown # # # # By: Raffael Willems <[email protected]> # # # # Created: 2023/12/06 13:46:41 by Raffael Willems # # Updated: 2023/12/06 21:48:41 by Raffael Willems # # # # ******************************************************** # #!/bin/bash STATUS="$(systemctl is-active [email protected])" if [ "${STATUS}" = "inactive" ]; then if [ $1 = 'toggle' ]; then systemctl start [email protected] sleep 1 ip route del 192.168.0.0/24 dev tun0 text="{\"text\":\" \",\"class\":\"enabled\"}" fi text="{\"text\":\"\",\"tooltip\":\"imc closed\"}" else if [ $1 = 'toggle' ]; then systemctl stop [email protected] text="{\"text\":\"\",\"tooltip\":\"imc closed\"}" fi ADDR="$(ip -br addr show dev tun0 | awk '{ print $3 }')" text="{\"text\":\" \",\"class\":\"enabled\",\"tooltip\":\"$ADDR\"}" fi echo $text