For context: I started writing an Arch Linux package for proxyscotch, but quickly hit a roadblock: if proxyscotch-desktop is installed in /usr/bin, then at runtime it tries to creates its certificates in /usr/bin/data, which is obviously wrong.
So, I looked into doing what I wanted: install the binary and icon system-wide, but use the user's home directory to store app data (certificates).
In the end, I changed the following things:
Use the XDG data home for certificates storage, with fallback to the previous behavior if certificates already exists. This means that new install will by default use ~/.local/share/proxyscotch/cert.pem (Linux) or ~/Library/Application Support/proxyscotch/cert.pem (macOS) or LocalAppData\proxyscotch\proxy.pem (Windows)
Similarly, the app icon is looked up in the previous location for backward compatibility, then in /usr/local/share/proxyscotch and /usr/share/proxyscotch (Linux), /Library/Application Support/proxyscotch (macOS), RoamingAppData\proxyscotch and ProgramData\proxyscotch (Windows)
Implement a basic Linux notifier by simply calling the notify-send command (much simpler than adding a library that implements DBus notifications...)
I believe all these changes should be backward-compatible. Please let me know of any issue, or if you would prefer me to split this into several smaller PRs.
For context: I started writing an Arch Linux package for proxyscotch, but quickly hit a roadblock: if
proxyscotch-desktop
is installed in/usr/bin
, then at runtime it tries to creates its certificates in/usr/bin/data
, which is obviously wrong.So, I looked into doing what I wanted: install the binary and icon system-wide, but use the user's home directory to store app data (certificates).
In the end, I changed the following things:
~/.local/share/proxyscotch/cert.pem
(Linux) or~/Library/Application Support/proxyscotch/cert.pem
(macOS) orLocalAppData\proxyscotch\proxy.pem
(Windows)/usr/local/share/proxyscotch
and/usr/share/proxyscotch
(Linux),/Library/Application Support/proxyscotch
(macOS),RoamingAppData\proxyscotch
andProgramData\proxyscotch
(Windows)notify-send
command (much simpler than adding a library that implements DBus notifications...)I believe all these changes should be backward-compatible. Please let me know of any issue, or if you would prefer me to split this into several smaller PRs.