Home Introduction The Labyrinth Social Media Terms Contact
get in shape Hits: 81644
audio biodecal4linuxdietdictionary electronic find-target fixboothalloween home hosting installation isoedit kernel links nVidia oldiespollution playcd playdvd quines rpmsignscite shortcutssocial media software termsthe labyrinth winezotero
TheNerdShow.com
"Find Target" for Any Linux Window Manager
When setting up computers for people or even just installing a few applications it can be very useful to right-click on a desktop icon and choose "find target" to immediately browse to the folder containing the application, for editing configuration files or to create launcher scripts. The script on this page can be saved in the /bin folder and given a name such as findtarget.sh and be sure to make it executable with chmod +x. If the window manager has a right-click open-with dialog, try and use that to open the icon with findtarget.sh and have it automatically browse to the installation folder. If not, simply put the desktop launcher on a desktop, preferably not right next to the trash, and drag and drop icons there.
Find Target Script (Put somewhere in $PATH, like /usr/bin)
#!/bin/bash # findtarget.sh by Henry Kroll III www.thenerdshow.com cmdline=$(awk '$1 ~/^Exec/{if($3=="wine"){xx=$2; sub(".* wine ",""); \ system(xx" winepath "$0)}else{sub("Exec=","");print $0}}' "$1") if [ ${cmdline:0:1} == '/' ]; then folder=$(dirname "$cmdline") else folder=$(dirname "`which $cmdline`") fi sel=`basename "$cmdline"` #xterm -hold -e echo $1 $cmdline X $folder X $execu #exit case "$DESKTOP_SESSION" in kde) konqueror --select "$folder/$sel";; gnome) nautilus --browser --no-desktop "$folder";; xfce) thunar "$folder";; *) xterm -hold -e mc "$folder";; esac
Desktop Launcher (Save as findtarget.desktop and then Drag and Drop icons onto it)
[Desktop Entry] Version=1.0 Encoding=UTF-8 Name=Find Target Comment=View icon target folder GenericName=View icon target folder Type=Application Exec=findtarget.sh %F Icon=/usr/share/icons/Bluecurve/96x96/mimetypes/folder-apps.png Terminal=false StartupNotify=true Categories=TextEditor;Development;GTK; X-Desktop-File-Install-Version=0.14
This page edited using the CMS I wrote for the Anchorage Net Community Hosting project.