diff options
author | 90 <hi@90.gripe> | 2024-04-26 16:22:03 +0100 |
---|---|---|
committer | 90 <hi@90.gripe> | 2024-04-26 16:22:03 +0100 |
commit | 337c136ce018fc8d9d12b9e188634925238d11cc (patch) | |
tree | 5733614d537fa373cc5376cdc9b8e29a8de4432c /unix/vncserver/vncserver.in | |
parent | 119a5ff7d2e2543e51947d35be7c5f84f74b3243 (diff) | |
download | tigervnc-337c136ce018fc8d9d12b9e188634925238d11cc.tar.gz tigervnc-337c136ce018fc8d9d12b9e188634925238d11cc.zip |
Implement XDG Base Directory paths, deprecate ~/.vnc
Diffstat (limited to 'unix/vncserver/vncserver.in')
-rwxr-xr-x | unix/vncserver/vncserver.in | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/unix/vncserver/vncserver.in b/unix/vncserver/vncserver.in index 4f674897..ebdd3a97 100755 --- a/unix/vncserver/vncserver.in +++ b/unix/vncserver/vncserver.in @@ -35,13 +35,13 @@ # your site # -# Start with legacy ~/.vnc user dir -$vncUserDir = "$ENV{HOME}/.vnc"; -if (stat($vncUserDir)) { - warn "~/.vnc is deprecated, please migrate to XDGBDS-compliant paths!"; -} else { - # Legacy path doesn't exist, start using new XDG-alike path - $vncUserDir = "$ENV{HOME}/.config/tigervnc"; +$vncUserDir = rindex("$ENV{XDG_CONFIG_HOME}", "/", 0) == 0 + ? "$ENV{XDG_CONFIG_HOME}/tigervnc" + : "$ENV{HOME}/.config/tigervnc"; +$vncLegacyDir = "$ENV{HOME}/.vnc"; +if (!stat($vncUserDir) && stat($vncLegacyDir)) { + warn "~/.vnc is deprecated, please consult 'man vncsession' for paths to migrate to."; + $vncUserDir = $vncLegacyDir; } $vncUserConfig = "$vncUserDir/config"; @@ -119,8 +119,8 @@ $default_opts{pn} = undef; # Load user-overrideable system defaults LoadConfig($vncSystemConfigDefaultsFile); -# Then the user's settings (location overrideable by previous system defaults) -LoadConfig($config{'userconfig'} || $vncUserConfig); +# Then the user's settings +LoadConfig($vncUserConfig); # And then override anything set above if mandatory settings exist. # WARNING: "Mandatory" is used loosely here! As the man page says, |