Example #1
0
        public static void SetText(string text)
        {
            var tempFileName = Path.GetTempFileName();

            File.WriteAllText(tempFileName, text);
            try
            {
                BashRunner.Run($"cat {tempFileName} | xclip");
            }
            finally
            {
                File.Delete(tempFileName);
            }
        }
Example #2
0
        public static string GetText()
        {
            var tempFileName = Path.GetTempFileName();

            try
            {
                BashRunner.Run($"xclip -o > {tempFileName}");
                return(File.ReadAllText(tempFileName));
            }
            finally
            {
                File.Delete(tempFileName);
            }
        }