A programmable scratchpad
Notepad Plus

© Lead Image © IKO, Fotolia.com
Boop, a digital scratchpad, lets you convert data from your desktop instead of exposing confidential data online. You can even extend Boop with your own functions using JavaScript.
If you need to count words or lines of text, calculate checksums and hashes, optimize program code, or perform any other conversion function, you can easily find an online source to do just that. However, you may not want to copy and paste confidential data to a potentially dubious website.
Instead, Boop [1], a digital notepad that can be scripted, performs this task locally. The open source program originally developed for macOS supports typing or pasting text via clipboard. At the touch of a button, a variety of predefined scripts or even your own small programs can then be applied to the entered text. This means that all the data stays on your computer, and you can save yourself the trouble of searching for the right utility online.
With the release of Boop-GTK [2], a port to the GTK toolkit, Linux and Windows users can now use Boop. The still very young application is not currently listed in the package sources of the major Linux distributions, with the exception of a boop-gtk entry in the Arch User Repository (AUR) for Arch Linux. Users of other distributions need to build the program from the source code or use the Snap [3] or Flathub packages [4] provided by the project.
Scriptable
Fundamentally, Boop works the same way regardless of the task: Copy text or code into the application window or type directly in the editor area, and then activate the script dialog via Ctrl+Shift+P. In the subsequent selection dialog, you can choose between (as of the editorial deadline) 59 different scripts (Figure 1).

The scope of these scripts ranges from Add Slashes (which prepends a backslash to certain special characters like ', ", \, or NUL) to a feature that makes converting localization strings between iOS and Android formats easier. The search field in the dialog header lets you easily filter out a specific function.
For example, web developers can clean up CSS files with Format CSS, prepare text for websites using HTML Decode and HTML Encode, or compress CSS markup via Minify CSS. You can then use Format CSS again to transform the optimized CSS code back into a readable format (Figure 2).
Developers who specialize in programming applications can use Eval Javascript to execute JavaScript directly in the context of Boop and view the output (Figure 3). Similar to CSS code, Boop can also minimize JSON and XML and unpack them accordingly, as well as transform JSON into various other formats.
Various text functions like Camel Case, Kebab Case (all words connected by minus signs), Snake Case (connected with an underscore), Sponge Case (random uppercase/lowercase), Markdown Quote, Reverse Lines, and Reverse String complete the repertoire for editors. If required, MD5 checksums or hash values (SHA-1, SHA-256, and SHA-512) can also be calculated for the entered data.
Add Your Own
If you are missing a certain function, it can be integrated -- with the appropriate know-how -- directly into Boop. For this purpose, the Open Config Directory option in the hamburger menu in the upper right corner opens a file manager with the ~/.config/boop-gtk folder. Boop automatically loads JavaScript files stored in the scripts/ subfolder into the application at program launch time.
For suggestions and details on how the scripts work, use the Get More Scripts menu item. It loads the GitHub repository maintained by the original Boop developer in your browser. You will find a number of scripts that have not yet made it directly into the program [5]. You can use these examples as a template to write your own script.
The Boop project also shows an example script on its homepage: The Poopificator randomly replaces words with a poop emoji [6] -- if that's a function you need. To do this, transfer the contents from Listing 1 to a new file named poop.js, and then move it to ~/.config/boop-gtk/scripts/. After restarting Boop, you will find a new entry named Poopificator under the action drop-down menu.
Listing 1:
Listing 1
poop.js
01 /** 02 { 03 "api":1, 04 "name":"Poopificator", 05 "description":"Swaps random words with poop emojis.", 06 "author":"Ivan", 07 "icon":"html", 08 "tags":"poop,emoji,hashtag" 09 } 10 **/ 11 12 const poopFactor = 0.2 13 14 function main(state) { 15 var all = state.fullText.split(" ") 16 state.fullText = all.map(x => r() ? x : "& 128169;”).join(" ") 17 } 18 19 function r() { 20 return Math.random() >= poopFactor 21 }
The Poopficator action now replaces random words with the HTML code & #128169;. You then use a second action, HTML Decode, to turn the HTML snippets into the desired emoji (Figure 4). The script in Listing 1 requires the second action, because Linux Magazine uses typesetting software that does not allow this type of special character. If you transfer the script directly from Boop's project page, the second action is unnecessary.
Conclusions
If you rely on web services for one or more functions discussed here, Boop offers a useful local solution. The program works without Internet access, requires fewer resources than a web browser, and all data remains on your computer. In addition, the Boop community continually adds new functions. And if you can't find the function you need, you can add your own scripts with some basic programming knowledge.
Infos
- Boop: https://boop.okat.best/
- Boop-GTK: https://github.com/mrbenshef/Boop-GTK
- Boop on Snapcraft: https://snapcraft.io/boop-gtk
- Boop on Flathub: https://flathub.org/apps/details/fyi.zoey.Boop-GTK
- More Boop scripts: https://github.com/IvanMathy/Boop/tree/main/Scripts
- Pile of Poo: https://emojipedia.org/pile-of-poo
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.
News
-
The GNU Project Celebrates Its 40th Birthday
September 27 marks the 40th anniversary of the GNU Project, and it was celebrated with a hacker meeting in Biel/Bienne, Switzerland.
-
Linux Kernel Reducing Long-Term Support
LTS support for the Linux kernel is about to undergo some serious changes that will have a considerable impact on the future.
-
Fedora 39 Beta Now Available for Testing
For fans and users of Fedora Linux, the first beta of release 39 is now available, which is a minor upgrade but does include GNOME 45.
-
Fedora Linux 40 to Drop X11 for KDE Plasma
When Fedora 40 arrives in 2024, there will be a few big changes coming, especially for the KDE Plasma option.
-
Real-Time Ubuntu Available in AWS Marketplace
Anyone looking for a Linux distribution for real-time processing could do a whole lot worse than Real-Time Ubuntu.
-
KSMBD Finally Reaches a Stable State
For those who've been looking forward to the first release of KSMBD, after two years it's no longer considered experimental.
-
Nitrux 3.0.0 Has Been Released
The latest version of Nitrux brings plenty of innovation and fresh apps to the table.
-
Linux From Scratch 12.0 Now Available
If you're looking to roll your own Linux distribution, the latest version of Linux From Scratch is now available with plenty of updates.
-
Linux Kernel 6.5 Has Been Released
The newest Linux kernel, version 6.5, now includes initial support for two very exciting features.
-
UbuntuDDE 23.04 Now Available
A new version of the UbuntuDDE remix has finally arrived with all the updates from the Deepin desktop and everything that comes with the Ubuntu 23.04 base.