A programmable scratchpad
Notepad Plus
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
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.