Commit e56795b68a23

Vincent Demeester <vincent@sbr.pm>
2019-07-05 10:31:21
scripts: use zenity for dialog box in redhat vpn
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 65e7029
Changed files (2)
assets
pkgs
scripts
assets/redhat-vpn.desktop
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Name=Red Hat VPN
-Exec=gnome-terminal -- redhat-vpn
+Exec=redhat-vpn
 Type=Application
-Terminal=true
+Terminal=false
 Categories=System;
 Icon=seahorse;
\ No newline at end of file
pkgs/scripts/bin/redhat-vpn
@@ -3,8 +3,7 @@
 # This will ask for which VPN to connect (using available tools) and
 # do some magic
 set -e
-export BEMENU_BACKEND=curses
-connection=$(nmcli connection show | grep vpn | nix run nixpkgs.bemenu -c bemenu)
+connection=$(nmcli connection show | grep vpn | zenity --list --title "Red Hat VPNs" --text "Choose your VPN.." --column "Name" --width=600 --height=450)
 uuid=$(echo ${connection} | awk '{print $3}')
 name=$(echo ${connection} | awk '{print $1 $2}')
 VPNSTATUS=$(nmcli connection show --active $uuid | wc -l)
@@ -17,7 +16,7 @@ then
     gpg --decrypt $HOME/desktop/documents/Red\ Hat/naruhodo.pass.gpg 2>/dev/null >>$passfile
     echo -n "${key}" >> $passfile
 
-    nmcli connection up ${connection} passwd-file $passfile
+    nmcli connection up ${uuid} passwd-file $passfile
     rm $passfile
     notify-send "VPN ${name} is connected." "You are now connected to the Red Hat VPN, let's work !"
 else