mirror of
https://github.com/winapps-org/winapps.git
synced 2025-10-21 07:29:34 +02:00
Compare commits
36 Commits
fix-setup-
...
revert-748
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3bca935a88 | ||
![]() |
7018afa1bd | ||
![]() |
1ef12a0308 | ||
![]() |
80ff5568fa | ||
![]() |
fd838be7e6 | ||
![]() |
20a5866eaf | ||
![]() |
c11a0b872f | ||
![]() |
33b13ed510 | ||
![]() |
471bfdce58 | ||
![]() |
ec292002f9 | ||
![]() |
8fcca24586 | ||
![]() |
af32e7a43f | ||
![]() |
5b2caa744a | ||
![]() |
74c7c1e40a | ||
![]() |
30f46e8c8c | ||
![]() |
32a93f5800 | ||
![]() |
af2871b808 | ||
![]() |
b6bb7ca37f | ||
![]() |
e5e83fee30 | ||
![]() |
e6870012ed | ||
![]() |
7d3a9e9126 | ||
![]() |
c2e662ad0e | ||
![]() |
748f3e2251 | ||
![]() |
1c2f3b77ca | ||
![]() |
3ac8765a76 | ||
![]() |
88b6ee00a0 | ||
![]() |
104b7c16c9 | ||
![]() |
982de8a0f8 | ||
![]() |
43f86b9821 | ||
![]() |
cdb5c3ef7f | ||
![]() |
b53682be6c | ||
![]() |
fbb382e1e8 | ||
![]() |
a04f5db39a | ||
![]() |
9708ca2825 | ||
![]() |
3f909c5ec0 | ||
![]() |
836f3703f6 |
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# Ensure Windows-friendly line endings and encoding for batch and registry files
|
||||
*.bat text eol=crlf
|
||||
*.cmd text eol=crlf
|
||||
*.reg text eol=crlf working-tree-encoding=UTF-16LE-BOM
|
@@ -8,13 +8,15 @@ repos:
|
||||
args: [ "775" ]
|
||||
files: (\.sh|winapps)$
|
||||
- id: forbid-crlf
|
||||
exclude: '\.(bat|cmd|reg)$'
|
||||
- id: remove-crlf
|
||||
exclude: '\.(bat|cmd|reg)$'
|
||||
- id: forbid-tabs
|
||||
- id: remove-tabs
|
||||
args: [ --whitespaces-count, "4" ]
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.6.0
|
||||
rev: v6.0.0
|
||||
hooks:
|
||||
- id: check-added-large-files
|
||||
- id: check-case-conflict
|
||||
@@ -32,18 +34,19 @@ repos:
|
||||
- id: end-of-file-fixer
|
||||
- id: fix-byte-order-marker
|
||||
- id: mixed-line-ending
|
||||
exclude: '\.(bat|cmd|reg)$'
|
||||
- id: pretty-format-json
|
||||
args: [ "--autofix", "--no-sort-keys" ]
|
||||
- id: sort-simple-yaml
|
||||
- id: trailing-whitespace
|
||||
|
||||
- repo: https://github.com/scop/pre-commit-shfmt
|
||||
rev: v3.8.0-1
|
||||
rev: v3.12.0-2
|
||||
hooks:
|
||||
- id: shfmt
|
||||
args: ["-i", "4", "-ci", "-s"]
|
||||
|
||||
- repo: https://github.com/shellcheck-py/shellcheck-py
|
||||
rev: v0.10.0.1
|
||||
rev: v0.11.0.1
|
||||
hooks:
|
||||
- id: shellcheck
|
||||
|
@@ -480,6 +480,12 @@ APP_SCAN_TIMEOUT="60"
|
||||
# - The maximum time (in seconds) to wait for the Windows VM to boot if it is not running, before attempting to launch an application.
|
||||
# DEFAULT VALUE: '120'
|
||||
BOOT_TIMEOUT="120"
|
||||
|
||||
# FREERDP RAIL HIDEF
|
||||
# - This option controls the value of the `hidef` option passed to the /app parameter of the FreeRDP command.
|
||||
# - Setting this option to 'off' may resolve window misalignment issues related to maximized windows.
|
||||
# DEFAULT VALUE: 'on'
|
||||
HIDEF="on"
|
||||
```
|
||||
|
||||
> [!IMPORTANT]
|
||||
@@ -512,6 +518,9 @@ BOOT_TIMEOUT="120"
|
||||
```bash
|
||||
xfreerdp3 /u:"Your Windows Username" /p:"Your Windows Password" /v:192.168.122.2 /cert:tofu
|
||||
|
||||
# Or, if you are using Podman
|
||||
podman unshare --rootless-netns xfreerdp3 /u:"Your Windows Username" /p:"Your Windows Password" /v:127.0.0.1 /cert:tofu
|
||||
|
||||
# Or, if you installed FreeRDP using Flatpak
|
||||
flatpak run --command=xfreerdp com.freerdp.FreeRDP /u:"Your Windows Username" /p:"Your Windows Password" /v:192.168.122.2 /cert:tofu
|
||||
```
|
||||
|
19
apps/afdesign/icon.svg
Normal file
19
apps/afdesign/icon.svg
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-1528,0)">
|
||||
<g transform="matrix(1.024,0,0,1.024,1528,0)">
|
||||
<g id="designer_icon_marketing" transform="matrix(2.79101,0,0,2.77709,-106.854,-106.797)">
|
||||
<g transform="matrix(0.349896,0,0,0.351649,38.2852,38.4565)">
|
||||
<path d="M1024,100C1024,44.808 979.192,0 924,0L100,0C44.808,0 0,44.808 0,100L0,924C0,979.192 44.808,1024 100,1024L924,1024C979.192,1024 1024,979.192 1024,924L1024,100Z" style="fill:rgb(19,72,129);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.349896,0,0,0.351649,-496.356,38.4565)">
|
||||
<path d="M2477,909.311C2476.83,931.245 2458.97,949 2437,949L2033.31,949L1860.76,650.124L2477,650.124L2477,909.311ZM1603,909L1603,733.513L1983.19,75L2131.77,75L1810.58,631.33L1993.98,949L1643,949C1620.92,949 1603,931.077 1603,909ZM2090.17,616.044L1939.95,616.044C1923.18,616.044 1907.68,607.244 1899.3,592.717C1890.91,578.199 1890.91,560.3 1899.3,545.782C1932.67,487.982 1974.45,415.612 1974.45,415.612L2090.17,616.044ZM2437,75C2458.97,75 2476.83,92.755 2477,114.689L2477,616.044L2129.52,616.044L1994.11,381.549L2171.1,75L2437,75Z" style="fill:url(#_Radial1);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<radialGradient id="_Radial1" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1038.26,0,0,1038.26,2271.03,-89.2591)"><stop offset="0" style="stop-color:rgb(107,225,251);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(56,189,250);stop-opacity:1"/></radialGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 2.0 KiB |
22
apps/afdesign/info
Normal file
22
apps/afdesign/info
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright (c) 2024 Fmstrat
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: Proprietary
|
||||
|
||||
# GNOME shortcut name
|
||||
NAME="Designer"
|
||||
|
||||
# Used for descriptions and window class
|
||||
FULL_NAME="Affinity Designer"
|
||||
|
||||
# The executable inside windows
|
||||
WIN_EXECUTABLE="C:\Program Files\Affinity\Designer 2\Designer.exe"
|
||||
|
||||
# GNOME categories
|
||||
CATEGORIES="WinApps;Affinity"
|
||||
|
||||
# GNOME mimetypes
|
||||
MIME_TYPES=""
|
||||
|
||||
# System Icon
|
||||
ICON="AffinityDesigner"
|
19
apps/afphoto/icon.svg
Normal file
19
apps/afphoto/icon.svg
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-2598,0)">
|
||||
<g transform="matrix(1.024,0,0,1.024,2598,0)">
|
||||
<g id="photo_icon_marketing" transform="matrix(2.79101,0,0,2.77709,-106.854,-106.797)">
|
||||
<g transform="matrix(0.349896,0,0,0.351649,38.2852,38.4565)">
|
||||
<path d="M1024,100C1024,44.808 979.192,0 924,0L100,0C44.808,0 0,44.808 0,100L0,924C0,979.192 44.808,1024 100,1024L924,1024C979.192,1024 1024,979.192 1024,924L1024,100Z" style="fill:rgb(78,49,136);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.349896,0,0,0.351649,-870.745,38.4565)">
|
||||
<path d="M3547,650.087L3547,909C3547,930.809 3529.51,948.566 3507.8,948.992L3243.38,948.991L3070.74,650.087L3547,650.087ZM3204.04,948.991L2736.26,948.991L2970.28,544.277L3204.04,948.991ZM2698.7,946.362C2684.55,940.937 2674.26,927.71 2673.11,911.965L2673,733.502L2863.17,404.251L3011.81,404.251L2698.7,946.362ZM3147.75,403.636C3160.7,403.69 3173.09,411.297 3179.78,422.571C3179.85,422.685 3179.98,422.915 3179.98,422.915L3219.28,490.967C3219.28,490.967 3219.51,491.348 3219.62,491.531C3226.04,502.765 3226.29,516.92 3219.87,528.358C3206.7,551.4 3193.32,574.331 3180.04,597.318C3173.52,608.497 3161.18,615.791 3148.06,615.954C3123.03,616.059 3072.84,616.001 3072.77,616.001C3059.82,615.947 3047.23,609.042 3040.53,597.768C3040.38,597.524 3040.1,597.025 3040.1,597.025C3040.1,597.025 3000.78,528.966 3000.7,528.808C2994.27,517.574 2994.28,503.061 3000.7,491.623C3000.79,491.455 3000.99,491.119 3000.99,491.119C3000.99,491.119 3027.3,445.481 3040.47,422.662C3046.99,411.483 3059.36,403.792 3072.47,403.628C3072.69,403.627 3073.13,403.617 3073.13,403.617L3147.3,403.636L3147.75,403.636ZM3519.89,77.126L3208.64,616.001L3547,616.001L3547,115C3547,97.434 3535.65,82.497 3519.89,77.126ZM3053.34,75L3481.77,75L3250.07,476.157L3035.86,105.276L3053.34,75ZM3149.52,370.191L2882.84,370.191L3016.18,139.336L3149.52,370.191Z" style="fill:url(#_Radial1);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<radialGradient id="_Radial1" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1038.25,0,0,1038.25,3341.03,-89.2588)"><stop offset="0" style="stop-color:rgb(249,166,255);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(234,115,255);stop-opacity:1"/></radialGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
22
apps/afphoto/info
Normal file
22
apps/afphoto/info
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright (c) 2024 Fmstrat
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: Proprietary
|
||||
|
||||
# GNOME shortcut name
|
||||
NAME="Photo"
|
||||
|
||||
# Used for descriptions and window class
|
||||
FULL_NAME="Affinity Photo"
|
||||
|
||||
# The executable inside windows
|
||||
WIN_EXECUTABLE="C:\Program Files\Affinity\Photo 2\Photo.exe"
|
||||
|
||||
# GNOME categories
|
||||
CATEGORIES="WinApps;Affinity"
|
||||
|
||||
# GNOME mimetypes
|
||||
MIME_TYPES=""
|
||||
|
||||
# System Icon
|
||||
ICON="AffinityPhoto"
|
19
apps/afpub/icon.svg
Normal file
19
apps/afpub/icon.svg
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-3679,0)">
|
||||
<g transform="matrix(1.024,0,0,1.024,3679,0)">
|
||||
<g id="publisher_icon_marketing" transform="matrix(2.79101,0,0,2.77709,-106.854,-106.797)">
|
||||
<g transform="matrix(0.349896,0,0,0.351649,38.2852,38.4565)">
|
||||
<path d="M1024,100C1024,44.808 979.192,0 924,0L100,0C44.808,0 0,44.808 0,100L0,924C0,979.192 44.808,1024 100,1024L924,1024C979.192,1024 1024,979.192 1024,924L1024,100Z" style="fill:rgb(137,27,38);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.349896,0,0,0.351649,-1248.98,38.4565)">
|
||||
<path d="M4145.14,949L3887.34,502.652L3754,733.508L3754,909C3754,931.077 3771.92,949 3794,949L4145.14,949ZM4333.13,949L4184.49,949C4184.49,949 3991.94,615.513 3927.43,503.943C3914.78,482.065 3914.78,455.101 3927.42,433.219C3950.75,392.851 3981.34,339.909 3981.34,339.909L4333.13,949ZM4521.12,949L4372.48,949L4003.19,302.072L4075.33,177.182L4521.12,949ZM4628,808.578L4628,909C4628,931.077 4610.08,949 4588,949L4560.47,949L4095,143.121L4134.35,75L4204.3,75L4628,808.578ZM4588,75L4243.64,75L4628,740.456L4628,115C4628,92.923 4610.08,75 4588,75Z" style="fill:url(#_Radial1);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<radialGradient id="_Radial1" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1038.26,0,0,1038.26,4421.95,-89.2604)"><stop offset="0" style="stop-color:rgb(255,174,113);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(255,147,80);stop-opacity:1"/></radialGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 2.0 KiB |
22
apps/afpub/info
Normal file
22
apps/afpub/info
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright (c) 2024 Fmstrat
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: Proprietary
|
||||
|
||||
# GNOME shortcut name
|
||||
NAME="Publisher"
|
||||
|
||||
# Used for descriptions and window class
|
||||
FULL_NAME="Affinity Publisher"
|
||||
|
||||
# The executable inside windows
|
||||
WIN_EXECUTABLE="C:\Program Files\Affinity\Publisher 2\Publisher.exe"
|
||||
|
||||
# GNOME categories
|
||||
CATEGORIES="WinApps;Affinity"
|
||||
|
||||
# GNOME mimetypes
|
||||
MIME_TYPES=""
|
||||
|
||||
# System Icon
|
||||
ICON="AffinityPublisher"
|
54
bin/winapps
54
bin/winapps
@@ -27,6 +27,8 @@ readonly CONFIG_PATH="${HOME}/.config/winapps/winapps.conf"
|
||||
readonly COMPOSE_PATH="${HOME}/.config/winapps/compose.yaml"
|
||||
# shellcheck disable=SC2155 # Silence warnings regarding masking return values through simultaneous declaration and assignment.
|
||||
readonly SCRIPT_DIR_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||
readonly SLEEP_DETECT_PATH="${APPDATA_PATH}/last_activity"
|
||||
readonly SLEEP_MARKER="${APPDATA_PATH}/sleep_marker"
|
||||
|
||||
# OTHER
|
||||
readonly CONTAINER_NAME="WinApps" # FOR 'docker' AND 'podman' ONLY
|
||||
@@ -51,6 +53,7 @@ AUTOPAUSE="off"
|
||||
AUTOPAUSE_TIME="300"
|
||||
DEBUG="true"
|
||||
BOOT_TIMEOUT=120
|
||||
HIDEF="on"
|
||||
|
||||
# OTHER
|
||||
FREERDP_PID=-1
|
||||
@@ -623,7 +626,7 @@ function waRunCommand() {
|
||||
/p:"$RDP_PASS" \
|
||||
/scale:"$RDP_SCALE" \
|
||||
+auto-reconnect \
|
||||
/app:program:"$2" \
|
||||
/app:program:"$2",hidef:"$HIDEF" \
|
||||
/v:"$RDP_IP" &>/dev/null &
|
||||
|
||||
# Capture the process ID.
|
||||
@@ -656,7 +659,7 @@ function waRunCommand() {
|
||||
/scale:"$RDP_SCALE" \
|
||||
+auto-reconnect \
|
||||
/wm-class:"$FULL_NAME" \
|
||||
/app:program:"$WIN_EXECUTABLE",icon:"$ICON",name:"$FULL_NAME" \
|
||||
/app:program:"$WIN_EXECUTABLE",hidef:"$HIDEF",icon:"$ICON",name:"$FULL_NAME" \
|
||||
/v:"$RDP_IP" &>/dev/null &
|
||||
|
||||
# Capture the process ID.
|
||||
@@ -678,7 +681,7 @@ function waRunCommand() {
|
||||
+auto-reconnect \
|
||||
/drive:media,"$REMOVABLE_MEDIA" \
|
||||
/wm-class:"$FULL_NAME" \
|
||||
/app:program:"$WIN_EXECUTABLE",icon:"$ICON",name:"$FULL_NAME",cmd:\""$FILE_PATH"\" \
|
||||
/app:program:"$WIN_EXECUTABLE",hidef:"$HIDEF",icon:"$ICON",name:"$FULL_NAME",cmd:\""$FILE_PATH"\" \
|
||||
/v:"$RDP_IP" &>/dev/null &
|
||||
|
||||
# Capture the process ID.
|
||||
@@ -736,6 +739,50 @@ function waCheckIdle() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Name: 'waTimeSync'
|
||||
# Role: Detect if system went to sleep by comparing uptime progression, then sync time in Windows VM
|
||||
function waTimeSync() {
|
||||
local CURRENT_TIME
|
||||
local CURRENT_UPTIME
|
||||
local STORED_TIME=0
|
||||
local STORED_UPTIME=0
|
||||
local EXPECTED_UPTIME=0
|
||||
local UPTIME_DIFF=0
|
||||
|
||||
CURRENT_TIME=$(date +%s)
|
||||
CURRENT_UPTIME=$(awk '{print int($1)}' /proc/uptime)
|
||||
|
||||
# Read stored values if file exists
|
||||
if [ -f "$SLEEP_DETECT_PATH" ]; then
|
||||
STORED_TIME=$(head -n1 "$SLEEP_DETECT_PATH" 2>/dev/null || echo 0)
|
||||
STORED_UPTIME=$(tail -n1 "$SLEEP_DETECT_PATH" 2>/dev/null || echo 0)
|
||||
fi
|
||||
|
||||
if [ "$STORED_TIME" -gt 0 ] && [ "$STORED_UPTIME" -gt 0 ]; then
|
||||
# Calculate what uptime should be now
|
||||
EXPECTED_UPTIME=$((STORED_UPTIME + CURRENT_TIME - STORED_TIME))
|
||||
UPTIME_DIFF=$((EXPECTED_UPTIME - CURRENT_UPTIME))
|
||||
|
||||
dprint "UPTIME_DIFF: ${UPTIME_DIFF} seconds"
|
||||
|
||||
# If uptime is significantly less than expected, system likely slept
|
||||
if [[ "$UPTIME_DIFF" -gt 30 && ! -f "$SLEEP_MARKER" ]]; then
|
||||
dprint "DETECTED SLEEP/WAKE CYCLE (uptime gap: ${UPTIME_DIFF}s). CREATING SLEEP MARKER TO SYNC WINDOWS TIME."
|
||||
|
||||
# Create sleep marker which will be monitored by Windows VM to trigger time sync
|
||||
touch "$SLEEP_MARKER"
|
||||
|
||||
dprint "CREATED SLEEP MARKER"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Store current values
|
||||
{
|
||||
echo "$CURRENT_TIME"
|
||||
echo "$CURRENT_UPTIME"
|
||||
} > "$SLEEP_DETECT_PATH"
|
||||
}
|
||||
|
||||
### MAIN LOGIC ###
|
||||
#set -x # Enable for debugging.
|
||||
dprint "START"
|
||||
@@ -765,6 +812,7 @@ else
|
||||
fi
|
||||
|
||||
waCheckPortOpen
|
||||
waTimeSync
|
||||
waRunCommand "$@"
|
||||
|
||||
if [[ "$AUTOPAUSE" == "on" ]]; then
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" width="2048" height="2048">
|
||||
<title>POO</title>
|
||||
<title>Windows</title>
|
||||
<defs>
|
||||
<linearGradient id="g1" x2="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-2048,-2048,2048,-2048,2048,2048)">
|
||||
<stop offset="0" stop-color="#067cd6"/>
|
||||
@@ -7,8 +7,5 @@
|
||||
<stop offset="1" stop-color="#7adcff"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<style>
|
||||
.s0 { fill: url(#g1) }
|
||||
</style>
|
||||
<path id="Windows" fill-rule="evenodd" class="s0" d="m228 0h746v974h-974v-746c0-125.9 102.1-228 228-228zm746 2048h-746c-125.9 0-228-102.1-228-228v-746h974zm846-2048c125.9 0 228 102.1 228 228v746h-974v-974zm228 1820c0 125.9-102.1 228-228 228h-746v-974h974z"/>
|
||||
<path id="Windows" fill="url(#g1)" fill-rule="evenodd" class="s0" d="m228 0h746v974h-974v-746c0-125.9 102.1-228 228-228zm746 2048h-746c-125.9 0-228-102.1-228-228v-746h974zm846-2048c125.9 0 228 102.1 228 228v746h-974v-974zm228 1820c0 125.9-102.1 228-228 228h-746v-974h974z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 751 B After Width: | Height: | Size: 723 B |
32
oem/TimeSync.ps1
Normal file
32
oem/TimeSync.ps1
Normal file
@@ -0,0 +1,32 @@
|
||||
# Script to monitor if there is a sleep_marker created by WinApps (indicating the Linux host was suspended) in order to trigger a time sync as the time in the Windows VM will otherwise drift while Linux is suspended.
|
||||
|
||||
# Define the path to monitor. Make sure this matches the location for the sleep_marker in the Winapps script (need to match the APPDATA path).
|
||||
$filePath = "\\tsclient\home\.local\share\winapps\sleep_marker"
|
||||
$networkPath = "\\tsclient\home"
|
||||
|
||||
# Function to check and handle file
|
||||
function Monitor-File {
|
||||
while ($true) {
|
||||
# Check if network location is available
|
||||
try {
|
||||
$null = Test-Path -Path $networkPath -ErrorAction Stop
|
||||
# Check if file exists
|
||||
if (Test-Path -Path $filePath) {
|
||||
# Run time resync silently
|
||||
w32tm /resync /quiet
|
||||
|
||||
# Remove the file
|
||||
Remove-Item -Path $filePath -Force
|
||||
}
|
||||
}
|
||||
catch {
|
||||
# Network location not available, continue monitoring silently
|
||||
}
|
||||
|
||||
# Wait 5 minutes before next check
|
||||
Start-Sleep -Seconds 3000
|
||||
}
|
||||
}
|
||||
|
||||
# Start monitoring silently
|
||||
Monitor-File
|
@@ -40,7 +40,7 @@ if %ERRORLEVEL% equ 0 (
|
||||
echo [SUCCESS] Firewall changes applied successfully.
|
||||
) else (
|
||||
echo [ERROR] Failed to apply firewall changes.
|
||||
echo Please manually enable Remote Desktop via 'Settings ► System ► Remote Desktop'.
|
||||
echo Please manually enable Remote Desktop via 'Settings --> System --> Remote Desktop'.
|
||||
)
|
||||
)
|
||||
|
||||
@@ -77,3 +77,20 @@ if %ERRORLEVEL% neq 0 (
|
||||
echo [ERROR] Failed to create scheduled task "%taskname%".
|
||||
)
|
||||
)
|
||||
|
||||
REM Create time sync task to be run by the user at login
|
||||
copy %~dp0\TimeSync.ps1 %windir%
|
||||
set "taskname2=TimeSync"
|
||||
set "command2=powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -File \"%windir%\TimeSync.ps1\""
|
||||
|
||||
schtasks /query /tn "%taskname2%" >nul
|
||||
if %ERRORLEVEL% equ 0 (
|
||||
echo %DATE% %TIME% Task "%taskname2%" already exists, skipping creation.
|
||||
) else (
|
||||
schtasks /create /tn "%taskname2%" /tr "%command2%" /sc onlogon /rl HIGHEST /f
|
||||
if %ERRORLEVEL% equ 0 (
|
||||
echo %DATE% %TIME% Scheduled task "%taskname2%" created successfully.
|
||||
) else (
|
||||
echo %DATE% %TIME% Failed to create scheduled task %taskname2%.
|
||||
)
|
||||
)
|
||||
|
4
setup.sh
4
setup.sh
@@ -116,7 +116,7 @@ trap "waTerminateScript" ERR # Catch non-zero return values.
|
||||
### FUNCTIONS ###
|
||||
# Name: 'waTerminateScript'
|
||||
# Role: Terminates the script when a non-zero return value is encountered.
|
||||
# shellcheck disable=SC2317 # Silence warning regarding this function being unreachable.
|
||||
# shellcheck disable=SC2329 # Silence warning regarding this function never being invoked (shellCheck is currently bad at figuring out functions that are invoked via trap).
|
||||
function waTerminateScript() {
|
||||
# Store the non-zero exit status received by the trap.
|
||||
local EXIT_STATUS=$?
|
||||
@@ -1043,6 +1043,7 @@ function waCheckRDPAccess() {
|
||||
/p:"$RDP_PASS" \
|
||||
/scale:"$RDP_SCALE" \
|
||||
+auto-reconnect \
|
||||
+home-drive \
|
||||
/app:program:"C:\Windows\System32\cmd.exe",cmd:"/C type NUL > $TEST_PATH_WIN && tsdiscon" \
|
||||
/v:"$RDP_IP" &>"$FREERDP_LOG" &
|
||||
|
||||
@@ -1174,6 +1175,7 @@ function waFindInstalled() {
|
||||
/p:"$RDP_PASS" \
|
||||
/scale:"$RDP_SCALE" \
|
||||
+auto-reconnect \
|
||||
+home-drive \
|
||||
/app:program:"C:\Windows\System32\cmd.exe",cmd:"/C "$BATCH_SCRIPT_PATH_WIN"" \
|
||||
/v:"$RDP_IP" &>"$FREERDP_LOG" &
|
||||
|
||||
|
Reference in New Issue
Block a user