-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Xsel local support #436
Comments
wouldn’t this be possible without any changes by, at app startup, adding your xsel to the path if u dont find it there? |
Yes, that's a good idea as well,
Hasn't this idea worth to be added to the library as a new feature? (of course only in linux) |
ok i will accept a pr for this |
@SimonCropp , I think I'm almost done, will send the pr
Can you explain me a little bit why did you use Like you used it here: public static string? GetText()
{
var tempFileName = Path.GetTempFileName();
try
{
InnerGetText(tempFileName);
return File.ReadAllText(tempFileName);
}
finally
{
File.Delete(tempFileName);
}
} Just want to increase my knowledge and experience a little bit* I mean a |
You can see my pull request here: #437 |
The PATH is just an environment variable as any other. So if you change it in a process, it only counts for the current environment (thus process). If you Here is an example: #!/bin/bash
echo "configured path: $PATH"
echo "default xsel: $(which xsel)"
echo "Changing path in subshell..."
bash -c 'PATH="/home/arthur:$PATH" && echo "sub path: $PATH" && echo "sub xsel: $(which xsel)"'
echo "xsel after changing path in subshell: $(which xsel)"
echo "path after change in subshell: $PATH" This outputs:
This means your could just change the path when starting the game (or even just before executing TextCopy) and it would work fine without any side-effects.
Manipulating the path shouldn't be slow and you could do it at startup Changing the code for this exact purpose is complicating things. Using environment variables is much easier. |
I'm currently writing a package and a game in C#, and I'm using TextCopy package for copying and pasting texts from
InputElement
.I don't want my users on linux install xsel with command
apt install
, instead I will provide the binary file in my game directory, so I need to run the xsel directly.Is it possible to add support for using xsel locally?
I think the only thing you have to change is in
BashRunner
class, so it runs./xsel
or something like this.Also a bool variable that users can set if they want to use it locally.
Also I can create a PR for it if this idea is acceptable.
The text was updated successfully, but these errors were encountered: