File: make_linux_desktop_shortcut.sh

package info (click to toggle)
python-bumps 1.0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,200 kB
  • sloc: python: 24,517; xml: 493; ansic: 373; makefile: 211; javascript: 99; sh: 94
file content (30 lines) | stat: -rwxr-xr-x 890 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

# This script creates a desktop shortcut for the Bumps webview server.
# The shortcut will be created in the user's desktop directory.
# the executable path is in 'env/bin/python'

# Get the user's desktop directory
desktop_dir=~/Desktop

# Get the path to the bumps webview server
script_dir=$(realpath $(dirname $0))

# Create the desktop shortcut
echo "[Desktop Entry]
Name=Bumps-Webview
Comment=Start the bumps webview server
Exec='$script_dir/env/bin/python' -m bumps --use-persistent-path
Icon=$script_dir/env/share/icons/bumps.ico
Terminal=true
Type=Application
Categories=Development;
" > $desktop_dir/BumpsWebviewServer.desktop

# Make the desktop shortcut executable
chmod +x $desktop_dir/BumpsWebviewServer.desktop

# refresh the desktop environment to recognize the new shortcut
if command -v xdg-desktop-menu &> /dev/null; then
    xdg-desktop-menu forceupdate
fi