kaliish-orange-theme/share/kali-themes/xfce4-panel-genmon-vpnip.sh
Lucas Parsy d78bca234a copy vpn ip when clicking on its icon in xfce taskbar
relies on xclip , updated tooltip to quickly give usage of the feature.

I'm doing the OSCP and I need to copy my vpn ip every 5 minutes, 
I think it would be useful to other pentesters.
2024-02-01 10:56:49 +00:00

19 lines
559 B
Bash
Executable File

#!/bin/sh
interface="$(ip tuntap show | cut -d : -f1 | head -n 1)"
ip="$(ip a s "${interface}" 2>/dev/null \
| grep -o -P '(?<=inet )[0-9]{1,3}(\.[0-9]{1,3}){3}')"
if [ "${ip}" != "" ]; then
printf "<icon>network-vpn-symbolic</icon>"
printf "<iconclick>bash -c 'printf ${ip} | xclip -selection clipboard'</iconclick>"
printf "<txt>${ip}</txt>"
if command -v xclip; then
printf "<tool>VPN IP (click icon to copy)</tool>"
else
printf "<tool>VPN IP (install xclip to copy to clipboard)</tool>"
fi
else
printf "<txt></txt>"
fi