Clipboard Actions - Process Base64 String
I would like to add an 'Action' in the KDE Plasma clipboard to decode a base64 string.
In KDE Plasma (Linux Mint 18), the clipboard widget allows each item to be edited, and a command executed using a regex. I used this feature to mark a base64 text string with a '{' bracket. The goal is to run the action and decode the string, with the output added as new clipboard item.
I copied a base64 text string to the clipboard:
{QGStMW4xdnykZnRv
Then I created a clipboard 'Action' that uses a regex to exclude the bracket and process the rest of the string:
[^{].*$
This seems to work well to segregate the base64 string:
QGStMW4xdnykZnRv
Next, I tried adding either of the following commands (which tested fine in the bash console):
echo %s | base64 --decode
openssl enc -base64 -d <<< %s
The Plasma Clipboard widget uses the '%s' in a command to place the clipboard contents. However, nothing seems to happen.
When editing the command within the Clipboard Action, one of the options is "Output Handling" which I set to "Add to Clipboard". Therefore it is expected that the output of the base64 command should be placed as a new item on the clipboard.
Any insight to solving this will be greatly appreciated.
kde clipboard plasma
New contributor
add a comment |
I would like to add an 'Action' in the KDE Plasma clipboard to decode a base64 string.
In KDE Plasma (Linux Mint 18), the clipboard widget allows each item to be edited, and a command executed using a regex. I used this feature to mark a base64 text string with a '{' bracket. The goal is to run the action and decode the string, with the output added as new clipboard item.
I copied a base64 text string to the clipboard:
{QGStMW4xdnykZnRv
Then I created a clipboard 'Action' that uses a regex to exclude the bracket and process the rest of the string:
[^{].*$
This seems to work well to segregate the base64 string:
QGStMW4xdnykZnRv
Next, I tried adding either of the following commands (which tested fine in the bash console):
echo %s | base64 --decode
openssl enc -base64 -d <<< %s
The Plasma Clipboard widget uses the '%s' in a command to place the clipboard contents. However, nothing seems to happen.
When editing the command within the Clipboard Action, one of the options is "Output Handling" which I set to "Add to Clipboard". Therefore it is expected that the output of the base64 command should be placed as a new item on the clipboard.
Any insight to solving this will be greatly appreciated.
kde clipboard plasma
New contributor
add a comment |
I would like to add an 'Action' in the KDE Plasma clipboard to decode a base64 string.
In KDE Plasma (Linux Mint 18), the clipboard widget allows each item to be edited, and a command executed using a regex. I used this feature to mark a base64 text string with a '{' bracket. The goal is to run the action and decode the string, with the output added as new clipboard item.
I copied a base64 text string to the clipboard:
{QGStMW4xdnykZnRv
Then I created a clipboard 'Action' that uses a regex to exclude the bracket and process the rest of the string:
[^{].*$
This seems to work well to segregate the base64 string:
QGStMW4xdnykZnRv
Next, I tried adding either of the following commands (which tested fine in the bash console):
echo %s | base64 --decode
openssl enc -base64 -d <<< %s
The Plasma Clipboard widget uses the '%s' in a command to place the clipboard contents. However, nothing seems to happen.
When editing the command within the Clipboard Action, one of the options is "Output Handling" which I set to "Add to Clipboard". Therefore it is expected that the output of the base64 command should be placed as a new item on the clipboard.
Any insight to solving this will be greatly appreciated.
kde clipboard plasma
New contributor
I would like to add an 'Action' in the KDE Plasma clipboard to decode a base64 string.
In KDE Plasma (Linux Mint 18), the clipboard widget allows each item to be edited, and a command executed using a regex. I used this feature to mark a base64 text string with a '{' bracket. The goal is to run the action and decode the string, with the output added as new clipboard item.
I copied a base64 text string to the clipboard:
{QGStMW4xdnykZnRv
Then I created a clipboard 'Action' that uses a regex to exclude the bracket and process the rest of the string:
[^{].*$
This seems to work well to segregate the base64 string:
QGStMW4xdnykZnRv
Next, I tried adding either of the following commands (which tested fine in the bash console):
echo %s | base64 --decode
openssl enc -base64 -d <<< %s
The Plasma Clipboard widget uses the '%s' in a command to place the clipboard contents. However, nothing seems to happen.
When editing the command within the Clipboard Action, one of the options is "Output Handling" which I set to "Add to Clipboard". Therefore it is expected that the output of the base64 command should be placed as a new item on the clipboard.
Any insight to solving this will be greatly appreciated.
kde clipboard plasma
kde clipboard plasma
New contributor
New contributor
New contributor
asked 10 hours ago
AlanWAlanW
11
11
New contributor
New contributor
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
AlanW is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1117982%2fclipboard-actions-process-base64-string%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
AlanW is a new contributor. Be nice, and check out our Code of Conduct.
AlanW is a new contributor. Be nice, and check out our Code of Conduct.
AlanW is a new contributor. Be nice, and check out our Code of Conduct.
AlanW is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1117982%2fclipboard-actions-process-base64-string%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown