better async for linux
RENAME
src/TextCopy/LinuxClipboard.cs
src/TextCopy/LinuxClipboard_2.0.cs
-#if (NETSTANDARD)
+#if (NETSTANDARD2_0)
using System.IO;
using System.Threading.Tasks;

ADD
src/TextCopy/LinuxClipboard_2.1.cs
+#if (NETSTANDARD2_1)
+using System.IO;
+using System.Threading.Tasks;
+
+static class LinuxClipboard
+{
+ public static async Task SetText(string text)
+ {
+ var tempFileName = Path.GetTempFileName();
+ await File.WriteAllTextAsync(tempFileName, text);
+ try
+ {
+ BashRunner.Run($"cat {tempFileName} | xclip -i -selection clipboard");
+ }
+ finally
+ {
+ File.Delete(tempFileName);
+ }
+ }
+
+ public static async Task<string?> GetText()
+ {
+ var tempFileName = Path.GetTempFileName();
+ try
+ {
+ BashRunner.Run($"xclip -o -selection clipboard > {tempFileName}");
+ return await File.ReadAllTextAsync(tempFileName);
+ }
+ finally
+ {
+ File.Delete(tempFileName);
+ }
+ }
+}
+#endif
\ No newline at end of file

MODIFY
src/UapApp/App.xaml.cs
src/UapApp/App.xaml.cs
@@ -80,7 +80,7 @@ namespace UapApp
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
- private void OnSuspending(object sender, SuspendingEventArgs e)
+ void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity

better async for linux