wiki:show_zenity_notifcation_string_selection
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
wiki:show_zenity_notifcation_string_selection [2021/10/16 16:49] – created antisa | wiki:show_zenity_notifcation_string_selection [2021/10/17 10:48] (current) – add missing / antisa | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{tag> | + | {{tag> |
====== Show zenity notifcation on string selection ====== | ====== Show zenity notifcation on string selection ====== | ||
+ | ===== Requisite packages ===== | ||
+ | Install xclip and zenity if you don't have it: | ||
+ | sudo apt install xclip zenity | ||
+ | |||
+ | ===== Show hostname ===== | ||
Example of showing hostname when IP is selected in primary clipboard. Put the following in script and call it via some keyboard shortcut. | Example of showing hostname when IP is selected in primary clipboard. Put the following in script and call it via some keyboard shortcut. | ||
<file bash what_hostname.sh> | <file bash what_hostname.sh> | ||
- | zenity --notification --text=$(grep -B1 $(xclip -o) $HOME.ssh/ | + | zenity --notification --text=$(grep -B1 $(xclip -o) $HOME/.ssh/ |
</ | </ | ||
- | Install xclip and zenity if you don't have it: | + | |
- | sudo apt install xclip zenity | + | |
+ | <WRAP center round box 60%> | ||
+ | Your host entry needs to be formated so that the " | ||
+ | |||
+ | < | ||
+ | Host myhost alias2 alias3 | ||
+ | Hostname | ||
+ | User root | ||
+ | ...rest of ssh options... | ||
+ | </ | ||
+ | |||
+ | or you will need to tweak the grep command. | ||
+ | </ | ||
====== Tested on ====== | ====== Tested on ====== |
wiki/show_zenity_notifcation_string_selection.1634402955.txt.gz · Last modified: 2021/10/16 16:49 by antisa