mirror of
				https://github.com/Mastermindzh/dotfiles.git
				synced 2025-11-04 02:38:53 +01:00 
			
		
		
		
	added vpn scripts and openvpn dependencies
This commit is contained in:
		
							
								
								
									
										2
									
								
								dependencies/pacman.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dependencies/pacman.txt
									
									
									
									
										vendored
									
									
								
							@@ -65,3 +65,5 @@ gnome-screenshot
 | 
				
			|||||||
bash-completion
 | 
					bash-completion
 | 
				
			||||||
flameshot
 | 
					flameshot
 | 
				
			||||||
otf-font-awesome
 | 
					otf-font-awesome
 | 
				
			||||||
 | 
					openvpn
 | 
				
			||||||
 | 
					networkmanager-openvpn
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,6 +40,7 @@ set $workspace12 " Enpass"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# scripts
 | 
					# scripts
 | 
				
			||||||
set $spotify ~/.config/i3/scripts/spotify-cli.sh
 | 
					set $spotify ~/.config/i3/scripts/spotify-cli.sh
 | 
				
			||||||
 | 
					set $vpnmanager ~/.config/i3/scripts/vpn-manager.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
############################################
 | 
					############################################
 | 
				
			||||||
#    i3 management keys                    #
 | 
					#    i3 management keys                    #
 | 
				
			||||||
@@ -129,6 +130,7 @@ bindsym $mod+shift+b exec /bin/bash ~/.config/i3/scripts/brightness.sh
 | 
				
			|||||||
# active: background
 | 
					# active: background
 | 
				
			||||||
bindsym $mod+d exec "rofi -color-window '#1e1e1e, #333333, #333333' -color-normal '#1e1e1e, #848484, #1e1e1e, #333333, #f6f6f7' -lines 10 -line-padding 5 -show run"
 | 
					bindsym $mod+d exec "rofi -color-window '#1e1e1e, #333333, #333333' -color-normal '#1e1e1e, #848484, #1e1e1e, #333333, #f6f6f7' -lines 10 -line-padding 5 -show run"
 | 
				
			||||||
bindsym $mod+Tab exec "rofi -color-window '#1e1e1e, #333333, #333333' -color-normal '#1e1e1e, #848484, #1e1e1e, #333333, #f6f6f7' -color-active '#333333, #ef5350, #0000ff, #333333, #f6f6f7' -lines 10 -line-padding 5 -show"
 | 
					bindsym $mod+Tab exec "rofi -color-window '#1e1e1e, #333333, #333333' -color-normal '#1e1e1e, #848484, #1e1e1e, #333333, #f6f6f7' -color-active '#333333, #ef5350, #0000ff, #333333, #f6f6f7' -lines 10 -line-padding 5 -show"
 | 
				
			||||||
 | 
					bindsym $mod+n exec $vpnmanager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
############################################
 | 
					############################################
 | 
				
			||||||
#    Media keys                            #
 | 
					#    Media keys                            #
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										17
									
								
								i3/scripts/vpn-manager.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										17
									
								
								i3/scripts/vpn-manager.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# VPN = list con | skip first line, if type == vpn print name | show in rofi
 | 
				
			||||||
 | 
					VPN=$(nmcli con | awk 'NR>1 && $3 == "vpn" {print $1}' | rofi -dmenu -p "Select a vpn to (dis)connect")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# if $VPN not set, exit.
 | 
				
			||||||
 | 
					[ -z "$VPN" ] && exit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Check whether vpn is activated
 | 
				
			||||||
 | 
					STATE=$(nmcli con show "$VPN" | grep GENERAL.STATE: | awk '{print $2}')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# if state == activated
 | 
				
			||||||
 | 
					if [ "$STATE" == "activated" ]; then
 | 
				
			||||||
 | 
					    nmcli con down "$VPN"
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    nmcli con up "$VPN"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
		Reference in New Issue
	
	Block a user