File: desktop-file-links.py

package info (click to toggle)
cinnamon-control-center 6.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 9,700 kB
  • sloc: ansic: 35,915; xml: 136; python: 87; sh: 41; makefile: 21
file content (30 lines) | stat: -rwxr-xr-x 902 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/python3

import os
import subprocess

# Symlinks desktop files to c-c-c's panel dir so the cinnamon-control-center binary can find the plugins.
destdir_prefix = os.environ.get('MESON_INSTALL_DESTDIR_PREFIX')
prefix = os.environ.get('MESON_INSTALL_PREFIX')

source_location = os.path.join(prefix, "share", "applications")
target_location = os.path.join(destdir_prefix, "share", "cinnamon-control-center", "panels")

links = [
    "cinnamon-color-panel.desktop",
    "cinnamon-display-panel.desktop",
    "cinnamon-network-panel.desktop",
    "cinnamon-wacom-panel.desktop"
]

for link in links:
    orig_path = os.path.join(source_location, link)
    link_path = os.path.join(target_location, link)

    if os.path.lexists(link_path):
        print('%s already exists, skipping symlink creation' % link_path)
        continue

    subprocess.call(['ln', '-s', orig_path, link_path])

exit(0)