#!/bin/bash ##script dlc directory-link-creator## open directory with pcmanfm choosing your icon ##pizuxmepis ate gmail point com ,thx to anubisg1 IRC#lxde ##the .desktop create got the suffix (dlc-)foo.desktop for dissociate from other one ######################################################################################## #this is the desktop file you can copy to /usr/share/applications name it dlc.desktop # [Desktop Entry] # Name=dlc # Comment[fr]=créer un raccourci sur le bureau # Comment[us]=create desktop shortcut # Exec=dlc # Terminal=false # Icon=gtk-preferences # Categories=Settings; # Type=Application # OnlyShowIn=LXDE; ########################################################## old_IFS=$IFS # sauvegarde du séparateur de champ IFS=$'\n' # nouveau séparateur de champ DIX() { cd $HOME #check desktop if [[ -e .config/user-dirs.dirs ]]; then . .config/user-dirs.dirs else XDG_DESKTOP_DIR="$HOME/Desktop" fi mkdir -p $XDG_DESKTOP_DIR if [[ $LANG = fr_* ]]; then #####check lang TXT=$"Choisir un dossier à lier sur votre bureau" TXT2=$"Ce lien vers ce dossier existe Déjà, choisissez en un autre ou éffacez le depuis votre bureau" TXT3=$"Choisissez votre type d'icone" TXT4=$"L'icone pare defaut est folder (dossier), BROWNSE permet de naviguer vers l'icone de votre choix" TXT5=$"Naviguez vers votre icone" TXT6=$"Le lien a été crée sur votre bureau, voulez-vous en créer un autre ?" else TXT=$"Choose a directory to link on your desktop" TXT2=$"This directory link already exist, please choose another one or delete it from your desktop" TXT3=$"Please choose your icon type" TXT4=$"Default icon is folder but you can choose yourself selecting BROWNSE" TXT5=$"Brownse to your icon" TXT6=$"Link have been created on your desktop, do you want to create another one ?" fi name="$(zenity --file-selection \ --directory --title="$TXT")" if [[ $? -ne 0 ]];then exit; fi; base="$(basename "$name")" cd $XDG_DESKTOP_DIR if [[ -e dlc-$base.desktop ]]; then zenity --warning --text=\ "$TXT2"; cd $HOME ; DIX else icon=$(zenity --width=100 --entry --title="$TXT3" \ --text="$TXT4" --entry-text="folder" \ BROWNSE folder-open video sound image document applications-office applications-education \ applications-internet applications-mutimedia applications-games applications-graphics \ printer network camera-photo camera-video camera-web computer drive-optical drive-harddisk \ dvd cdrom removable-usb) fi if [[ $? -ne 0 ]];then exit; fi; if [[ "$icon" = BROWNSE ]]; then icon=$(zenity --file-selection --filename=/usr/share/icons/ --title="$TXT5") fi if [[ $? -ne 0 ]];then exit; fi; echo "[Desktop Entry] Comment=pcmanfm link to directory "$name" Name="$base" Exec=pcmanfm "$name" Icon="$icon" Type=Application Terminal=false OnlyShowIn=LXDE;" >>dlc-$base.desktop ; zenity --question --text="$TXT6" --window-icon=open-folder if [[ $? -ne 0 ]];then exit; else DIX fi } DIX IFS=$old_IFS exit o