1
0

refactor: centralize common strings, paths, and default values into a new Constants class.

This commit is contained in:
2026-02-28 15:41:40 +01:00
parent 0577640da9
commit 96ccf0ea9a
13 changed files with 80 additions and 38 deletions

View File

@@ -25,7 +25,7 @@ public class ClipboardManager : IClipboardManager
{
pInfo = new ProcessStartInfo
{
FileName = "wl-copy",
FileName = Toak.Core.Constants.Commands.ClipboardWayland,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardInput = true
@@ -35,7 +35,7 @@ public class ClipboardManager : IClipboardManager
{
pInfo = new ProcessStartInfo
{
FileName = "xclip",
FileName = Toak.Core.Constants.Commands.ClipboardX11,
Arguments = "-selection clipboard",
UseShellExecute = false,
CreateNoWindow = true,

View File

@@ -16,7 +16,7 @@ public class Notifications : INotifications
{
var pInfo = new ProcessStartInfo
{
FileName = "notify-send",
FileName = Toak.Core.Constants.Commands.Notify,
Arguments = $"-a \"Toak\" \"{summary}\" \"{body}\"",
UseShellExecute = false,
CreateNoWindow = true
@@ -66,7 +66,7 @@ public class Notifications : INotifications
var pInfo = new ProcessStartInfo
{
FileName = "paplay",
FileName = Toak.Core.Constants.Commands.PlaySound,
Arguments = $"\"{absolutePath}\"",
UseShellExecute = false,
CreateNoWindow = true

View File

@@ -28,7 +28,7 @@ public class TextInjector : ITextInjector
Logger.LogDebug($"Injecting text using wtype...");
pInfo = new ProcessStartInfo
{
FileName = "wtype",
FileName = Toak.Core.Constants.Commands.TypeWayland,
Arguments = $"\"{text.Replace("\"", "\\\"")}\"",
UseShellExecute = false,
CreateNoWindow = true
@@ -39,7 +39,7 @@ public class TextInjector : ITextInjector
Logger.LogDebug($"Injecting text using xdotool...");
pInfo = new ProcessStartInfo
{
FileName = "xdotool",
FileName = Toak.Core.Constants.Commands.TypeX11,
Arguments = $"type --clearmodifiers --delay 0 \"{text.Replace("\"", "\\\"")}\"",
UseShellExecute = false,
CreateNoWindow = true
@@ -67,7 +67,7 @@ public class TextInjector : ITextInjector
Logger.LogDebug($"Setting up stream injection using wtype...");
pInfo = new ProcessStartInfo
{
FileName = "wtype",
FileName = Toak.Core.Constants.Commands.TypeWayland,
Arguments = "-",
UseShellExecute = false,
CreateNoWindow = true,
@@ -79,7 +79,7 @@ public class TextInjector : ITextInjector
Logger.LogDebug($"Setting up stream injection using xdotool...");
pInfo = new ProcessStartInfo
{
FileName = "xdotool",
FileName = Toak.Core.Constants.Commands.TypeX11,
Arguments = "type --clearmodifiers --delay 0 --file -",
UseShellExecute = false,
CreateNoWindow = true,