A programmable scratchpad
Notepad Plus
![© Lead Image © IKO, Fotolia.com © Lead Image © IKO, Fotolia.com](/var/linux_magazin/storage/images/issues/2021/245/boop/po-18910-fotolia-iko_fotolia-spiralbuch_resized.png/783384-1-eng-US/PO-18910-Fotolia-IKO_Fotolia-Spiralbuch_resized.png_medium.png)
© 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).
![](/var/linux_magazin/storage/images/issues/2021/245/boop/figure-1/783387-1-eng-US/Figure-1_reference.png)
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.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.