File: displaycal-apply-profiles-launcher

package info (click to toggle)
displaycal-py3 3.9.16-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 29,120 kB
  • sloc: python: 115,777; javascript: 11,540; xml: 598; sh: 257; makefile: 173
file content (37 lines) | stat: -rw-r--r-- 989 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
31
32
33
34
35
36
37
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import time

if sys.platform != "win32":
    print("This stub is only used on Windows.")
    sys.exit(1)

import os
import subprocess as sp

appname = "DisplayCAL"

if getattr(sys, "frozen", False):
    args = [
        os.path.join(os.path.dirname(sys.executable), f"{appname}-apply-profiles.exe")
    ]
else:
    args = [sys.executable]
    dirname = os.path.dirname(__file__)
    pyw = os.path.join(dirname, "..", f"{appname}-apply-profiles.pyw")
    if os.path.isfile(pyw):
        args.append(os.path.normpath(pyw))
    else:
        args.append(os.path.join(dirname, f"{appname.lower()}-apply-profiles"))

args.append("--task")
if "--oneshot" in sys.argv[1:]:
    args.append("--oneshot")

sp.Popen(args, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.STDOUT)

# Sleep a few seconds so task scheduler can see an instance already running and
# won't start another one due to multiple triggers firing at the same time
time.sleep(9)