just sharing this script I made that creates a desktop shortcut to webpage
by edcompsci from LinuxQuestions.org on (#6CNPN)
Code:#!/bin/bash
#choose directory to put file
echo "directory"
read directory
#Choose attributes
echo "Encoding"
read encode #example UTF-8
echo "Name"
read name #example Course
iconfile="$name.desktop"
echo "file will called be called $iconfile and put into the $directory directory."
echo "Type (Application for weblink)"
read type #example link
echo "weblink"
read weblink #example https://randomprojectgenerator.com/
#echo "filepath url" #example /home
#read url
echo "icon"
read icon #example text-html
# move to chosen directory
if [ $directory = "~" ]
then
cd ~
directory=$(pwd)
else
cd $directory
fi
#create file
touch $iconfile
#populate file
echo "[Desktop Entry]" > $iconfile
echo "Encoding=$encode" >> $iconfile
echo "Name=$name" >> $iconfile
echo "Type=$type" >> $iconfile
echo "Exec=firefox $weblink" >> $iconfile
echo "Icon=$icon" >> $iconfile
#choose directory to put file
echo "directory"
read directory
#Choose attributes
echo "Encoding"
read encode #example UTF-8
echo "Name"
read name #example Course
iconfile="$name.desktop"
echo "file will called be called $iconfile and put into the $directory directory."
echo "Type (Application for weblink)"
read type #example link
echo "weblink"
read weblink #example https://randomprojectgenerator.com/
#echo "filepath url" #example /home
#read url
echo "icon"
read icon #example text-html
# move to chosen directory
if [ $directory = "~" ]
then
cd ~
directory=$(pwd)
else
cd $directory
fi
#create file
touch $iconfile
#populate file
echo "[Desktop Entry]" > $iconfile
echo "Encoding=$encode" >> $iconfile
echo "Name=$name" >> $iconfile
echo "Type=$type" >> $iconfile
echo "Exec=firefox $weblink" >> $iconfile
echo "Icon=$icon" >> $iconfile