User Tools

Site Tools


wiki:show_zenity_notifcation_string_selection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:show_zenity_notifcation_string_selection [2021/10/16 18:49] – created antisawiki:show_zenity_notifcation_string_selection [2021/10/17 12:48] (current) – add missing / antisa
Line 1: Line 1:
-{{tag>zenity ssh notification}}+{{tag>zenity ssh notification desktop}}
  
 ====== 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/ssh_config.d/yourhostconfig.conf | head -n1 | cut -d" " -f 2,3,4,5)+zenity --notification --text=$(grep -B1 $(xclip -o) $HOME/.ssh/ssh_config.d/yourhostconfig.conf | head -n1 | cut -d" " -f 2,3,4,5)
 </file> </file>
  
-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 "Hostname" directive is the second one in the file e.g. 
 + 
 +<code> 
 +Host myhost alias2 alias3 
 +    Hostname    <serverip> 
 +    User        root 
 +    ...rest of ssh options... 
 +</code> 
 + 
 +or you will need to tweak the grep command. 
 +</WRAP> 
  
 ====== Tested on ====== ====== Tested on ======
wiki/show_zenity_notifcation_string_selection.1634402955.txt.gz · Last modified: 2021/10/16 18:49 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki