File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 3
3
# Places a shortcut on the Desktop to any directory on the file system
4
4
#
5
5
# Parameters:
6
- # 1: The path to the directory you want a shortcut to
7
- # 2: The name of the shortcut on the Desktop
6
+ # 1: Whether to add or remove the shortcut
7
+ # 2: The path to the directory you want a shortcut to
8
+ # 3: The name of the shortcut on the Desktop
8
9
9
10
set -ex
10
11
11
- DIRECTORY=" $1 "
12
- SHORTCUT_NAME=" $2 "
12
+ ADD=" $1 "
13
+ DIRECTORY=" $2 "
14
+ SHORTCUT_NAME=" $3 "
13
15
14
16
SHADOW_DESKTOP=" /home/.skjult/Skrivebord"
15
17
16
18
mkdir --parents $SHADOW_DESKTOP
17
19
18
- # Note: "ln" doesn't care if the destination ($DIRECTORY) exists
19
- ln --symbolic --force " $DIRECTORY " " $SHADOW_DESKTOP /$SHORTCUT_NAME "
20
+ if [ " $ADD " = " True" ]; then
21
+ # Note: "ln" doesn't care if the destination ($DIRECTORY) exists
22
+ ln --symbolic --force " $DIRECTORY " " $SHADOW_DESKTOP /$SHORTCUT_NAME "
23
+ else
24
+ rm " $SHADOW_DESKTOP /$SHORTCUT_NAME "
25
+ fi
You can’t perform that action at this time.
0 commit comments