Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Determine the clipboard command based on the session type
- if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
- clip_cmd="wl-paste --primary --no-newline"
- else
- clip_cmd="xclip -rmlastnl -o"
- fi
- # Retrieve clipboard content and replace newlines with ,,,
- clipboard_content=$($clip_cmd | sed -z 's/\n/,,,/g')
- # Escape special characters and pass to SpeechNote
- echo "$clipboard_content" | sed 's/[^a-zA-Z0-9]/\\&/g' | xargs flatpak run net.mkiol.SpeechNote --action start-reading-text --text
Advertisement
Add Comment
Please, Sign In to add comment