I am fairly new to Linux. I have successfully created a desktop shortcut using the method where you create a new .desktop file and add in the information.
The issue I'd like to overcome is that the new shortcut has a dummy icon image and gives the 'untrusted application warning' when first launched.
I'd like to be able to create the shortcut and have it already trusted and have the icon appear nicely as soon as the command is executed. I've written a bash script for this and I think there must be a way to set this up so that it works nicely.
The end result is to eventually run a script that configures a new box to have all my desktop shortcuts pre-made and ready to go.
Here's the script:
#! /bin/bash
LT_RED='\033[1;31m'
LT_GREEN='\033[1;32m'
LT_BLUE='\033[1;36m'
NC='\033[0m' # NO COLOR
function CreateGeanyEnvVar(){
if [ ! -n "$GEANY_LN" ]; then
printf "${LT_GREEN}\n => Creating GEANY_LN env var.${NC}"
GEANY_LN=$HOME/Desktop
else
printf "${LT_RED}\n => GEANY_LN already exits.${NC}"
fi
}
function CreateGeanyDesktopIcon(){
printf "${LT_GREEN}\n => Creating Geany Desktop Icon.${NC}\n"
touch ${GEANY_LN}/geany.desktop
echo "[Desktop Entry]" >> ${GEANY_LN}/geany.desktop
echo "Type=Application" >> ${GEANY_LN}/geany.desktop
echo "Version=1.0" >> ${GEANY_LN}/geany.desktop
echo "Name=Geany" >> ${GEANY_LN}/geany.desktop
echo "GenericName=Integrated Development Environment" >> ${GEANY_LN}/geany.desktop
echo "Comment=A fast and lightweight IDE using GTK+" >> ${GEANY_LN}/geany.desktop
echo "Exec=geany %F" >> ${GEANY_LN}/geany.desktop
echo "Icon=geany" >> ${GEANY_LN}/geany.desktop
echo "Terminal=false" >> ${GEANY_LN}/geany.desktop
echo "Categories=GTK;Development;IDE;" >> ${GEANY_LN}/geany.desktop
echo "MimeType=text/plain;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;text/x-java;text/x-dsrc;text/x-pascal;text/x-perl;text/x-python;application/x-php;application/x-httpd-php3;application/x-httpd-php4;application/x-httpd-php5;application/xml;text/html;text/css;text/x-sql;text/x-diff;" >> ${GEANY_LN}/geany.desktop
echo "StartupNotify=true" >> ${GEANY_LN}/geany.desktop
echo "Keywords=Text;Editor;" >> ${GEANY_LN}/geany.desktop
echo "X-Desktop-File-Install-Version=0.22" >> ${GEANY_LN}/geany.desktop
chmod 755 ${GEANY_LN}/geany.desktop
}
printf "${LT_GREEN}Setup Geany on CentOS 7\n${NC}"
printf "${LT_GREEN}*********************************\n${NC}"
CreateGeanyEnvVar
CreateGeanyDesktopIcon