lxdir : directory shortcuts easy

Introduce yourself, create test postings or talk nonsense
Post Reply
pizux
Posts: 6
Joined: 23. Nov 2009, 09:23

lxdir : directory shortcuts easy

Post by pizux »

hello

i made a bash script with zenity very usefull : with it you can create a shortcut from any directory to your lxde desktop , with the file manager you want ;p try it :

Code: Select all

#!/bin/bash
##script lxdir##pizuxmepis ate gmail point com

cd $HOME
 
if [ -e .config/user-dirs.dirs ]; then
. .config/user-dirs.dirs
else
XDG_DESKTOP_DIR="$HOME/Desktop"
fi
mkdir -p $XDG_DESKTOP_DIR

name=$(zenity --file-selection \
--directory --title="choose a directory to link on your desktop") 

if [ $? -ne 0 ];then exit; fi;

base=$(basename $name) 

cd /home/$USER/Desktop 

if [ -e $base.desktop ]; then
zenity --warning --text=\
"this shortcut already exist on your desktop remove it and launch this program again";
else

gest=$(zenity  --list  --text \
"Wich file manager do you want to launch with your desktop link?"\
 --radiolist --column "choose" --column "name" TRUE pcmanfm FALSE thunar FALSE nautilus FALSE dolphin) 

if [ $? -ne 0 ];then exit; fi;

echo "[Desktop Entry]
Comment=link to directory $name
Name=$base
Exec=$gest $name
Icon=folder
Type=Application
Terminal=false
NotShowIn=KDE;XFCE;GNOME;" >>$base.desktop

fi
if you want to use it you can add the lxdir.desktop i create too ( copy it to /usr/share/applications) enjoy !!

Code: Select all

[Desktop Entry]
Name=lxdir
Comment=create shortcuts on your desktop 
Exec=lxdir
Terminal=false
Icon=gtk-preferences
Categories=Settings;
Type=Application
NotShowIn=KDE;XFCE;GNOME;
Post Reply