Closed zkwinkle closed 1 year ago
$USER sounds good, but it needs to be padded/truncated to a constant length for patching to work. It can take place of "preload" in /tmp/discocss-preload.js
, so it has to be truncated/padded to 7 chars. If you want to make a PR I will merge it.
The name needs to be consistent across system restarts, in case the file gets deleted (like on systems that use tmpfs for /tmp), because the patched Discord binary holds a path for the old tmp file. We could generate a random name and store it in ~/.config, but $USER (or hashed $USER) would be easier.
Adressed it in #21 . For the name I used awk
to generate a random ID using $USER as the seed, so it'll stay consistent across restarts and be unique for each user.
I'm trying to run
discocss
from different users in my system simultaneously. Whoever runs it first is fine but whoever is second gets the error:The file inside /tmp/ could be named using
date +%s
to create a unique name for example:If there's an issue with the link inside /tmp changing name each time discocss is rerun at least it could have a unique name per each user with something like: