Created
April 17, 2020 17:29
-
-
Save mxdevmanuel/60017242736ba9641fda9b0bfd3a8aa6 to your computer and use it in GitHub Desktop.
Select, copy and paste ip address from list (requires xclip, xdotool, fzf and/or dmenu)
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 characters
#!/bin/env bash | |
TOOL=dmenu | |
if [[ -t 1 ]]; then | |
TOOL=fzf | |
fi | |
ADDR=$(ip -oneline -4 addr | awk '{print $2, $4}'| $TOOL | awk '{print $2}' | perl -pe 's/\/\d+//') | |
echo $ADDR | xclip -i -selection clipboard | |
xdotool type --clearmodifiers "$ADDR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment